Skip to content

Commit 4d3d4a4

Browse files
committed
Add css animation
1 parent 1c11b98 commit 4d3d4a4

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

src/index.css

+19-6
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ body,
5555
text-transform: uppercase;
5656
}
5757

58-
canvas {
59-
width: 100%;
60-
height: 100%;
61-
display: block;
62-
}
63-
6458
.fork {
6559
position: absolute;
6660
bottom: 0;
@@ -73,3 +67,22 @@ canvas {
7367
font-size: x-small;
7468
z-index: 1; /* Above the canvas. */
7569
}
70+
71+
.scene {
72+
width: 100%;
73+
height: 100%;
74+
display: block;
75+
animation: 4s ease-in-out showScene;
76+
}
77+
78+
@keyframes showScene {
79+
0% {
80+
transform: scale(0);
81+
border-radius: 100%;
82+
}
83+
84+
100% {
85+
transform: scale(1);
86+
border-radius: 0;
87+
}
88+
}

src/lib/scene-manager.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export class SceneManager {
5757
}
5858

5959
render(containerEl: Element): void {
60-
containerEl.appendChild(this.renderer.domElement);
60+
const canvas = this.renderer.domElement;
61+
canvas.classList.add('scene');
62+
containerEl.appendChild(canvas);
6163
this.renderer.setAnimationLoop(this.animate.bind(this));
6264
this.spawnSound();
6365
}

0 commit comments

Comments
 (0)