-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
397 lines (348 loc) · 13 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
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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
<body bgcolor="#ffffff">
<meta charset="UTF-8">
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>似寫隨黑 Lrite Wlack</title>
<style>
@font-face {
font-family: 'Preview';
font-style: normal;
font-display: block;
font-weight: 400;
src: url(LriteWlackTCVF.woff);
}
.--extralight {
font-variation-settings: "wght" 250, "ital" 50, "wdth" 50, "opsz" 0;
}
.--light {
font-variation-settings: "wght" 354, "ital" 50, "wdth" 50, "opsz" 0;
}
.--normal {
font-variation-settings: "wght" 458, "ital" 50, "wdth" 50, "opsz" 0;
}
.--regular {
font-variation-settings: "wght" 503, "ital" 50, "wdth" 50, "opsz" 0;
}
.--medium {
font-variation-settings: "wght" 614, "ital" 50, "wdth" 50, "opsz" 0;
}
.--bold {
font-variation-settings: "wght" 757, "ital" 50, "wdth" 50, "opsz" 0;
}
.--heavy {
font-variation-settings: "wght" 900, "ital" 50, "wdth" 50, "opsz" 0;
}
.--litalic {
font-variation-settings: "wght" 250, "ital" 0, "wdth" 50, "opsz" 0;
}
.--ritalic {
font-variation-settings: "wght" 250, "ital" 100, "wdth" 50, "opsz" 0;
}
.--hmirror {
font-variation-settings: "wght" 250, "ital" 50, "wdth" 0, "opsz" 0;
}
.--vmirror {
font-variation-settings: "wght" 250, "ital" 50, "wdth" 100, "opsz" 0;
}
.--casual {
font-variation-settings: "wght" 250, "ital" 50, "wdth" 50, "opsz" 100;
}
</style>
<style>
/* flex font size */
html {font-size: 100%;}
body{
margin:0; font-family: sans-serif;
}
@media screen and (min-width: 320px) {
html {
font-size: calc(12px + 6 * ((100vw - 320px) / 680));
}
}
@media screen and (min-width: 1000px) {
html {
font-size: 18px;
}
}
:root {
font-size: 100%/1.5;
}
a {
color: black;
text-decoration-color: rgba(0,0,0,.108);
text-underline-offset: .108em;
text-underline-offset: .25em;
}
</style>
<div align="center">
<h1><span class="--light" style="font-family: 'Preview'"><a title="github" href="https://github.com/FWHP-Enfun/Lrite-Wlack" target="_blank">似寫隨黑 Lrite Wlack</a></span></h1>
<a href="index2.html">效果2 Effect 2</a>、
<a href="https://github.com/FWHP-Enfun" target="_blank">FWHP GitHub</a>、
<a title="github" href="https://github.com/FWHP-Enfun/Lrite-Wlack" target="_blank">字體網站 Font Site</a>
</div>
<form id="panel" action="https://github.com/a-vis/wavefont" onclick="event.target === this && togglePanel()">
<script>
let toggle = localStorage.getItem('wf:panel-toggle')
if (toggle) panel.classList.add('folded')
function togglePanel(){
localStorage.setItem('wf:panel-toggle', panel.classList.contains('folded') ? '':'1')
panel.classList.toggle('folded');
}
</script>
<style>
#panel {
position: fixed;
right: 1rem;
bottom: 1rem;
margin: auto;
width: 22rem;
max-width: 80vw;
box-shadow: 0 2.8px 2.2px rgba(49, 43, 65, 0.034),
0 6.7px 5.3px rgba(49, 43, 65, 0.048),
0 12.5px 10px rgba(49, 43, 65, 0.06),
0 22.3px 17.9px rgba(49, 43, 65, 0.072),
0 41.8px 33.4px rgba(49, 43, 65, 0.086),
0 100px 80px rgba(49, 43, 65, 0.12);
border-top: .5rem solid rgba(252,252,253,.99);
border-left: .5rem solid rgba(238,238,240,.98);
border-right: .5rem solid rgba(238,238,239,.97);
border-bottom: .5rem solid rgba(231,231,232,.97);
background: rgba(238,238,239,1);
z-index: 1;
-webkit-backdrop-filter: blur(2px);
backdrop-filter: blur(2px);
cursor: e-resize;
transition: right .3s cubic-bezier(.34,.03,.26,1), bottom .3s cubic-bezier(.34,.03,.61,1);
}
#panel.folded {
right: -21rem;
bottom: -8rem;
cursor: w-resize;
}
.panel-content {
padding: 1.5rem 1.5rem 1.5rem;
height: 100%;
background: linear-gradient(to bottom right, rgba(232,232,233,.35) 20%, rgba(255,255,255,.7) 180%), rgba(245,245,245,1);
display: flex;
flex-direction: column;
align-items: stretch;
justify-content: space-around;
text-shadow: 1px 1px white;
/* box-shadow: 0 -5px rgba(255,255,255,.75), 0 5px rgba(255,255,255,.75), -5px 0 rgba(255,255,255,.5), 5px 0 rgba(255,255,255,.5); */
/* background: linear-gradient(to bottom, rgba(252,252,252,1), rgba(238,238,238,1)); */
}
#panel h1 {
cursor: default;
margin: -.1rem auto .8rem;
font-weight: 600;
font-size: 28px;
line-height: 1;
font-family: Preview;
font-variation-settings: 'wght' var(--wght, 400), 'ital' var(--ital, 50), 'wdth' var(--wdth, 50), 'opsz' var(--opsz, 0);
}
#panel h1 small {
font-weight: normal;
font-size: .66em;
}
.panel-field {
display: flex;
flex-direction: row;
height: 1.75rem;
align-items: center;
}
.panel-field label {
flex: 3rem 0 0;
text-align: right;
margin-right: 1rem;
}
.panel-field input[type=range] {
margin-top: 3px;
flex: 1 0 0;
}
.panel-field output {
flex: 2rem 0 0;
margin-left: .5rem;
font-size: smaller;
}
.panel-cta {
align-self: center;
margin-top: 1rem;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.panel-cta button {
margin: 0 .25rem;
line-height: 1.5;
padding-bottom: 2px;
display: inline-block;
}
</style>
<div class="panel-content" onclick="event.target === this && togglePanel()" >
<h1>
<sup><a title="github" href="https://github.com/FWHP-Enfun/Lrite-Wlack" target="_blank">似寫隨黑</a></sup>
</h1>
<h1>
<sup><a title="github" href="https://github.com/FWHP-Enfun/Lrite-Wlack" target="_blank">Lrite Wlack</a></sup>
</h1>
<div class="panel-field">
<label for="size"><small>Size</small></label> <input id="size" type="range" min="12" value="48" max="200" step="1"/>
<output id="sizeValue"></output>
</div>
<div class="panel-field">
<label for="spacing"><small>Spacing</small></label> <input id="spacing" type="range" min="0" value="1" step=".25" max="10"/>
<output id="spacingValue"></output>
</div>
<div class="panel-field">
<label for="weight"><small>Weight</small></label> <input id="weight" type="range" min="250" value="250" step="1" max="900"/>
<output id="weightValue"></output>
</div>
<div class="panel-field">
<label for="ital"><small>Italic</small></label> <input id="ital" type="range" min="0" value="50" max="100" step="1"/>
<output id="italValue"></output>
</div>
<div class="panel-field">
<label for="wdth"><small>Weight</small></label> <input id="wdth" type="range" min="0" value="50" max="100" step="1"/>
<output id="wdthValue"></output>
</div>
<div class="panel-field">
<label for="opsz"><small>Optical</small></label> <input id="opsz" type="range" min="0" value="0" max="100" step="1"/>
<output id="opszValue"></output>
</div>
</div>
</form>
<main id="waveareas">
<style>
#waveareas {
display: grid; grid-template-columns: 1fr; margin-bottom: 20rem; gap: 3rem;
margin: 4rem auto;
// max-width: 1080px;
}
@media screen and (min-width: 2160px) {
#waveareas {
grid-template-columns: 1fr 1fr;
max-width: 2160px;
padding-left: 4rem;
padding-right: 4rem;
}
}
.wavearea {
text-align: center;
font-family: Preview;
line-height: 1.4;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
padding: 0;
resize: none;
word-break: break-all;
font-size: var(--size);
letter-spacing: var(--spacing);
font-variation-settings: 'wght' var(--wght, 400), 'ital' var(--ital, 50), 'wdth' var(--wdth, 50), 'opsz' var(--opsz, 0);
background-size: 100vw calc(var(--size, 100px) / 10);
background-image: linear-gradient(to bottom, rgb(230, 245, 255) 1px, transparent 1px);
background-attachment: local;
background-position: 0 -0.5px;
-webkit-overflow-scrolling: auto;
border: none;
white-space: pre-wrap;
position: relative;
width: 100%;
}
.wavearea:focus {
outline: none;
}
.wavearea::before {
position: absolute;
content: attr(title);
top: -2em;
left: 0;
letter-spacing: .25ch;
font-family: sans-serif;
font-size: 12px;
}
</style>
<div id="Chinese" title="中文 Chinese" class="wavearea" contenteditable spellcheck="false">一丁七三下丈上丑丐不丙世丕且丘丞丟並丫中串丸凡丹主乃久么之尹乍乏乎乒乓乖乘乙九也乞乩乳乾亂了予事二于云井互五亙些亞亟亡交亦亥亨享京亭亮人仁什仃仆仇仍今介仄以付仔仕他仗代令仙仞仿伉伙伊伕伍伐休伏仲件任仰</div>
<script>
// sawtooth
// wavearea.textContent += Array.from({length: 108}, (_,i) => String.fromCharCode(0x100 + (i * 2) % 100)).join('') + '\t\t'
</script>
<div id="sawtooth" title="Sawtooth" class="wavearea" contenteditable spellcheck="false">ĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĸĺļľŀłńņňŊŌŎŐŒŔŖŘŚŜŞŠŢĀĂĆĊĎĒĖĚĞĢĦĪĮIJĶĺľłņŊŎŒŖŚŞŢĀĂĊĒĚĢĪIJĺłŊŒŚŢĀĂĒĢIJłŒŢĀĂĢłŢ</div>
<script>
// sawtooth
// wavearea.textContent += Array.from({length: 108}, (_,i) => String.fromCharCode(0x100 + (i * 2) % 100)).join('') + '\t\t'
</script>
<div id="sine" title="Sine" class="wavearea" contenteditable spellcheck="false">IJĺłʼnŐŗŜşŢţţŢşśŖŏňŁĹİĨĠĘĒČćăāĀĀĂąĉĎĕĜĤĬĴļńŌŒŘŝŠţţţšŞřŔōņľĶĮĦĞĖĐĊĆĂĀĀĀĂĆĊĐėĞĦĮķĿŇŎŔŚŞšţţţŠŝŘŒŋńļĴīģěĔĎĉĄāĀĀāăć</div>
<script>
// sine
// wavearea.textContent += Array.from({length: 108}, (_,i) => String.fromCharCode(0x100 + (Math.sin(i/6) * 50 + 50))).join('') + '\t\t'
</script>
<div id="triangle" title="Tri" contenteditable class="wavearea">ĀĆČĒĘĞĤĪİĶļłňŎŔŚŠŠŚŔŎňłļĶİĪĤĞĘĒČĆĀĆČĒĘĞĤĪİĶļłňŎŔŚŠŠŚŔŎňłļĶİĪĤĞĘĒČĆĀĆČĒĘĞĤĪİĶļłňŎŔŚŠŠŚŔŎňłļĶİĪĤĞĘĒČĆĀĆČĒĘĞĤĪİ</div>
<script>
// triangle
// wavearea.textContent += Array.from({length: 108}, (_,i) => (
// i = (i/33) % 1, i = i > .5 ? 1-i : i,
// String.fromCharCode(0x100 + (i * 200))
// )).join('') + '\t\t'
</script>
<div id="rect" title="Custom" class="wavearea" contenteditable></div>
<script>
// rect.textContent += Array.from({length: 108}, (_,i) => (String.fromCharCode(0x100 + ((i/33) % 1 > .5 ? 100 : 1)))).join('')
</script>
<div id="noise" title="Random" class="wavearea" contenteditable></div>
<script>
noise.textContent += Array.from({length: 108}, (_,i) => (String.fromCharCode(0x100 + Math.floor(Math.random() * 100)))).join('')
</script>
<div id="speech" title="Sample" class="wavearea" contenteditable></div>
<script>
// speech
let values = `āĂ㥹ĆćĈċĊĉċčīıēģĹĶIJĺķĺĺijĽijĶĵĦČģĹĪĞĠĝġđČĐĤĨijħģĚģĢıĞĢİķīİijķĴIJĪĬģęĬķĦĒěěėďĒĚĪĢēČċěĩĘđēĞĝĚČčĖħĨĝġĈĉċĊĉċ蹥ăĂāāā`.split('').map(c => c.charCodeAt(0))
speech.textContent += String.fromCharCode(...values)
</script>
<div id="keyboard" title="0-9 a-Z ▁▂▃▄▅▆▇█" class="wavearea" spellcheck="false" contenteditable>0123456789 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ▁▂▃▄▅▆▇█</div>
<div id="range128" title="Latin Ext (+clipping)" class="wavearea" contenteditable></div>
<script>
range128.textContent += Array(130).fill(0).map((v,i)=> String.fromCharCode(0x100+i)).join('')
</script>
<!-- <div id="rangecyr100" title="Cyrillic (centered + clipping)" class="wavearea" contenteditable></div>
<script>
rangecyr100.textContent += Array(120).fill(0).map((v,i)=> String.fromCharCode(0x400+i-10)).join('') + '---'
</script> -->
</main>
<script>
(size.oninput = e => {
let value = +size.value;
size.title = value;
sizeValue.textContent = value + 'px';
waveareas.style.setProperty('--size', value + 'px')
})();
(spacing.oninput = e => {
let value = +spacing.value;
spacing.title = `'spacing' ${value}ch`;
spacingValue.textContent = value + 'ch';
waveareas.style.setProperty('--spacing', value + 'ch')
})();
(weight.oninput = e => {
let value = +weight.value;
weight.title = `'wght' ${value}`;
weightValue.textContent = (+value).toFixed(0);
waveareas.style.setProperty('--wght', value)
})();
(ital.oninput = e => {
let value = +ital.value;
ital.title = value;
italValue.textContent = value + '%';
waveareas.style.setProperty('--ital', value)
})();
(wdth.oninput = e => {
let value = +wdth.value;
wdth.title = value;
wdthValue.textContent = value;
waveareas.style.setProperty('--wdth', value)
})();
(opsz.oninput = e => {
let value = +opsz.value;
opsz.title = value;
opszValue.textContent = value;
waveareas.style.setProperty('--opsz', value)
})();
</script>