Skip to content

Commit a87cd00

Browse files
committed
last fixs
1 parent c06f601 commit a87cd00

38 files changed

+188
-83
lines changed

assets/fonts/Etna-Black.woff

-75.4 KB
Binary file not shown.

assets/fonts/Etna-Black.woff2

-51.3 KB
Binary file not shown.

assets/fonts/Etna-BlackItalic.woff

-82 KB
Binary file not shown.

assets/fonts/Etna-BlackItalic.woff2

-55.3 KB
Binary file not shown.

assets/fonts/Etna-Bold.woff

-76.4 KB
Binary file not shown.

assets/fonts/Etna-Bold.woff2

-52.3 KB
Binary file not shown.

assets/fonts/Etna-BoldItalic.woff

-84.1 KB
Binary file not shown.

assets/fonts/Etna-BoldItalic.woff2

-57.5 KB
Binary file not shown.

assets/fonts/Etna-Extrabold.woff

-76.2 KB
Binary file not shown.

assets/fonts/Etna-Extrabold.woff2

-52.3 KB
Binary file not shown.
-83.9 KB
Binary file not shown.
-57.4 KB
Binary file not shown.

assets/fonts/Etna-Italic.woff

-83.9 KB
Binary file not shown.

assets/fonts/Etna-Italic.woff2

-57.5 KB
Binary file not shown.

assets/fonts/Etna-Light.woff

-74 KB
Binary file not shown.

assets/fonts/Etna-Light.woff2

-50.2 KB
Binary file not shown.

assets/fonts/Etna-LightItalic.woff

-81.7 KB
Binary file not shown.

assets/fonts/Etna-LightItalic.woff2

-54.6 KB
Binary file not shown.

assets/fonts/Etna-Regular.woff

-75 KB
Binary file not shown.

assets/fonts/Etna-Regular.woff2

-51.4 KB
Binary file not shown.

assets/fonts/Etna-Semibold.woff

-73.6 KB
Binary file not shown.

assets/fonts/Etna-Semibold.woff2

-50.1 KB
Binary file not shown.

assets/fonts/Etna-SemiboldItalic.woff

-81.6 KB
Binary file not shown.
-54.8 KB
Binary file not shown.

assets/fonts/MatrixCodeNFI.woff

12.9 KB
Binary file not shown.

assets/fonts/MatrixCodeNFI.woff2

9.67 KB
Binary file not shown.

assets/states-animations/Introduction.theatre-project-state.json

+39
Original file line numberDiff line numberDiff line change
@@ -591,13 +591,52 @@
591591
"trackIdByPropPath": {
592592
"[\"opacity\"]": "EEA-KN9xQI"
593593
}
594+
},
595+
"ui": {
596+
"trackData": {
597+
"t0fd9M9B7d": {
598+
"type": "BasicKeyframedTrack",
599+
"__debugName": "ui:[\"opacity\"]",
600+
"keyframes": [
601+
{
602+
"id": "ux8sJyf5ag",
603+
"position": 0,
604+
"connectedRight": true,
605+
"handles": [
606+
0.5,
607+
1,
608+
0.5,
609+
0
610+
],
611+
"value": 1
612+
},
613+
{
614+
"id": "28ga0n2rZA",
615+
"position": 0.967,
616+
"connectedRight": true,
617+
"handles": [
618+
0.5,
619+
1,
620+
0.5,
621+
0
622+
],
623+
"value": 0
624+
}
625+
]
626+
}
627+
},
628+
"trackIdByPropPath": {
629+
"[\"opacity\"]": "t0fd9M9B7d"
630+
}
594631
}
595632
}
596633
}
597634
}
598635
},
599636
"definitionVersion": "0.4.0",
600637
"revisionHistory": [
638+
"2RseZ4TqifIQ1-BB",
639+
"9nYHEVVuF_vCrI56",
601640
"YtatyU_sqwzZQIqJ",
602641
"m_dLPZhxi5jaweqY",
603642
"8AWtL__tW7L3zOTE",

assets/states-animations/Micro-anim.theatre-project-state.json

+1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@
296296
},
297297
"definitionVersion": "0.4.0",
298298
"revisionHistory": [
299+
"wSrlM7_GBkCIwiNs",
299300
"BgfyjdFlCLTInP5l",
300301
"Xlscy6aMkb86m6hZ",
301302
"sTDvJIbJYbtnzNjB"

assets/styles/fonts.scss

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@font-face {
2+
font-family: 'Matrix Code NFI';
3+
src: url('@/assets/fonts/MatrixCodeNFI.woff2') format('woff2'),
4+
url('@/assets/fonts/MatrixCodeNFI.woff') format('woff');
5+
font-weight: normal;
6+
font-style: normal;
7+
font-display: swap;
8+
}

assets/styles/main.scss

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import './fonts.scss';

classes/Animations.ts

+31-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { getProject, types as t } from '@theatre/core'
22
import { ObjectType } from '@/classes/interfaces/ObjectType';
33
import introductionState from '@/assets/states-animations/Introduction.theatre-project-state.json'
4+
import microState from '@/assets/states-animations/Micro-anim.theatre-project-state.json'
45
import studio from "@theatre/studio"
56

67
export default class Animations {
@@ -11,11 +12,12 @@ export default class Animations {
1112
canvas: any
1213
ui: any
1314
uiParams: any
14-
projects: Array<any>
15+
btnParams: any
16+
anims: Array<any>
1517

1618
constructor() {
1719

18-
this.projects = []
20+
this.anims = []
1921
this.studio = studio
2022
this.canvas = document.querySelector(".container-canvas canvas")
2123
this.ui = document.querySelector(".ui")
@@ -40,12 +42,17 @@ export default class Animations {
4042
};
4143

4244

43-
this.uiParams = {
45+
this.btnParams = {
4446
opacity: t.number(1, { range: [0, 1] }),
4547
width: t.number(100, { range: [0, 100] }),
4648
transform: { x:0, y:0 }
4749
}
4850

51+
this.uiParams = {
52+
opacity: t.number(1, { range: [0, 1] }),
53+
width: t.number(100, { range: [0, 100] }),
54+
}
55+
4956
this.studio.initialize()
5057

5158
if(window.location.pathname === '/studio') {
@@ -55,9 +62,13 @@ export default class Animations {
5562
}
5663

5764

65+
5866
}
5967

60-
68+
createAnimations(camera) {
69+
this.createStartAnim()
70+
this.createIntroduction(camera)
71+
}
6172

6273

6374
createProject(project_name, project_state?: ObjectType) {
@@ -106,16 +117,16 @@ export default class Animations {
106117
sheet = this.createSheet(project, sheet_name)
107118
}
108119

109-
this.projects.push({ project_name, project, sheet })
120+
this.anims.push({ project_name, project, sheet })
110121

111122
return { project, sheet }
112123
}
113124

114125

115-
createMicroInteraction() {
126+
createStartAnim() {
116127
//const project = this.createProject('Micro-anim')
117128
//const sheet = this.createSheet(project, 'Button Animation')
118-
const { sheet } = this.createProjectAndSheet('Micro-anim', 'Button Animation')
129+
const { sheet } = this.createProjectAndSheet('Micro-anim', 'Button Animation', { state: microState })
119130

120131

121132
this.createTheatreObject(
@@ -125,33 +136,33 @@ export default class Animations {
125136
{
126137
name: "button p",
127138
type: "2d", // dom
128-
properties: this.uiParams,
139+
properties: this.btnParams,
129140
real: this.ui.querySelector('.button-start p'),
130141
},
131142
{
132143
name: "border-bottom",
133144
type: "2d", // dom
134-
properties: this.uiParams,
145+
properties: this.btnParams,
135146
real: this.ui.querySelector('.border-bottom'),
136147
},
137148
{
138149
name: "border-top",
139150
type: "2d", // dom
140-
properties: this.uiParams,
151+
properties: this.btnParams,
141152
real: this.ui.querySelector('.border-top'),
142153
},
143154
],
144155
})
145156

146-
// this.playAnimations(project, sheet, 1)
157+
147158
}
148159

149160
createIntroduction(camera) {
150161
// const project = this.createProject('Introduction', { state: introductionState })
151162
// const sheet = this.createSheet(project, 'Camera Animation', '/sounds/initialisation.mp3')
152163
// const sheet = this.createSheet(project, 'Camera Animation')
153164

154-
const { sheet, project } = this.createProjectAndSheet('Introduction', 'Camera Animation', { state: introductionState })
165+
const { sheet } = this.createProjectAndSheet('Introduction', 'Camera Animation', { state: introductionState })
155166

156167
this.createTheatreObject(
157168
{
@@ -179,9 +190,14 @@ export default class Animations {
179190
}
180191
)
181192

182-
this.playAnimations(project, sheet, 1)
193+
//this.playAnimations(project, sheet, 1)
183194
}
184195

196+
play(name, iterationCount) {
197+
const { project, sheet } = this.anims.find(anim => anim.project_name === name)
198+
project.ready.then(() => sheet.sequence.play({ iterationCount: iterationCount }))
199+
}
200+
185201

186202

187203
createEnding() {
@@ -259,7 +275,9 @@ export default class Animations {
259275
}
260276

261277

278+
262279
playAnimations(project, sheet, iterationCount: number) {
280+
263281
project.ready.then(() => sheet.sequence.play({ iterationCount: iterationCount }))
264282
}
265283
}

classes/Scene.ts

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export default class Scene {
1212
webgl: any;
1313
uniforms: any;
1414
material: any;
15-
debug: any
1615
params: any
1716
lights: any
1817
postProcess: any

classes/Stats.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class Stats {
2323
this.statsEl.showPanel(0);
2424
document.body.appendChild(this.statsEl.dom);
2525
this.webglInfos = document.createElement('div');
26-
this.webglInfos.classList.add('webgl-infos');
26+
this.webglInfos.classList.add('webgl-infos txt_uppercase');
2727
document.querySelector('.ui').appendChild(this.webglInfos);
2828

2929
}

classes/WebGL.ts

+25-18
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default class WebGL {
5858
// MANAGERS
5959
this.cameraManager = new CameraManager({ webgl: this})
6060
this.animations = useAnimations()
61-
61+
this.animations.createAnimations(this.camera)
6262

6363
// RAYCASTER
6464
this.raycast = new Raycaster(
@@ -71,7 +71,7 @@ export default class WebGL {
7171
// MATERIALS
7272
this.materials = new Materials({ webgl: this })
7373
this.setEvents();
74-
this.loadMap('trinity-2.glb')
74+
this.loadMap('trinity-3.glb')
7575

7676

7777
if (/debug/.test(window.location.href)) {
@@ -101,7 +101,6 @@ export default class WebGL {
101101
}
102102

103103

104-
105104
removeOldMap = async () => {
106105
const old_map = this.scene.instance.children.find(child => child.name === "Scene")
107106
this.scene.instance.remove(old_map)
@@ -120,30 +119,38 @@ export default class WebGL {
120119
})
121120

122121

122+
123+
123124
this.emitter.on('audio_started', () => {
124125

125126
// trigger anim webgl
126127
// const target = new THREE.Vector3(0, 1, 0)
127128
// const cube = this.scene.instance.getObjectByProperty('name', 'cube-base');
128129
// console.log(cube)
130+
this.animations.play('Micro-anim')
129131

130-
this.animations.createMicroInteraction()
131-
this.animations.createIntroduction(this.camera)
132-
this.materials.playVideos()
133-
this.audio_manager = useAudio(this.emitter)
134-
135-
this.audio_manager.start( {
136-
onBeat: ()=> {
137-
138-
const average = this.audio_manager.values.reduce((a, b) => a + b, 0) / this.audio_manager.values.length;
139-
this.emitter.emit('beat_sent', average)
140-
},
141-
live: false,
142-
playlist: ['/sounds/initialisation.mp3', '/sounds/megatron-ss.mp3', '/sounds/burningman-s.mp3']
143-
})
144132

133+
134+
setTimeout(() => {
135+
// this.animations.createIntroduction(this.camera)
136+
this.animations.play('Introduction')
137+
138+
this.materials.playVideos()
139+
this.audio_manager = useAudio(this.emitter)
140+
141+
this.audio_manager.start( {
142+
onBeat: ()=> {
145143

146-
this.audio_started = true
144+
const average = this.audio_manager.values.reduce((a, b) => a + b, 0) / this.audio_manager.values.length;
145+
this.emitter.emit('beat_sent', average)
146+
},
147+
live: false,
148+
playlist: ['/sounds/initialisation.mp3', '/sounds/megatron-ss.mp3', '/sounds/burningman-s.mp3']
149+
})
150+
this.audio_started = true
151+
}, 2300);
152+
153+
147154
// window.audio = this.audio_manager
148155

149156
})

0 commit comments

Comments
 (0)