-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
111 lines (101 loc) · 1.92 KB
/
index.html
File metadata and controls
111 lines (101 loc) · 1.92 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Verlet Image Render</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
background: #222;
color: #999;
line-height: 1.5;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
}
h1,
h2 {
color: #fff;
margin-bottom: 0.5em;
}
#state {
font-size: 1.5em;
margin: 1em;
}
#canvas {
border: 1px solid #333;
}
#file {
margin-top: -2em;
}
#fileInput {
opacity: 0;
width: 0.1px;
height: 0.1px;
position: absolute;
}
#file label {
cursor: pointer;
background: #333;
color: #fff;
padding: 0.5em 1em;
display: inline-block;
border-radius: 3px;
transition: all 0.2s;
}
#file label:hover {
background: #444;
}
#slider {
margin-bottom: 1em;
}
#speedText {
font-size: 1.5em;
}
</style>
</head>
<body>
<h1>Verlet Particle Image Render</h1>
<h2 id="state"></h2>
<div id="file">
<input type="file" id="fileInput" accept="image/*" />
<label for="fileInput">Upload image</label>
</div>
<canvas id="canvas"></canvas>
<h2 id="speedDesc">Speed: <span id="speedText">1x</span></h2>
<input
type="range"
id="slider"
min="1"
max="50"
value="1"
style="
width: 200px;
height: 20px;
display: block;
background: linear-gradient(
to right,
#111 0%,
#111 50%,
#fff 50%,
#fff 100%
);
"
/>
<script>
const slider = document.getElementById("slider");
const speedText = document.getElementById("speedText");
slider.addEventListener("input", () => {
speedText.innerText = `${slider.value}x`;
});
</script>
<script type="module" src="src/main.ts"></script>
</body>
</html>