-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
153 lines (152 loc) · 5.63 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Sift</title>
<link rel="shortcut icon" href="favicon.png" />
<meta
name="viewport"
content="width=device-width,initial-scale=1,shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<meta name="description" content="Sift slices an image into multiple layers. You can offset the slices to create interference patterns and pseudo-3D effects." />
<meta property="og:title" content="Sift" />
<meta property="og:description" content="Sift slices an image into multiple layers. You can offset the slices to create interference patterns and pseudo-3D effects." />
<meta property="og:image" content="https://sift.constraint.systems/sift.png" />
<meta property="og:url" content="https://sift.constraint.systems" />
<meta name="twitter:card" content="summary_large_image" />
<link rel="stylesheet" href="font.css" />
<link rel="stylesheet" href="style.css" />
<script src="script.js" type="module"></script>
</head>
<body>
<input
type="file"
id="file_input"
style="display: none;"
accept="image/*"
/>
<canvas id="render"></canvas>
<div
id="mouse_catcher"
style="position: fixed; left: 0; top: 0; right: 0; bottom: 0;"
></div>
<div id="controls">
<div id="controls_inner">
<div class="mobile_spacer" style="display: flex">
<div style="margin-right: 32px;">
<div class="hspacer"></div>
<div><button onclick="trigger('o')">o</button> load image</div>
<div class="spacer"></div>
<div><button onclick="trigger('p')">p</button> save image</div>
<div class="hspacer"></div>
</div>
<div style="margin-right: 32px; height: 64px; position: relative;">
<div
style="position: absolute; left: 7px; top: 7px; border: solid 2px #222; right: 7px; bottom: 7px;"
></div>
<div style="position: relative">
<div style="margin-left: 4.5ch">
<button style="margin-left: 16px;" onclick="trigger('ArrowUp')">
↑
</button>
</div>
<div class="hspacer"></div>
<div style="display: flex">
<button onclick="trigger('ArrowLeft')">←</button>
<div
id="offset_readout"
style="width: 11ch; text-align: center;"
>
4,6
</div>
<button onclick="trigger('ArrowRight')">→</button>
</div>
<div class="hspacer"></div>
<div style="margin-left: 4.5ch">
<button
style="margin-left: 16px;"
onclick="trigger('ArrowDown')"
>
↓
</button>
</div>
</div>
<div class="hspacer"></div>
</div>
</div>
<div class="mobile_spacer" style="display: flex">
<div style="margin-right: 32px;">
<div class="hspacer"></div>
<div>
<button onclick="trigger('<')"><</button>
layers:
<span
id="layers_readout"
style="display: inline-block; width: 3ch; text-align: right;"
>8</span
>
<button onclick="trigger('>')">></button>
</div>
<div class="spacer"></div>
<div>
<button onclick="trigger('-')">-</button>
zoom:
<span
id="zoom_readout"
style="display: inline-block; width: 5ch; text-align: right;"
>100%</span
>
<button onclick="trigger('+')">+</button>
</div>
</div>
<div>
<div class="hspacer"></div>
<div>
<button id="info_button" onclick="trigger('i')">i</button>
</div>
<div class="spacer"></div>
<div>
<button class="active" onclick="trigger('?')">?</button>
</div>
</div>
</div>
</div>
</div>
<div id="hidden_control_toggle">
<button onclick="trigger('?')">?</button>
</div>
<div id="info_box">
<div
style="display: flex; justify-content: space-between; padding: 0.5ch 1ch; background: #222;"
>
<div>Info</div>
<div><button onclick="trigger('x')">x</button></div>
</div>
<div style="padding: 2ch 2ch 0 2ch;">
<p>
Sift slices an image into multiple layers. You can offset the slices
to create interference patterns and pseudo-3D effects.
</p>
<p>
<img
style="float: right; width: 96px; margin-left: 2ch; margin-bottom: 16px; opacity: 0.5;"
src="sift-logo.png"
/>
Sift uses additive blending and a pixel based light-splitting
algorithm, learn more about how it works in
<a href="https://writing.grantcuster.com/posts/2020-09-01-sift-release-notes/">the release notes</a> or <a href="https://www.youtube.com/watch?v=MJQNnAr40Vw">video tour</a>.
</p>
<p>
Use the keyboard controls or click the buttons below to open, adjust,
and save an image. You can also click and drag the image itself to set
the offset.
</p>
<p>
<a href="https://github.com/constraint-systems/sift">View source</a><br />
<a href="https://constraint.systems">Constraint Systems</a>
</p>
</div>
</div>
</body>
</html>