James Peret's personal portfolio website version 2. Built with Famous.js and AngularJS.

page.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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', function ($scope, $rootScope, $famous, $timeline, $location, $route, $timeout, Data) {
  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. });
  21. }
  22. });
  23. // FadeIn
  24. $timeout(function(){
  25. $scope.showView = true;
  26. },100);
  27. // FadeOut
  28. $scope.fadeOut = function() {
  29. $scope.showView = false;
  30. $timeout(function(){
  31. $scope.showView = false;
  32. $location.path("/");
  33. },800);
  34. };
  35. }]);