-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
354 lines (341 loc) · 11.1 KB
/
Copy pathindex.html
File metadata and controls
354 lines (341 loc) · 11.1 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
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, viewport-fit=cover"
/>
<title>Fluoro: riso-fy (almost) anything</title>
<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=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,800&family=Instrument+Sans:wght@400;500;600&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="css/styles.css" />
<link
rel="icon"
type="image/png"
href="assets/favicon-96x96.png"
sizes="96x96"
/>
<link rel="icon" type="image/svg+xml" href="assets//favicon.svg" />
<link rel="shortcut icon" href="assets/favicon.ico" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/assets/apple-touch-icon.png"
/>
<meta name="apple-mobile-web-app-title" content="Fluoro" />
<link rel="manifest" href="/site.webmanifest" />
</head>
<body>
<svg
width="0"
height="0"
style="position: absolute"
aria-hidden="true"
focusable="false"
id="filterHost"
></svg>
<main class="sheet">
<h1 class="riso-text" data-text="Riso-fy (almost) anything">
Riso-fy (almost) anything
</h1>
<p class="lede">
Two inks, one sheet of paper. Load an image, then push the sliders to
see how each print flaw changes the look. The same settings drive the
page layout and the filter demo further down.
</p>
<nav class="links" aria-label="Fluoro elsewhere">
<a
class="btn"
href="https://www.npmjs.com/package/fluoro-riso"
target="_blank"
rel="noopener noreferrer"
>npm ↗</a
>
<a
class="btn"
href="https://github.com/yafira/fluoro"
target="_blank"
rel="noopener noreferrer"
>GitHub ↗</a
>
</nav>
<div class="press">
<div class="stage-col">
<div class="frame">
<canvas id="out" aria-label="Riso print preview"></canvas>
</div>
<div class="actions">
<label class="file"
><input type="file" id="file" accept="image/*" /><span
class="btn solid"
>Load your image</span
></label
>
<button class="btn" type="button" id="reprint">Reprint</button>
<label class="check"
><input type="checkbox" id="orig" /> Show original</label
>
</div>
<div class="flaws">
<div class="row">
<label for="grain"
>Threshold grain <output id="grainO"></output
></label>
<input
type="range"
id="grain"
min="0"
max="0.4"
step="0.01"
value="0.08"
/>
</div>
<div class="row">
<label for="mis"
>Misregistration <output id="misO"></output
></label>
<input type="range" id="mis" min="0" max="8" step="1" value="2" />
</div>
<div class="row">
<label for="opacity"
>Ink opacity <output id="opacityO"></output
></label>
<input
type="range"
id="opacity"
min="0.6"
max="1"
step="0.01"
value="0.92"
/>
</div>
</div>
</div>
<div class="panel">
<h3>Press settings</h3>
<div class="row">
<span class="lab">Inks (they recolor this whole page)</span>
<div class="inks">
<input
type="color"
id="inkA"
value="#ff48b0"
aria-label="Ink A color"
/>
<input
type="color"
id="inkB"
value="#0078bf"
aria-label="Ink B color"
/>
</div>
<div class="presets">
<button
class="btn"
type="button"
data-a="#ff48b0"
data-b="#0078bf"
>
Pink + blue
</button>
<button
class="btn"
type="button"
data-a="#ff6c2f"
data-b="#00838a"
>
Orange + teal
</button>
<button
class="btn"
type="button"
data-a="#00a95c"
data-b="#765ba7"
>
Green + purple
</button>
</div>
</div>
<div class="row">
<label for="mode">Screen</label>
<select id="mode">
<option value="halftone">Halftone dots</option>
<option value="bayer">Bayer dither</option>
<option value="noise">Random grain</option>
</select>
</div>
<div class="row">
<label for="cell">Cell size <output id="cellO"></output></label>
<input type="range" id="cell" min="3" max="14" step="1" value="6" />
</div>
<div class="row">
<label for="angle"
>Screen angle <output id="angleO"></output
></label>
<input
type="range"
id="angle"
min="0"
max="90"
step="1"
value="0"
/>
</div>
<div class="row">
<label for="contrast"
>Contrast <output id="contrastO"></output
></label>
<input
type="range"
id="contrast"
min="0.6"
max="2"
step="0.05"
value="1.2"
/>
</div>
<p class="note">
Each ink is matched to the color channel it absorbs most, so pink
reads the green channel and blue reads the red one. Images stay in
your browser.
</p>
</div>
</div>
<section>
<h2>Layout built like a print</h2>
<div class="two">
<div>
<p>
Every element is a flat ink layer. Overlaps use multiply, so pink
over blue turns purple with no extra work. The headline above is
one word printed twice, the second pass nudged by the
misregistration slider.
</p>
<p>
Photos go through the canvas pipeline once. Everything else stays
live text, so it remains sharp, selectable, and cheap to scroll.
</p>
<p>
<button
class="btn solid"
type="button"
id="swap"
title="Swap the two inks"
>
Ink on ink
</button>
</p>
</div>
<div class="stage" aria-hidden="true">
<div class="disc a"></div>
<div class="disc b"></div>
<canvas id="swatch"></canvas>
</div>
</div>
</section>
<section>
<h2>Filter the live page</h2>
<p>
An SVG filter can riso-fy whatever the browser paints. It splits the
block into two inks, thresholds each with noise, tints them, and
multiplies them onto paper. It works on any markup, but it re-runs on
every repaint, so it suits a hero or a section better than a whole
site.
</p>
<div class="mock-wrap">
<div class="mock-controls">
<label class="check"
><input type="checkbox" id="fon" checked /> Apply SVG
filter</label
>
<div class="row">
<label for="fgrain"
>Filter grain <output id="fgrainO"></output
></label>
<input
type="range"
id="fgrain"
min="0.5"
max="3"
step="0.1"
value="1.5"
/>
</div>
</div>
<div class="mock" id="mock">
<div class="mock-nav">
<b>Sunday Market</b><span>Shop</span><span>Journal</span
><span>About</span>
</div>
<div class="mock-hero">
<h3>Fresh things, printed slowly.</h3>
<p>
Small batches of ceramics, textiles, and paper goods from
studios around the city.
</p>
<span class="mbtn">Browse the shop</span>
</div>
<div class="mock-grid">
<div class="swatch-a">
<strong>Ceramics</strong>Hand-thrown mugs and bowls
</div>
<div class="swatch-b">
<strong>Textiles</strong>Woven and knitted small goods
</div>
<div class="swatch-c">
<strong>Paper</strong>Zines, cards, and prints
</div>
</div>
</div>
<p class="note">
Filters on large or animated areas can be slow, and Safari is the
least reliable at it. A filter on a parent also changes how
fixed-position children behave, so test sticky headers.
</p>
</div>
</section>
<section class="install">
<h2>Put it on your site</h2>
<p>
Fluoro is also a package. Add one line to any page and a Riso-fy
button appears in the corner that prints the whole page in two inks.
</p>
<pre><code><script src="https://cdn.jsdelivr.net/npm/fluoro-riso" defer></script></code></pre>
<p>Or install it for React, Next.js and other projects:</p>
<pre><code>npm install fluoro-riso</code></pre>
<p class="note">
Pick your own inks, paper and grain with a few attributes. The README
on npm has every option.
</p>
<nav class="links" aria-label="Fluoro elsewhere">
<a
class="btn solid"
href="https://www.npmjs.com/package/fluoro-riso"
target="_blank"
rel="noopener noreferrer"
>View on npm ↗</a
>
<a
class="btn"
href="https://github.com/yafira/fluoro"
target="_blank"
rel="noopener noreferrer"
>Code on GitHub ↗</a
>
</nav>
</section>
</main>
<script src="js/util.js"></script>
<script src="js/state.js"></script>
<script src="js/screens.js"></script>
<script src="js/pipeline.js"></script>
<script src="js/scene.js"></script>
<script src="js/filter.js"></script>
<script src="js/app.js"></script>
</body>
</html>