Skip to content

Commit 95611fd

Browse files
committed
refacto theatre logic
1 parent f2df79d commit 95611fd

File tree

3 files changed

+48
-10
lines changed

3 files changed

+48
-10
lines changed

classes/Animations.ts

+38-10
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ export default class Animations {
1111
canvas: any
1212
ui: any
1313
uiParams: any
14-
projects: []
14+
projects: Array<any>
1515

1616
constructor() {
1717

18+
this.projects = []
1819
this.studio = studio
1920
this.canvas = document.querySelector(".container-canvas canvas")
2021
this.ui = document.querySelector(".ui")
@@ -56,6 +57,8 @@ export default class Animations {
5657

5758
}
5859

60+
61+
5962

6063
// gsap shit
6164
createTimeline() {
@@ -75,6 +78,7 @@ export default class Animations {
7578

7679
}
7780

81+
7882
return project;
7983

8084
}
@@ -86,13 +90,40 @@ export default class Animations {
8690
if(audio) {
8791
this.attachAudio(sheet, audio)
8892
}
93+
8994
return sheet;
9095
}
9196

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+
92121

93122
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+
96127

97128
this.createTheatreObject(
98129
{
@@ -121,15 +152,12 @@ export default class Animations {
121152

122153
}
123154

124-
// createIntroduction2() {
125-
// const project = getProject('Introduction', { introductionState });
126-
// const sheet = project.sheet('Camera Animation');
127-
// }
128-
129155
createIntroduction(camera) {
130-
const project = this.createProject('Introduction', { state: introductionState })
156+
// const project = this.createProject('Introduction', { state: introductionState })
131157
// 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 })
133161

134162
this.createTheatreObject(
135163
{

components/UI.vue

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
<img src="/images/fullscreen.svg" alt="">
2525
</button> -->
2626
</div>
27+
28+
<div class="ui-permanent">
29+
30+
</div>
31+
32+
2733
</template>
2834
<script setup>
2935
const { toggle } = useFullscreen()

public/images/TR.svg

+4
Loading

0 commit comments

Comments
 (0)