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

video.js 1.2KB

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