-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathindex.html
38 lines (35 loc) · 1.25 KB
/
index.html
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
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta property="og:image" content="./social.jpg" />
<title>Rainy Window</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="stylesheet" href="styles/style.css" />
</head>
<body>
<div id="container"></div>
<input id="filePicker" type="file" accept=".jpg, .jpeg, .png, .mp4, .webm" style="visibility: hidden" />
<div id="progressbar" class="indeterminate-progress-bar">
<div class="indeterminate-progress-bar__progress"></div>
</div>
<script src="js/dat.gui.min.js"></script>
<script src="js/three.min.js"></script>
<script src="js/script.js"></script>
<script>
//threejs scene first run
let background = document.getElementById("container");
const progress = document.getElementById("progressbar");
document.addEventListener("sceneLoaded", () => {
if (background.style.opacity == 0) setVisible(background);
progress.style.display = "none";
});
async function setVisible(element) {
for (let val = 0; val < 1; val += 0.1) {
element.style.opacity = val;
await new Promise((r) => setTimeout(r, 75));
}
}
</script>
</body>
</html>