-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
120 lines (108 loc) · 2.48 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html>
<head>
<meta charset=utf8>
<title>Ninjacon 2016: Sea Shark Invtro</title>
<style>
* {
font-family: sans-serif;
display: none;
color: transparent;
}
.visible, .visible * {
display: block;
}
html, body {
width: 100%;
height: 100%;
display: block;
overflow: hidden;
padding: 0;
margin: 0;
border: 0;
outline: 0;
background-size: cover;
background: #948170;
}
canvas {
position: fixed;
display: block;
background: #000;
}
.hide {
display: none;
}
.progress-bar-inner {
width: 0;
height: 100%;
background: #ffffaa;
transition: width, 0.1s;
}
.progress-bar-container {
position: fixed;
left: 5%;
right: 5%;
top: 50%;
height: 100px;
margin-top: -50px;
border: 5px solid #ffffaa;
padding: 5px;
}
#start-button {
position: fixed;
left: 40%;
top: 50%;
right: 40%;
height: 100px;
margin-top: -50px;
color: #ffffaa;
text-decoration: none;
text-align: center;
border: 5px solid #ffffaa;
font-size: 24px;
line-height: 100px;
}
</style>
</head>
<body>
<div id=wrapper class=visible>
<div class=progress-bar-container>
<div class=progress-bar-inner>
</div>
</div>
<a id=start-button class=hide href=javascript:; onclick=STARTDEMO();>
START
</a>
</div>
<script>
var progressBarInner = document.querySelector('.progress-bar-inner');
var progressBarContainer = document.querySelector('.progress-bar-container');
var wrapper = document.querySelector('#wrapper');
var startButton = document.querySelector('#start-button');
var fakeProgress = 0;
var isDoneLoading = false;
var progress = 0;
function progressBarUpdater() {
fakeProgress += (100 - fakeProgress) * 0.2;
var realProgress = +progress * 0;
progressBarInner.style.width = ((((realProgress + fakeProgress) * 100) | 0) / 100) + '%';
if(!isDoneLoading) {
setTimeout(progressBarUpdater, 100);
}
}
setTimeout(progressBarUpdater);
ONPROGRESS = function(p) {
progress = p;
};
ONCOMPLETE = function() {
isDoneLoading = true;
progressBarInner.style.width = '100%';
progressBarContainer.classList.add('hide');
startButton.classList.remove('hide');
};
STARTDEMO = function() {
wrapper.classList.remove('visible');
document.body.style.background = '#000';
demo.start();
};
</script>