-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathindex.html
54 lines (50 loc) · 1.24 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<html>
<head>
<meta charset="utf-8">
<title>Threading Example</title>
<style>
.loading-emoji {
font-size: 60px;
width: 60px;
height: 80px;
}
</style>
<script>
function rotateElement(element, speed = 2) {
let degree = 0;
setInterval(() => {
degree = (degree + speed) % 360;
element.style.transform = `rotate(${degree}deg)`;
}, 20);
}
document.addEventListener('DOMContentLoaded', () => {
const loadingCircle = document.getElementById('loading-emoji');
rotateElement(loadingCircle);
});
</script>
</head>
<body>
<script type="module" src="Sources/JavaScript/index.js"></script>
<h1>Threading Example</h1>
<p>
<div>
<label for="background">Background:</label>
<input id="background" type="checkbox" checked>
</div>
<div>
<label for="size">Size:</label>
<input id="size" type="number" value="800">
</div>
<div>
<label for="concurrency">Concurrency:</label>
<input id="concurrency" type="number">
<button id="render-button">Render</button>
</div>
</p>
<p>
<div id="loading-emoji" class="loading-emoji">🧵</div>
</p>
<p id="render-time"></p>
<canvas id="canvas"></canvas>
</body>
</html>