-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
44 lines (40 loc) · 1.29 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
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="styles/base.css">
<script type="text/javascript" src="scripts/main.js"></script>
<script>
</script>
</head>
<body style='background-color: black'>
<canvas id="startingCanvas" height="550px" width="550px" ></canvas>
<button onclick="startBtnClicked()">Start</button>
<script>
function startBtnClicked(){
LoadingSpinner.initialize({canvas: startingCanvas});
var phase = LoadingSpinner.PhaseTypeEnum.TRAINING;
LoadingSpinner.setPhase(phase);
var progress = 0;
setInterval(function(){
switch (phase){
case LoadingSpinner.PhaseTypeEnum.COLLECTING:
if (progress < 1){
progress += 0.10;
LoadingSpinner.setProgress(progress);
if (progress >= 1){
LoadingSpinner.setPhase(LoadingSpinner.PhaseTypeEnum.TRAINING);
progress = 0;
}
}
break;
case LoadingSpinner.PhaseTypeEnum.TRAINING:
if (progress < 1){
progress += 0.05;
LoadingSpinner.setProgress(progress);
}
break;
}
}, 200);
}
</script>
</body>
</html>