@@ -28,32 +28,169 @@ angular.module('myApp').controller('AnimationController', function($scope, $time
2828// }
2929// };
3030
31- $scope . startBlock = function ( id , timeout ) {
31+ // $scope.startBlock = function(id, timeout) {
32+ //
33+ // var blockInstance = blockUI.instances.get(id);
34+ //
35+ // blockInstance.start();
36+ //
37+ // if(timeout >= 0) {
38+ // $timeout(function() {
39+ // blockInstance.stop();
40+ // }, timeout);
41+ // }
42+ // };
43+ //
44+ // $scope.stopBlock = function(id) {
45+ // var blockInstance = blockUI.instances.get(id);
46+ // blockInstance.stop();
47+ // };
48+ //
49+ // $scope.toggleBlock = function(id) {
50+ // var blockInstance = blockUI.instances.get(id);
51+ //
52+ // if(blockInstance.state().blocking) {
53+ // blockInstance.stop();
54+ // } else {
55+ // blockInstance.start();
56+ // }
57+ // };
58+
59+ var animateConfig = {
60+
61+ "attention_seekers" : {
62+ "bounce" : true ,
63+ "flash" : true ,
64+ "pulse" : true ,
65+ "rubberBand" : true ,
66+ "shake" : true ,
67+ "swing" : true ,
68+ "tada" : true ,
69+ "wobble" : true
70+ } ,
71+
72+ "bouncing_entrances" : {
73+ "bounceIn" : true ,
74+ "bounceInDown" : true ,
75+ "bounceInLeft" : true ,
76+ "bounceInRight" : true ,
77+ "bounceInUp" : true
78+ } ,
79+
80+ "bouncing_exits" : {
81+ "bounceOut" : true ,
82+ "bounceOutDown" : true ,
83+ "bounceOutLeft" : true ,
84+ "bounceOutRight" : true ,
85+ "bounceOutUp" : true
86+ } ,
3287
33- var blockInstance = blockUI . instances . get ( id ) ;
88+ "fading_entrances" : {
89+ "fadeIn" : true ,
90+ "fadeInDown" : true ,
91+ "fadeInDownBig" : true ,
92+ "fadeInLeft" : true ,
93+ "fadeInLeftBig" : true ,
94+ "fadeInRight" : true ,
95+ "fadeInRightBig" : true ,
96+ "fadeInUp" : true ,
97+ "fadeInUpBig" : true
98+ } ,
3499
35- blockInstance . start ( ) ;
100+ "fading_exits" : {
101+ "fadeOut" : true ,
102+ "fadeOutDown" : true ,
103+ "fadeOutDownBig" : true ,
104+ "fadeOutLeft" : true ,
105+ "fadeOutLeftBig" : true ,
106+ "fadeOutRight" : true ,
107+ "fadeOutRightBig" : true ,
108+ "fadeOutUp" : true ,
109+ "fadeOutUpBig" : true
110+ } ,
36111
37- if ( timeout >= 0 ) {
38- $timeout ( function ( ) {
39- blockInstance . stop ( ) ;
40- } , timeout ) ;
112+ "flippers" : {
113+ "flip" : true ,
114+ "flipInX" : true ,
115+ "flipInY" : true ,
116+ "flipOutX" : true ,
117+ "flipOutY" : true
118+ } ,
119+
120+ "lightspeed" : {
121+ "lightspeedIn" : true ,
122+ "lightspeedOut" : true
123+ } ,
124+
125+ "rotating_entrances" : {
126+ "rotateIn" : true ,
127+ "rotateInDownLeft" : true ,
128+ "rotateInDownRight" : true ,
129+ "rotateInUpLeft" : true ,
130+ "rotateInUpRight" : true
131+ } ,
132+
133+ "rotating_exits" : {
134+ "rotateOut" : true ,
135+ "rotateOutDownLeft" : true ,
136+ "rotateOutDownRight" : true ,
137+ "rotateOutUpLeft" : true ,
138+ "rotateOutUpRight" : true
139+ } ,
140+
141+ "specials" : {
142+ "hinge" : true ,
143+ "rollIn" : true ,
144+ "rollOut" : true
145+ } ,
146+
147+ "zooming_entrances" : {
148+ "zoomIn" : true ,
149+ "zoomInDown" : true ,
150+ "zoomInLeft" : true ,
151+ "zoomInRight" : true ,
152+ "zoomInUp" : true
153+ } ,
154+
155+ "zooming_exits" : {
156+ "zoomOut" : true ,
157+ "zoomOutDown" : true ,
158+ "zoomOutLeft" : true ,
159+ "zoomOutRight" : true ,
160+ "zoomOutUp" : true
41161 }
42- } ;
43162
44- $scope . stopBlock = function ( id ) {
45- var blockInstance = blockUI . instances . get ( id ) ;
46- blockInstance . stop ( ) ;
47163 } ;
48164
49- $scope . toggleBlock = function ( id ) {
50- var blockInstance = blockUI . instances . get ( id ) ;
165+ ( function ( ) {
166+
167+ var options = [ ] ;
51168
52- if ( blockInstance . state ( ) . blocking ) {
53- blockInstance . stop ( ) ;
54- } else {
55- blockInstance . start ( ) ;
169+ angular . forEach ( animateConfig , function ( group , groupName ) {
170+ angular . forEach ( group , function ( b , animName ) {
171+ options . push ( {
172+ name : animName , group : groupName
173+ } ) ;
174+ } ) ;
175+ } ) ;
176+
177+
178+ $scope . animateCss = {
179+ options : options ,
180+ selected : options [ 0 ]
181+ } ;
182+
183+ } ) ( ) ;
184+
185+ $scope . $watch ( 'animateCss.recompile' , function ( value ) {
186+
187+ if ( ! value ) {
188+ $scope . animateCss . recompile = true ;
56189 }
57- } ;
190+ } ) ;
191+
192+ var blockInstance = blockUI . instances . get ( 'animateCssTest' ) ;
193+ blockInstance . addRef ( ) ;
194+ blockInstance . start ( ) ;
58195
59196} ) ;
0 commit comments