Personal portfolio website for Regina Carvalho. Built with Famous.js library.

page.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * @ngdoc function
  3. * @name domainManagerApp.controller:AboutCtrl
  4. * @description
  5. * # AboutCtrl
  6. * Controller of the domainManagerApp
  7. */
  8. angular.module('goApp.page', ['ngFx', 'ngAnimate', 'goApp.data'])
  9. .controller('PageController',['$scope', '$rootScope', '$famous', '$timeline', '$location', '$route', '$timeout', 'Data', '$mixpanel', function ($scope, $rootScope, $famous, $timeline, $location, $route, $timeout, Data, $mixpanel) {
  10. 'use strict';
  11. console.log('> Loading Text Page');
  12. // Get Page Data
  13. var link = $location.url();
  14. $scope.pageData = Data.getPageData(link);
  15. $rootScope.$on('data:loaded', function(data) {
  16. if(!$scope.$$phase) {
  17. $scope.$apply(function(){
  18. $scope.pageData = Data.getPageData(link);
  19. $scope.showSlider();
  20. $mixpanel.track('Page View', { "Page": $scope.pageData.link });
  21. });
  22. }
  23. });
  24. // FadeIn
  25. $timeout(function(){
  26. $scope.showView = true;
  27. },100);
  28. // FadeOut
  29. $scope.fadeOut = function() {
  30. $scope.showView = false;
  31. $timeout(function(){
  32. $scope.showView = false;
  33. $location.path("/");
  34. },800);
  35. };
  36. }]);