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

test.js 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /**
  2. * @ngdoc function
  3. * @name domainManagerApp.controller:AboutCtrl
  4. * @description
  5. * # AboutCtrl
  6. * Controller of the domainManagerApp
  7. */
  8. angular.module('goApp.test', ['ngFx', 'ngAnimate', 'goApp.data'])
  9. .controller('TestController',['$scope', '$rootScope', '$famous', '$timeline', '$location', '$route', '$timeout', 'Data', function ($scope, $rootScope, $famous, $timeline, $location, $route, $timeout, Data) {
  10. 'use strict';
  11. var link = $location.url();
  12. $scope.pageData = Data.getPageData(link);
  13. $rootScope.$on('data:loaded', function(data) {
  14. if(!$scope.$$phase) {
  15. $scope.$apply(function(){
  16. $scope.pageData = Data.getPageData(link);
  17. });
  18. }
  19. });
  20. // FadeIn
  21. $timeout(function(){
  22. $scope.showView = true;
  23. },100);
  24. $scope.fadeOut = function() {
  25. $scope.showView = false;
  26. $timeout(function(){
  27. $location.path("/");
  28. },500);
  29. };
  30. // Moving Cube
  31. var Transitionable = $famous['famous/transitions/Transitionable'];
  32. var Easing = $famous['famous/transitions/Easing'];
  33. $scope.t = new Transitionable(0);
  34. $scope.translation = $timeline([
  35. [0, [500, 400, 100], Easing.inOutQuad],
  36. [0.25, [400, 200, 100], Easing.inOutQuad],
  37. [0.5, [300, 300, 100], Easing.inOutQuad],
  38. [0.75, [200, 500, 100], Easing.inOutQuad],
  39. [1, [100, 100, 100], Easing.inOutQuad],
  40. ]);
  41. $scope.startAnimations = function(){
  42. $scope.t.delay((1000), function(){ // we will delay each animation based on index
  43. $scope.t.set(1, {duration: 3400}, function(){
  44. // Animation Completion Callback
  45. });
  46. });
  47. };
  48. //$scope.startAnimations();
  49. $scope.pageData = Data.getPageData();
  50. $scope.startAnimations();
  51. }]);