1+ var
2+ Doc = document , TwL = TweenLite , E0 = Sine . easeInOut , E1 = Sine . easeIn , E2 = Sine . easeOut
3+ B = Doc . getElementById ( 'B' ) , UB = Doc . getElementById ( 'UB' ) ,
4+ F = Doc . getElementById ( 'FF' ) , H = Doc . getElementById ( 'HF' ) ;
5+ TwL . set ( 'svg' , { opacity :1 } ) ;
6+ TwL . set ( B , { y :10 } ) ;
7+ TwL . set ( UB , { fill :'#151515' , transformOrigin :'50% 100%' } ) ;
8+ TwL . set ( H , { transformOrigin :'-5px 0px' , rotation :- 10 , fill :'#454545' , y :- 1 } ) ;
9+ TwL . set ( F , { transformOrigin :'55% 10px' , rotation :- 37 , fill :'#DC0026' } ) ;
10+ TwL . set ( '#H' , { transformOrigin :'5px 50px' , fill :'#454545' , scale :0.967 , rotation :- 5 } ) ;
11+ TwL . set ( '.H1' , { rotation :- 20 , transformOrigin :'0px 5px' , y :- 5 } ) ;
12+ TwL . set ( '.H2' , { transformOrigin :'10% 0%' , rotation :- 10 , y :- 1.5 , scaleY :1.03 } ) ;
13+ TwL . set ( '.F1' , { transformOrigin :'21px 2px' } ) ;
14+ TwL . set ( '.F2' , { transformOrigin :'25px 0px' } ) ;
15+ TwL . set ( '.F3' , { transformOrigin :'4.2px 4.2px' } ) ;
16+ var F2 = F . cloneNode ( true ) , H2 = H . cloneNode ( true ) ;
17+ F2 . id = 'FB' ; H2 . id = 'HB' ;
18+ B . insertBefore ( F2 , UB ) ; B . insertBefore ( H2 , F2 ) ;
19+ TwL . set ( '.FB' , { fill :'#DC0026' } ) ;
20+ TwL . set ( '#FB' , { fill :'#A50018' } ) ;
21+ TwL . set ( '#HB' , { y :- 3 , fill :'#333' } ) ;
22+ function M ( p1 , p2 ) {
23+ var tl = new TimelineMax ( { repeat :- 1 } )
24+ . add ( "l1" , 0 ) . add ( "l2" , .25 ) . add ( "l3" , .5 ) . add ( "l4" , .75 ) . add ( "l5" , 1 )
25+ . to ( p1 , .5 , { rotation :27 , ease :E0 } , 'l1' )
26+ . to ( p1 , .25 , { rotation :- 37 , ease :E1 } , 'l3' )
27+ . to ( p1 + ' .F1' , .25 , { rotation :15 , ease :E0 } , 'l2' )
28+ . to ( p1 + ' .F1' , .25 , { rotation :80 , ease :E1 } , 'l3' )
29+ . to ( p1 + ' .F1' , .25 , { rotation :0 , ease :E2 } , 'l4' )
30+ . to ( p1 + ' .F2' , .25 , { rotation :45 , repeat :1 , yoyo :true } , 'l3' )
31+ . to ( p1 + ' .F3' , .25 , { rotation :- 35 , repeat :1 , yoyo :true , scaleX :.925 } , 'l2' )
32+ . to ( p2 , .5 , { rotation :25 , ease :E0 , yoyo :true , repeat :1 } , 'l1' )
33+ . to ( p2 + ' .H1' , .5 , { rotation :15 , ease :E0 , yoyo :true , repeat :1 } , 'l1' )
34+ . to ( p2 + ' .H2' , .5 , { rotation :0 , ease :E0 , yoyo :true , repeat :1 } , 'l1' ) ;
35+ return tl ;
36+ } ;
37+ var MTl = new TimelineLite ( )
38+ . add ( M ( '#FF' , '#HB' ) ) . add ( M ( '#FB' , '#HF' ) , 0.5 )
39+ . to ( B , .25 , { y :'+=' + - 20 , repeat :- 1 , yoyo :true , ease :E0 } , 0 )
40+ . to ( '#H' , .25 , { rotation :5 , repeat :- 1 , yoyo :true , ease :E0 } , 0 )
41+ . to ( '#mSH' , .25 , { scaleX :.6 , repeat :- 1 , yoyo :true , ease :E1 , transformOrigin :'center' } , 0 )
42+ . time ( .5 ) ;
0 commit comments