@@ -4,7 +4,9 @@ import { TweenMax, Power3, Power4, RoughEase, Linear } from 'gsap'
4
4
5
5
// Create class - needed something that was effected by vue
6
6
export default class VueBuildIntro {
7
- constructor ( ) {
7
+ constructor ( callback ) {
8
+ this . callback = callback
9
+ // console.log(callback('hit'))
8
10
this . height = window . innerHeight
9
11
this . width = window . innerWidth
10
12
this . primaryColor = parseInt ( '41B883' , 16 ) // #41B883
@@ -25,6 +27,8 @@ export default class VueBuildIntro {
25
27
this . all . positionY = this . height / 2
26
28
this . all . positionYStart = - 200
27
29
this . all . positionYEnd = 200
30
+ this . slogan = this . slogan ( )
31
+ this . gettingStarted = this . getStarted ( )
28
32
29
33
// Make a container to hold all v's
30
34
this . app . stage . addChild ( this . all ) // Add to state
@@ -136,6 +140,67 @@ export default class VueBuildIntro {
136
140
return rect
137
141
}
138
142
143
+ slogan ( ) {
144
+ var style = new PIXI . TextStyle ( {
145
+ fontFamily : 'Helvetica' ,
146
+ fontSize : 50 ,
147
+ fontWeight : 'bold' ,
148
+ fill : this . primaryColor
149
+ } )
150
+
151
+ var text = new PIXI . Text ( 'Ultra Super Simple Cli' , style )
152
+ text . pivot . x = text . width / 2
153
+ text . pivot . y = text . height
154
+ text . x = this . width / 2
155
+ text . y = this . height + 100
156
+
157
+ this . app . stage . addChildAt ( text , this . app . stage . length - 1 )
158
+
159
+ return text
160
+ }
161
+
162
+ getStarted ( ) {
163
+ var box = new PIXI . Container ( )
164
+ var style = new PIXI . TextStyle ( {
165
+ fontFamily : 'Helvetica' ,
166
+ fontSize : 35 ,
167
+ fontWeight : 'bold' ,
168
+ fill : this . primaryColor
169
+ } )
170
+
171
+ var text = new PIXI . Text ( 'Getting Started' , style )
172
+ text . pivot . x = text . width / 2
173
+ text . pivot . y = text . height
174
+ text . x = this . width / 2
175
+ text . y = this . height / 2
176
+
177
+ var rect = new PIXI . Graphics ( )
178
+ rect . beginFill ( this . secondaryColor , 1 )
179
+ rect . drawRect ( 0 , 0 , 300 , 75 )
180
+ rect . endFill ( )
181
+ rect . pivot . x = rect . width / 2
182
+ rect . pivot . y = rect . height
183
+ rect . x = this . width / 2
184
+ rect . y = this . height / 2
185
+
186
+ box . on ( 'pointerdown' , ( ) => {
187
+ console . log ( 'yep' )
188
+ this . callback ( 'getting-started' )
189
+ } )
190
+
191
+ // Set box
192
+ box . addChild ( rect )
193
+ box . addChild ( text )
194
+ box . pivot . x = box . width / 2
195
+ box . pivot . y = box . height
196
+ box . x = this . width / 2
197
+ box . y = this . height / 2
198
+
199
+ this . app . stage . addChildAt ( box , this . app . stage . length - 1 )
200
+
201
+ return box
202
+ }
203
+
139
204
// Animate is responsible for calling animations in order and timing
140
205
animate ( ) {
141
206
// Zoom v in
@@ -164,6 +229,8 @@ export default class VueBuildIntro {
164
229
} )
165
230
. then ( ( ) => {
166
231
this . slideAllUp ( )
232
+ this . slideSloganUp ( )
233
+ this . slideGettingStartedUp ( )
167
234
} )
168
235
}
169
236
@@ -396,7 +463,36 @@ export default class VueBuildIntro {
396
463
TweenMax . to ( this . all , timing , {
397
464
delay : delay ,
398
465
y : 200 ,
399
- ease : Power3 . easeInOut
466
+ ease : Power3 . easeInOut ,
467
+ onComplete : ( ) => {
468
+ resolve ( )
469
+ }
470
+ } )
471
+ } )
472
+ }
473
+
474
+ slideSloganUp ( timing = 2 , delay = 0.5 ) {
475
+ return new Promise ( ( resolve , reject ) => {
476
+ TweenMax . to ( this . slogan , timing , {
477
+ delay : delay ,
478
+ y : 500 ,
479
+ ease : Power3 . easeInOut ,
480
+ onComplete : ( ) => {
481
+ resolve ( )
482
+ }
483
+ } )
484
+ } )
485
+ }
486
+
487
+ slideGettingStartedUp ( timing = 2 , delay = 0.5 ) {
488
+ return new Promise ( ( resolve , reject ) => {
489
+ TweenMax . to ( this . gettingStarted , timing , {
490
+ delay : delay ,
491
+ y : 600 ,
492
+ ease : Power3 . easeInOut ,
493
+ onComplete : ( ) => {
494
+ resolve ( )
495
+ }
400
496
} )
401
497
} )
402
498
}
0 commit comments