Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- angular.module("application").controller("DefaultController", ["$scope", "$stateParams", "$state", function($scope, $stateParams, $state) {
- var params = [];
- angular.forEach($stateParams, function(value, key) {
- params[key] = value
- }), $scope.params = params, $scope.current = $state.current.name, $state.current.views ? ($scope.vars = $state.current.data.vars, $scope.composed = $state.current.data.vars.children) : $scope.vars = $state.current.data.vars
- }]), angular.module("application").controller("NavController", ["$scope", "$state", function($scope, $state) {
- $scope.current = $state.current.name;
- var routes = angular.copy(foundationRoutes);
- $scope.routing = [], $scope.typedText = "", foundationRoutes && angular.forEach(routes, function(r) {
- var title = r.title || r.name.replace(".", " ");
- $scope.routing.push(title)
- }), $scope.selectRoute = function(routeName) {
- var name = routeName.replace(" ", ".");
- angular.forEach(routes, function(r) {
- return r.title && r.title === routeName ? void $state.go(r.name) : name === r.name ? void $state.go(r.name) : void 0
- })
- }
- }]), angular.module("application").controller("MotionUIController", ["$scope", "$state", "FoundationApi", "$animate", "$window", function($scope, $state, FoundationApi, $animate, $window) {
- $scope.current = $state.current.name, $scope.element = {}, $scope.speeds = ["linear", "ease", "easeIn", "easeOut", "easeInOut", "bounceIn", "bounceOut", "bounceInOut"], $scope.transitions = [{
- direction: "enter",
- type: "Slide",
- classes: ["slideInDown", "slideInUp", "slideInLeft", "slideInRight"]
- }, {
- direction: "leave",
- type: "Slide",
- classes: ["slideOutBottom", "slideOutUp", "slideOutLeft", "slideOutRight"]
- }, {
- direction: "enter",
- type: "Fade",
- classes: ["fadeIn"]
- }, {
- direction: "leave",
- type: "Fade",
- classes: ["fadeOut"]
- }, {
- direction: "enter",
- type: "Hinge",
- classes: ["hingeInFromTop", "hingeInFromBottom", "hingeInFromRight", "hingeInFromLeft", "hingeInFromMiddleX", "hingeInFromMiddleY"]
- }, {
- direction: "leave",
- type: "Hinge",
- classes: ["hingeOutFromTop", "hingeOutFromBottom", "hingeOutFromRight", "hingeOutFromLeft", "hingeOutFromMiddleX", "hingeOutFromMiddleY"]
- }, {
- direction: "enter",
- type: "Scale",
- classes: ["zoomIn"]
- }, {
- direction: "leave",
- type: "Scale",
- classes: ["zoomOut"]
- }, {
- direction: "enter",
- type: "Spin",
- classes: ["spinIn", "spinInCCW"]
- }, {
- direction: "leave",
- type: "Spin",
- classes: ["spinOut", "spinOutCCW"]
- }], $scope.update = function() {
- var kitty = angular.element('<img id="kitty" src="http://placekitten.com/g/600/300" />'),
- presentKitty = $window.document.getElementById("kitty"),
- demoElementParent = $window.document.getElementById("demo-card-parent"),
- animationClasses = "";
- for (prop in $scope.element) "default" !== $scope.element[prop] && "undefined" !== $scope.element[prop] && (animationClasses += $scope.element[prop] + " ");
- kitty.addClass(animationClasses), "enter" === $scope.animationFilter ? (presentKitty && presentKitty.remove(), $animate.enter(kitty, demoElementParent).then(function() {
- kitty.removeClass(animationClasses)
- })) : ($animate.enter(kitty, demoElementParent), $animate.leave(kitty), presentKitty && presentKitty.remove())
- }
- }]);
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement