forked from KanoComputing/tapcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
285 lines (249 loc) · 11.3 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<base href="/">
<title>Tapcode</title>
<meta name="description" content="Tapcode">
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=no">
<!-- Icons -->
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicons/favicon-16x16.png">
<link rel="shortcut icon" href="assets/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png">
<link rel="mask-icon" href="assets/favicons/safari-pinned-tab.svg" color="#ff6900">
<!-- Custom font -->
<link href="https://fonts.googleapis.com/css?family=Space+Mono:400,700" rel="stylesheet">
<!-- Web-app support -->
<link rel="manifest" href="./manifest.json">
<meta name="msapplication-config" content="./browserconfig.xml">
<meta name="theme-color" content="#292f35">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- iOS startup images -->
<!-- iPad retina portrait startup image -->
<link href="/assets/favicons/splash1536x2008.png"
media="(device-width: 768px) and (device-height: 1024px)
and (-webkit-device-pixel-ratio: 2)
and (orientation: portrait)"
rel="apple-touch-startup-image">
<!-- iPad retina landscape startup image -->
<link href="/assets/favicons/splash1496x2048.png"
media="(device-width: 768px) and (device-height: 1024px)
and (-webkit-device-pixel-ratio: 2)
and (orientation: landscape)"
rel="apple-touch-startup-image">
<!-- iPad non-retina portrait startup image -->
<link href="/assets/favicons/splash768x1004.png"
media="(device-width: 768px) and (device-height: 1024px)
and (-webkit-device-pixel-ratio: 1)
and (orientation: portrait)"
rel="apple-touch-startup-image">
<!-- iPad non-retina landscape startup image -->
<link href="/assets/favicons/splash748x1024.png"
media="(device-width: 768px) and (device-height: 1024px)
and (-webkit-device-pixel-ratio: 1)
and (orientation: landscape)"
rel="apple-touch-startup-image">
<!-- iPhone 6 Plus portrait startup image -->
<link href="/assets/favicons/splash1242x2148.png"
media="(device-width: 414px) and (device-height: 736px)
and (-webkit-device-pixel-ratio: 3)
and (orientation: portrait)"
rel="apple-touch-startup-image">
<!-- iPhone 6 Plus landscape startup image -->
<link href="/assets/favicons/splash1182x2208.png"
media="(device-width: 414px) and (device-height: 736px)
and (-webkit-device-pixel-ratio: 3)
and (orientation: landscape)"
rel="apple-touch-startup-image">
<!-- iPhone 6 startup image -->
<link href="https://placehold.it/750x1294"
media="(device-width: 375px) and (device-height: 667px)
and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image">
<!-- iPhone 5 startup image -->
<link href="/assets/favicons/splash640x1096.png"
media="(device-width: 320px) and (device-height: 568px)
and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image">
<!-- iPhone < 5 retina startup image -->
<link href="/assets/favicons/splash640x920.png"
media="(device-width: 320px) and (device-height: 480px)
and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image">
<!-- iPhone < 5 non-retina startup image -->
<link href="/assets/favicons/splash320x460.png"
media="(device-width: 320px) and (device-height: 480px)
and (-webkit-device-pixel-ratio: 1)"
rel="apple-touch-startup-image">
<!-- For Google -->
<meta name="description" content="A creative coding tool from Kano"/>
<meta name="keywords" content="Tapcode Kano Computing Creative Coding"/>
<meta name="application-name" content="Tapcode"/>
<!-- For Facebook -->
<meta property="og:title" content="Tapcode"/>
<meta property="og:url" content="https://tapcode.kano.me/assets/social/tapcode.gif"/>
<meta property="og:image" content="https://tapcode.kano.me/assets/social/tapcode.gif"/>
<meta property="og:description" content="A creative coding tool from Kano"/>
<!-- For Twitter -->
<meta name="twitter:title" content="Tapcode"/>
<meta name="twitter:description" content="A creative coding tool from Kano"/>
<meta name="twitter:image" content="assets/social/tapcode.gif"/>
<meta name="twitter:card" content="summary"/>
<!-- build:env -->
<script>
window.Kano = window.Kano || {};
window.Kano.Tapcode = window.Kano.Tapcode || {};
window.Kano.Tapcode.Config = window.Kano.Tapcode.Config || {};
window.Kano.Tapcode.Config.ENV = 'staging';
</script>
<!-- endbuild-->
<!-- build:es5adapter -->
<!-- endbuild -->
<script src="./bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<link rel="import" href="./src/config/default.html">
<!-- build:config -->
<link rel="import" href="./src/config/development.html">
<!-- endbuild -->
<style>
html, body {
height: 100%;
margin: 0;
background: #292f35;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
* {
user-select: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
tc-app {
height: 100%;
box-sizing: border-box;
}
#splash {
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: #292f35;
z-index: 101;
transition: opacity 440ms;
opacity: 1;
}
img#kano-logo {
display: block;
height: 70px;
padding: 8px;
margin: 0 auto;
transform: scale(0.8);
opacity: 0;
}
.animate-in {
animation: animateIn 280ms ease-in-out forwards;
}
.animate-out {
animation: animateOut 280ms ease-in-out forwards;
}
@keyframes animateIn {
0% {transform: scale(0); opacity: 0;}
56% {transform: scale(1); opacity: 1;}
100% {transform: scale(0.8); opacity: 1;}
}
@keyframes animateOut {
0% {transform: scale(0.8); opacity: 1;}
44% {transform: scale(1); opacity: 1;}
100% {transform: scale(0); opacity: 0;}
}
</style>
</head>
<body>
<div id="splash">
<img id="kano-logo" src="assets/kano-logo.svg">
<audio id="sound-on" preload="auto">
<source src="assets/soundOn.m4a" type="audio/mp4"/>
<source src="assets/soundOn.ogg" type="audio/ogg"/>
</audio>
<audio id="sound-off" preload="auto">
<source src="assets/soundOff.m4a" type="audio/mp4"/>
<source src="assets/soundOff.ogg" type="audio/ogg"/>
</audio>
</div>
<tc-app id="app"></tc-app>
<script type="text/javascript">
var lastTouchEnd = 0;
document.addEventListener('touchend', function (event) {
var now = (new Date()).getTime();
if (now - lastTouchEnd <= 300) {
event.preventDefault();
}
lastTouchEnd = now;
}, false);
var splash = document.getElementById('splash'),
logo = document.getElementById('kano-logo'),
soundOn = document.getElementById('sound-on'),
soundOff = document.getElementById('sound-off'),
app = document.getElementById('app'),
appReady,
timeUp;
window.onload = function () {
if (Kano.Tapcode.Config.DEBUG) {
timeUp = true;
lazyLoadApp();
tryLoad();
return;
}
logo.classList.add('animate-in');
soundOn.volume = 0.5;
soundOn.play();
lazyLoadApp();
setTimeout(function () {
timeUp = true;
tryLoad();
}, 1200);
};
function tryLoad () {
if (appReady && timeUp) {
showEditor();
}
}
function lazyLoadApp () {
var appImport = document.createElement('link');
appImport.rel = 'import';
appImport.href = '/src/tc-app.html';
appImport.id = 'appImport';
app.addEventListener('firstpageloaded', onFirstPageLoaded);
document.head.appendChild(appImport);
}
function onFirstPageLoaded () {
appReady = true;
tryLoad();
app.removeEventListener('firstpageloaded', onFirstPageLoaded);
}
function showEditor () {
logo.classList.remove('animate-in');
logo.classList.add('animate-out');
soundOff.volume = 0.5;
soundOff.play();
setTimeout(function () {
document.getElementById('splash').style.opacity = '0';
}, 280);
setTimeout(function () {
while (splash.firstChild) {
splash.removeChild(splash.firstChild);
}
splash.parentNode.removeChild(splash);
app.loading = false;
}, 760);
}
</script>
</body>
</html>