-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.html
277 lines (245 loc) · 6.38 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Into a wormhole</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="description" content="Experience the space time curvature and strange lensing effects of a 3D wormhole in your browser.">
<style>
*, *::before, *::after {
margin: 0;
box-sizing: border-box;
}
body, html {
width: 100%;
height: 100%;
background: #000;
}
body {
background: #000;
color: #eee;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif;
}
p {
margin-bottom: 0.75em;
max-width: 50em;
}
a {
color: #387aff;
}
canvas {
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
display: block;
}
.screen {
padding: 0 1em;
overflow: hidden;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 10;
transition: all 0.3s ease;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
align-items: center;
text-shadow: 0 0 0.25em #000;
background: rgba(0, 0, 0, 0.25);
}
.swipe-icon-wrapper {
width: 8em;
height: 8em;
margin-top: 2em;
position: relative;
}
.swipe-icon {
width: 4em;
height: 4em;
fill: #fff;
position: absolute;
transform: translate(-50%, -50%);
animation: mobile-instructions 7s ease-in-out infinite;
}
@keyframes mobile-instructions {
0% {
top: 50%;
left: 50%;
opacity: 0;
}
5% {
top: 50%;
left: 50%;
opacity: 1;
}
15% {
top: 0;
left: 50%;
opacity: 1;
}
20% {
top: 0;
left: 50%;
opacity: 0;
}
25% {
top: 50%;
left: 50%;
opacity: 0;
}
30% {
top: 50%;
left: 50%;
opacity: 1;
}
40% {
top: 0;
left: 50%;
opacity: 1;
}
45% {
top: 0;
left: 50%;
opacity: 0;
}
50% {
top: 50%;
left: 50%;
opacity: 0;
}
55% {
top: 50%;
left: 50%;
opacity: 1;
}
65% {
top: 50%;
left: 0;
}
85% {
top: 50%;
left: 100%;
}
95% {
top: 50%;
left: 50%;
opacity: 1;
}
100% {
top: 50%;
left: 50%;
opacity: 0;
}
}
.screen.hidden {
opacity: 0;
overflow: auto;
visibility: hidden;
pointer-events: none;
}
.title {
font-size: 4em;
margin: 0 0 0.5em;
}
@media (max-width: 800px) {
.title {
font-size: 3em;
}
}
@media (max-width: 480px) {
.title {
font-size: 2em;
}
}
.intro {
margin-bottom: 0.75em;
}
.dismiss-info {
margin: 2em;
}
.ui {
position: fixed;
bottom: 0;
left: 0;
z-index: 1;
text-align: left;
padding: 0.5em;
background: rgba(0, 0, 0, 0.5);
transition: all 0.2s ease;
}
.diagram {
cursor: pointer;
font-size: 0.8em;
}
.start-vr {
font-size: 1.5em;
position: absolute;
bottom: 0.5em;
right: 0;
font-family: inherit;
color: #fff;
background: #333;
border: none;
border-radius: 0.5em 0 0 0.5em;
padding: 1em;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
font-weight: bold;
cursor: pointer;
transition: background-color 0.2s ease;
}
.start-vr:hover {
background: #454545;
}
.vr-icon {
display: block;
width: 2em;
fill: currentColor;
}
.start-vr.hidden {
display: none;
}
.ui.hidden, .screen:not(.hidden) ~ .ui {
opacity: 0;
}
.ui.hidden:hover {
opacity: 1;
}
</style>
</head>
<body>
<div id="canvas-wrapper">
</div>
<div class="splash screen">
<h1 class="title">Into a wormhole</h1>
<p class="intro">Wormholes are weird. Wormholes with “throats” are even weirder. Here you can experience that weirdness for yourself.</p>
<p class="intro">For more (mathematical) details, check the <a href="https://github.com/sirxemic/wormhole#readme" target="_blank">Github repo</a>.</p>
<p class="dismiss-info">Click or tap anywhere to continue</p>
</div>
<div class="mobile-instructions screen hidden">
<p>Swipe vertically to move forwards and backwards. Swipe horizontally to look around.</p>
<div class="swipe-icon-wrapper">
<svg class="swipe-icon" viewBox="0 0 37 45" xmlns="http://www.w3.org/2000/svg">
<path d="M12,3.974C12.014,1.778 13.801,0 16,0C18.208,0 20,1.792 20,4L20,13.58L33.143,16.503C35.277,16.978 36.698,19.126 36.325,21.306L36.321,21.331L34,34.389L34,45L12,45L12,33.071L7.658,28.729L3.286,27.936L3.261,27.931C1.103,27.525 -0.328,25.45 0.064,23.286C0.458,21.114 2.542,19.67 4.714,20.064L12,21.386L12,4L12,3.974Z"/>
</svg>
</div>
</div>
<div class="ui">
<label class="diagram"><input type="checkbox" name="hide-ui"> Hide diagram & lift restricted movement</label>
</div>
<button class="start-vr hidden">
<svg class="vr-icon" viewBox="0 0 18 11" xmlns="http://www.w3.org/2000/svg">
<path d="M9.011,7.87C9.235,7.873 9.443,7.987 9.568,8.173C9.83,8.567 10.141,9.033 10.406,9.431C10.777,9.988 11.402,10.322 12.07,10.322L15.5,10.322C16.88,10.322 18,9.202 18,7.822L18,2.822C18,1.442 17.017,0.468 15.5,0.322C13.335,0.113 11.167,0.003 9,0L8.898,0C6.765,0.006 4.631,0.116 2.5,0.322C0.983,0.468 0,1.442 0,2.822L0,7.822C0,9.202 1.12,10.322 2.5,10.322L5.93,10.322C6.598,10.322 7.223,9.988 7.594,9.431C7.859,9.033 8.17,8.567 8.432,8.173C8.559,7.984 8.772,7.87 9,7.87L9.011,7.87ZM2.318,3.403L3.632,3.403L4.298,5.08C4.376,5.279 4.448,5.471 4.513,5.657C4.577,5.842 4.652,6.034 4.736,6.233L4.77,6.233C4.854,6.034 4.928,5.842 4.993,5.657C5.057,5.471 5.129,5.279 5.208,5.08L5.856,3.403L7.128,3.403L5.469,7L3.978,7L2.318,3.403ZM14.292,7L13.239,5.703L12.565,5.703L12.565,7L11.318,7L11.318,3.403L13.298,3.403C13.59,3.403 13.864,3.421 14.119,3.458C14.375,3.495 14.599,3.556 14.793,3.643C14.987,3.729 15.14,3.844 15.252,3.988C15.364,4.131 15.42,4.309 15.42,4.523C15.42,4.788 15.331,5.005 15.151,5.177C14.971,5.348 14.735,5.475 14.443,5.56L15.682,7L14.292,7ZM12.565,5.058L13.197,5.058C13.522,5.058 13.771,5.013 13.942,4.923C14.113,4.833 14.199,4.699 14.199,4.523C14.199,4.346 14.113,4.223 13.942,4.153C13.771,4.083 13.522,4.048 13.197,4.048L12.565,4.048L12.565,5.058Z" />
</svg>
</button>
<script type="module" src="/src/main.ts"></script>
</body>
</html>