@@ -11,10 +11,11 @@ export default class Animations {
11
11
canvas : any
12
12
ui : any
13
13
uiParams : any
14
- projects : [ ]
14
+ projects : Array < any >
15
15
16
16
constructor ( ) {
17
17
18
+ this . projects = [ ]
18
19
this . studio = studio
19
20
this . canvas = document . querySelector ( ".container-canvas canvas" )
20
21
this . ui = document . querySelector ( ".ui" )
@@ -56,6 +57,8 @@ export default class Animations {
56
57
57
58
}
58
59
60
+
61
+
59
62
60
63
// gsap shit
61
64
createTimeline ( ) {
@@ -75,6 +78,7 @@ export default class Animations {
75
78
76
79
}
77
80
81
+
78
82
return project ;
79
83
80
84
}
@@ -86,13 +90,40 @@ export default class Animations {
86
90
if ( audio ) {
87
91
this . attachAudio ( sheet , audio )
88
92
}
93
+
89
94
return sheet ;
90
95
}
91
96
97
+ createProjectAndSheet ( project_name : String , sheet_name : String , project_state ?: ObjectType , audio ?) {
98
+
99
+ let project ;
100
+ let sheet ;
101
+
102
+ if ( project_state ) {
103
+ project = this . createProject ( project_name , project_state )
104
+
105
+ } else {
106
+ project = this . createProject ( project_name )
107
+ }
108
+
109
+ if ( audio ) {
110
+ sheet = this . createSheet ( project , sheet_name , audio )
111
+
112
+ } else {
113
+ sheet = this . createSheet ( project , sheet_name )
114
+ }
115
+
116
+ this . projects . push ( { project_name, project, sheet } )
117
+
118
+ return { project, sheet }
119
+ }
120
+
92
121
93
122
createMicroInteraction ( ) {
94
- const project = this . createProject ( 'Micro-anim' )
95
- const sheet = this . createSheet ( project , 'Button Animation' )
123
+ //const project = this.createProject('Micro-anim')
124
+ //const sheet = this.createSheet(project, 'Button Animation')
125
+ const { sheet } = this . createProjectAndSheet ( 'Micro-anim' , 'Button Animation' )
126
+
96
127
97
128
this . createTheatreObject (
98
129
{
@@ -121,15 +152,12 @@ export default class Animations {
121
152
122
153
}
123
154
124
- // createIntroduction2() {
125
- // const project = getProject('Introduction', { introductionState });
126
- // const sheet = project.sheet('Camera Animation');
127
- // }
128
-
129
155
createIntroduction ( camera ) {
130
- const project = this . createProject ( 'Introduction' , { state : introductionState } )
156
+ // const project = this.createProject('Introduction', { state: introductionState })
131
157
// const sheet = this.createSheet(project, 'Camera Animation', '/sounds/initialisation.mp3')
132
- const sheet = this . createSheet ( project , 'Camera Animation' )
158
+ // const sheet = this.createSheet(project, 'Camera Animation')
159
+
160
+ const { sheet, project } = this . createProjectAndSheet ( 'Introduction' , 'Camera Animation' , { state : introductionState } )
133
161
134
162
this . createTheatreObject (
135
163
{
0 commit comments