-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.js
More file actions
27 lines (21 loc) · 701 Bytes
/
main.js
File metadata and controls
27 lines (21 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { createScene, switchControls } from './scene.js';
import './style.scss'
// Create 3D environment
createScene();
// HTML elements
const loader = document.getElementById("progress");
const loadContainer = document.getElementById("loader");
const controlsFps = document.getElementById("fps");
const controlsOrbit = document.getElementById("orbit");
export function loadProgress(progress) {
loader.style.width = `${progress * 100}%`;
}
export function loadComplete() {
loadContainer.classList.add("hide");
}
controlsFps.onchange = () => {
if (controlsFps.checked) switchControls("fps");
}
controlsOrbit.onchange = () => {
if (controlsOrbit.checked) switchControls("orbit");
}