-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
416 lines (393 loc) · 15.5 KB
/
index.html
File metadata and controls
416 lines (393 loc) · 15.5 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
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
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>audiojs · open audio stack for JavaScript</title>
<meta name="description" content="Open audio stack for JavaScript. Decode, process, synthesize and play — same code on Browser, Node, Deno and Bun. 48 modular packages. W3C Web Audio · WPT 100%.">
<meta name="theme-color" content="#0d1014">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://audiojs.org/">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='24' fill='%230d1014'/%3E%3Cpath d='M3.73 24.42c5.39 0 6.26-.12 9-6.15 3.54-7.78 6.18-8.6 10.08 6.15 3.9 14.74 7.04 12.71 9.84 3.95 4.07-12.77 5.14-3.95 9.91-3.95h1.7' stroke='%23edebe4' fill='none'/%3E%3Cline x1='3.36' y1='24.36' x2='44.64' y2='24.36' stroke='%23edebe4'/%3E%3C/svg%3E">
<!-- Open Graph -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://audiojs.org/">
<meta property="og:title" content="audiojs · open audio stack for JavaScript">
<meta property="og:description" content="Decode, process, synthesize and play — same code on Browser, Node, Deno and Bun. 48 modular packages. W3C Web Audio · WPT 100%.">
<meta property="og:site_name" content="audiojs">
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@audio_js">
<meta name="twitter:title" content="audiojs · open audio stack for JavaScript">
<meta name="twitter:description" content="Decode, process, synthesize and play — same code on Browser, Node, Deno and Bun. 48 modular packages. W3C Web Audio · WPT 100%.">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://audiojs.org/#org",
"name": "audiojs",
"url": "https://audiojs.org/",
"sameAs": ["https://github.com/audiojs", "https://www.npmjs.com/org/audiojs", "https://x.com/audio_js"]
},
{
"@type": "SoftwareSourceCode",
"name": "audiojs",
"description": "Open audio stack for JavaScript. Cross-runtime modules for decode, encode, synthesis, analysis and DSP.",
"url": "https://audiojs.org/",
"codeRepository": "https://github.com/audiojs",
"programmingLanguage": "JavaScript",
"license": "https://opensource.org/licenses/MIT",
"author": { "@id": "https://audiojs.org/#org" }
}
]
}
</script>
<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=Manrope:wght@400;500;700;800&family=Orbitron:wght@400;700&family=Wavefont:ROND,wght@0..100,100..900&display=swap" rel="stylesheet">
<script src="https://unpkg.com/sprae" data-start></script>
<style>
:root {
/* colors */
--c-ink: #0d1014;
--c-paper: #edebe4;
--c-bg: #f1efe9;
--c-accent: #00a4b8;
/* fonts */
--f-body: 'Manrope', system-ui, sans-serif;
--f-logo: 'Orbitron', sans-serif;
--f-wave: 'Wavefont', monospace;
/* font sizes */
--fs-xs: clamp(10px, 1.5vw, 15px);
--fs-sm: clamp(12px, 1.7vw, 17px);
--fs-md: clamp(14px, 2vw, 20px);
--fs-lg: clamp(20px, 3vw, 30px);
--fs-xl: clamp(54px, 8.1vw, 81px);
--fs-2xl: clamp(72px, 10.8vw, 108px);
/* layout — rh scales with viewport; sw follows proportionally */
--rh: clamp(72px, 10.8vw, 108px);
--sw: calc(var(--rh) * 4);
--dot-cell: calc(var(--rh)/4);
/* aliases for legacy refs */
--ink: var(--c-ink);
--paper: var(--c-paper);
--teal: var(--c-accent);
--grot: var(--f-body);
--logo: var(--f-logo);
}
* { box-sizing: border-box; }
body {
margin: 0;
padding: 0;
font-family: var(--grot);
background-color: #f1efe9;
min-height: 100vh;
color: var(--ink);
}
h1 { margin: 0; font-weight: inherit; }
/* ─── COVER ─── */
.cover {
width: 100%;
display: flex;
flex-direction: column;
position: relative;
overflow: hidden;
}
/* top dark half · canvas */
.top {
background: var(--ink);
color: var(--paper);
position: relative;
padding: 0;
min-height: calc(4 * var(--rh));
}
/* .top::before {
content: '';
position: absolute; inset: 0;
background-image: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
background-size: var(--dot-cell) var(--dot-cell);
background-position: center;
pointer-events: none;
} */
/* bottom half · transparent — shows root bg */
.bot {
position: relative;
padding: 0;
min-height: calc(var(--rh) * 5);
}
.bot::after { display: none; }
/* content wrapper inside each half */
.inner {
max-width: 1080px;
margin: 0 auto;
padding: 12px 56px 6.75rem;
height: 100%;
position: relative;
}
.bot .inner {
padding: 0 56px 32px;
height: auto;
}
.gh-link {
position: absolute;
top: 4px;
right: 4px;
padding: 10px;
transition: opacity 0.15s;
line-height: 0;
z-index: 10;
}
.gh-link:hover { opacity: 1; }
.gh-link svg { width: 1.5rem; height: 1.5rem; }
.pro {
text-align: center;
padding-top: 0;
font-style: normal;
font-weight: 500;
font-size: var(--fs-xs);
color: var(--paper);
}
.wordmark {
display: flex;
align-items: flex-end;
justify-content: center;
gap: 18px;
margin-top: 48px;
}
.wordmark .name {
font-family: var(--logo);
font-weight: 600;
font-size: var(--fs-2xl);
line-height: 0.72;
letter-spacing: -0.027em;
color: var(--paper);
}
.wordmark .js {
border: 0.036em solid var(--paper);
padding: 8px;
font-weight: 600;
font-size: clamp(42px, 6.4vw, 64px);
line-height: 0.81;
letter-spacing: -0.02em;
color: transparent;
-webkit-text-stroke: .054em var(--paper);
}
.subtitle {
font-weight: 500;
font-size: var(--fs-lg);
line-height: 1;
color: var(--paper);
margin-top: 2rem;
text-align: center;
}
.freq {
font-weight: 700;
font-size: var(--fs-xl);
line-height: 1;
letter-spacing: -0.035em;
color: var(--teal);
margin-top: 4px;
text-align: center;
}
/* wavefont stripe block */
.stripe-block {
width: var(--sw);
max-width: 100%;
opacity: 0;
transition: opacity 0.2s;
margin: calc(var(--rh) * -1) auto 0;
display: grid;
grid-template-rows: repeat(3, 1fr);
position: relative;
z-index: 2;
pointer-events: none;
user-select: none;
touch-action: none;
cursor: ew-resize;
}
.stripe-row {
pointer-events: auto;
overflow: hidden;
font-family: var(--f-wave);
font-size: var(--rh);
line-height: 1;
white-space: nowrap;
}
.stripe-row span {
display: inline-block;
width: calc(var(--sw) / var(--sn));
will-change: font-variation-settings;
transform: translateZ(0);
-webkit-font-smoothing: antialiased;
}
.r-0 { background-color: #f1efe9; }
.r-0, .r-1, .r-2 { color: var(--ink); }
.stripe-row:nth-child(even) { text-align: right; }
.feats {
margin-top: 20px;
text-align: center;
position: relative;
z-index: 3;
}
.feats div {
font-weight: 700;
font-size: var(--fs-lg);
letter-spacing: -0.012em;
color: var(--ink);
line-height: 1.55;
}
.bullets {
margin-top: 20px;
text-align: center;
font-weight: 500;
font-size: var(--fs-xs);
color: var(--ink);
position: relative;
z-index: 3;
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 0 1em;
}
.bullets div {
display: flex;
align-items: center;
gap: 0.4em;
}
.bullets div::before {
content: '◼';
font-size: 0.75em;
flex-shrink: 0;
}
.seal {
margin: 22px auto 0;
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
position: relative;
z-index: 3;
color: var(--ink);
text-decoration: none;
transition: opacity 0.15s;
}
.seal:hover { opacity: 0.7; }
.seal svg { width: 54px; height: 54px; display: block; }
.caption {
text-align: center;
margin-top: 10px;
font-weight: 500;
font-size: var(--fs-xs);
color: var(--ink);
position: relative;
z-index: 3;
}
@media (max-width: 479px) {
.inner { padding-left: 24px; padding-right: 24px; }
.bot .inner { padding-left: 24px; padding-right: 24px; }
}
</style>
</head>
<body>
<header>
<article class="cover" aria-label="audiojs · modular web audio toolkit">
<div class="top">
<a class="gh-link" href="https://github.com/audiojs" aria-label="audiojs on GitHub" target="_blank" rel="noopener">
<svg width="28" height="28" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C12.1381 15.0539 13.5182 14.0332 14.4958 12.6716C15.4735 11.3101 15.9996 9.6762 16 8C16 3.58 12.42 0 8 0Z" fill="white"/>
</svg>
</a>
<div class="inner">
<div class="pro">For Professional Use</div>
<h1 class="wordmark">
<span class="name">audio</span>
<span class="js">JS</span>
</h1>
<div class="subtitle">Open Audio Stack</div>
<div class="freq">20-20k</div>
</div>
</div>
<div class="bot">
<div class="stripe-block" id="stripeBlock"
:scope="{
N:40,
rows:[Math.PI*1.5,Math.PI*0.5,Math.PI*1.5].map(off=>Array.from({length:40},(_,i)=>({ph:+(off+i/39*Math.PI).toFixed(4)})))
}"
:style="`--sn:${N}`"
aria-hidden="true">
<div class="stripe-row r-0">
<template :each="bar in rows[0]"><span :style="`--phase:${bar.ph}`">Z</span></template>
</div>
<div class="stripe-row r-1">
<template :each="bar in rows[1]"><span :style="`--phase:${bar.ph}`">Z</span></template>
</div>
<div class="stripe-row r-2">
<template :each="bar in rows[2]"><span :style="`--phase:${bar.ph}`">Z</span></template>
</div>
</div>
<div class="inner">
<div class="feats">
<div>Cross-Runtime</div>
<div>Modular Design</div>
<div>Standards Compliant</div>
</div>
<div class="bullets">
<div>ES Modules</div><div>Web Audio API</div><div>Sample-accurate</div><div>20+ modules</div>
</div>
<a class="seal" href="https://github.com/audiojs/web-audio-api/actions/workflows/test.yml" target="_blank" rel="noopener" title="web-audio-api · WPT 100% · CI status" aria-label="web-audio-api WPT conformance · view CI">
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="24" cy="24" r="24" fill="black"/>
<circle cx="24" cy="24" r="20.5" fill="black" stroke="white"/>
<path d="M3.72998 24.4174C9.11908 24.4174 9.98873 24.2988 12.735 18.2706C16.279 10.4913 18.92 9.67227 22.8177 24.4174C26.715 39.1609 29.8613 37.131 32.6572 28.3694C36.73 15.6062 37.803 24.4174 42.5662 24.4174C44.2699 24.4174 44.2699 24.4174 44.2699 24.4174" stroke="white"/>
<line x1="3.35498" y1="24.3584" x2="44.6444" y2="24.3584" stroke="white"/>
</svg>
</a>
<div class="caption">W3C WPT 100%</div>
</div>
</div>
</article>
</header>
<main></main>
<footer></footer>
<!-- <a href="https://github.com/krishnized/license" style="position: fixed; bottom: 1rem; right: 1rem; color: var(--ink); text-decoration: none; font-size: 1.25rem; line-height: 1; opacity: 0.5;" target="_blank" rel="noopener" title="krishnized license">ॐ</a> -->
<script>
const init = () => {
const el = document.getElementById('stripeBlock');
const ss = [...el.querySelectorAll('.stripe-row span')];
if (!ss.length) { requestAnimationFrame(init); return; }
const spans = ss.map(s => ({ s, ph: parseFloat(s.style.getPropertyValue('--phase')) || 0 }));
const wmax = 380, P = Math.PI;
let t = 0, last = null, dragging = false, dragX = 0, visible = true;
const tick = now => {
const dt = last ? (now - last) / 1000 : 0; last = now;
if (visible && !dragging) {
t += dt * P * 0.5;
spans.forEach(({ s, ph }) => {
const wt = wmax / 2 * (1 + Math.sin(ph + t));
s.style.fontVariationSettings = `'ROND' 0,'YELA' 0,'wght' ${Math.max(1, wt) | 0}`;
});
}
requestAnimationFrame(tick);
};
// pause when tab hidden or block scrolled off-screen
document.addEventListener('visibilitychange', () => { visible = !document.hidden; last = null; });
new IntersectionObserver(([e]) => { visible = e.isIntersecting; last = null; }).observe(el);
el.addEventListener('pointerenter', () => { visible = false; });
el.addEventListener('pointerleave', () => { if (!dragging) { visible = true; last = null; } });
el.addEventListener('pointerdown', e => { dragging = true; dragX = e.clientX; el.setPointerCapture(e.pointerId); });
el.addEventListener('pointermove', e => {
if (!dragging) return;
t -= (e.clientX - dragX) / el.getBoundingClientRect().width * P * 2;
dragX = e.clientX;
spans.forEach(({ s, ph }) => {
const wt = wmax / 2 * (1 + Math.sin(ph + t));
s.style.fontVariationSettings = `'ROND' 0,'YELA' 0,'wght' ${Math.max(1, wt) | 0}`;
});
});
el.addEventListener('pointerup', () => { dragging = false; last = null; });
document.fonts.ready.then(() => el.style.opacity = 1);
tick(performance.now());
};
requestAnimationFrame(init);
</script>
</html>