-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
170 lines (150 loc) · 4.72 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
<!DOCTYPE html>
<html lang="en">
<!-- 👋 https://github.com/benfoxall/scrub 👋 -->
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta
http-equiv="origin-trial"
content="AhZ0yP35wnlfvVtqZa+GRb3MfXgtHnS8+i5+tgRI+tkz0/b7DQ+a72h1nLzbWxT/WfvVGN95G2hIexI/5P+sRgkAAABVeyJvcmlnaW4iOiJodHRwczovL2JlbmphbWluYmVuYmVuLmNvbTo0NDMiLCJmZWF0dXJlIjoiV2ViQ29kZWNzIiwiZXhwaXJ5IjoxNjM4NDAzMTk5fQ=="
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@200&display=swap"
rel="stylesheet"
/>
<title>Scrub</title>
<script
async
src="https://unpkg.com/[email protected]/dist/es-module-shims.js"
></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/",
"simplex-noise": "https://cdn.skypack.dev/simplex-noise",
"idb-keyval": "https://cdn.skypack.dev/idb-keyval"
}
}
</script>
<link rel="stylesheet" href="index.css" />
</head>
<body>
<nav id="nav">
<details>
<summary>Scrub</summary>
<ol>
<li><a href="?scroll">Window scroll</a></li>
<li><a href="?texture">Time warp</a></li>
<li><a href="?cube">Cube</a></li>
<li><a href="?spiral">Spiral</a></li>
<li><a href="?spiral-flat">Spiral Flat</a></li>
<li><a href="?ar">AR</a></li>
</ol>
<hr />
<select>
<option value="skate-square.mp4">Skate</option>
<option value="earth.mp4">Earth</option>
<option value="ink.mp4">Ink (lg)</option>
<option value="motorbike.mp4">Motorbike</option>
<option value="traffic.mp4">Traffic</option>
<option value="ferry-square.mp4">Ferry</option>
</select>
<input type="file" accept="video/*" />
<button id="clear">clear</button>
</details>
</nav>
<script type="module">
import { initUI } from "./src/util/sources.js";
initUI();
</script>
<template data-href="?scroll">
<script type="module">
import { Scroller } from "./src/Scroller.js";
import { videoSrc } from "./src/util/sources.js";
new Scroller(videoSrc);
</script>
</template>
<template data-href="?texture">
<aside>
<input type="range" min="0" max="512" value="0" id="slide" />
</aside>
<script type="module">
import { Texture } from "./src/Texture.js";
import { videoSrc } from "./src/util/sources.js";
new Texture(videoSrc);
</script>
</template>
<template data-href="?cube">
<aside>
<label>
side
<input
name="x"
type="range"
min="0"
max="1"
value="1"
step="0.00001"
/>
</label>
<label>
top
<input
name="y"
type="range"
min="0"
max="1"
value="1"
step="0.00001"
/>
</label>
<label>
time
<input
name="z"
type="range"
min="0"
max="1"
value="1"
step="0.00001"
/>
</label>
</aside>
<script type="module">
import { Cube } from "./src/Cube.js";
import { videoSrc } from "./src/util/sources.js";
new Cube(videoSrc);
</script>
</template>
<template data-href="?spiral">
<script type="module">
import { Spiral } from "./src/Spiral.js";
import { videoSrc } from "./src/util/sources.js";
new Spiral(videoSrc);
</script>
</template>
<template data-href="?spiral-flat">
<script type="module">
import { SpiralFlat } from "./src/SpiralFlat.js";
import { videoSrc } from "./src/util/sources.js";
new SpiralFlat(videoSrc);
</script>
</template>
<template data-href="?ar">
<script type="module">
import { ARCube } from "./src/ARCube.js";
import { videoSrc } from "./src/util/sources.js";
new ARCube(videoSrc);
</script>
</template>
<script>
for (const template of document.querySelectorAll("template"))
if (template.dataset.href === location.search)
template.parentElement.insertBefore(template.content, template);
</script>
</body>
</html>