-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
637 lines (597 loc) · 23.6 KB
/
Copy pathindex.html
File metadata and controls
637 lines (597 loc) · 23.6 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
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script>(function(){try{var s=localStorage.getItem("theme");if(s==="dark"||s==="light")document.documentElement.setAttribute("data-theme",s);}catch(e){}})();</script>
<title>CompoSeq — Composable foundations for genomic data</title>
<meta name="description" content="CompoSeq is a collaborative initiative building composable, Arrow-native foundations for genomic data — declarative, streaming, and composable, from cloud storage to GPU." />
<!-- Open Graph -->
<meta property="og:title" content="CompoSeq" />
<meta property="og:description" content="Composable foundations for genomic data." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://composeq.dev" />
<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=Space+Grotesk:wght@500;700&family=IBM+Plex+Mono:wght@400;500&display=swap" rel="stylesheet" />
<style>
:root {
--paper: #F7F8FA;
--ink: #15181E;
--muted: #59616E;
--line: #E4E7EC;
--card: #FFFFFF;
--accent: #2F74D0;
--accent-soft: rgba(47, 116, 208, 0.12);
--track: #E0A93B;
--base-a: #3FA96A;
--base-c: #2F74D0;
--base-g: #E0A93B;
--base-t: #D6564A;
--shadow: 0 1px 2px rgba(21, 25, 31, 0.04), 0 8px 24px rgba(21, 25, 31, 0.06);
--display: "Space Grotesk", system-ui, sans-serif;
--mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
--body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
--maxw: 1120px;
--gutter: clamp(20px, 5vw, 56px);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--paper: #0F1319;
--ink: #E9ECF1;
--muted: #98A2B0;
--line: rgba(255, 255, 255, 0.10);
--card: #171D26;
--accent: #5B9BF0;
--accent-soft: rgba(91, 155, 240, 0.14);
--track: #F0BE5A;
--base-a: #4EC57C;
--base-c: #5B9BF0;
--base-g: #F0BE5A;
--base-t: #EC6D5C;
--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
}
}
:root[data-theme="dark"] {
--paper: #0F1319;
--ink: #E9ECF1;
--muted: #98A2B0;
--line: rgba(255, 255, 255, 0.10);
--card: #171D26;
--accent: #5B9BF0;
--accent-soft: rgba(91, 155, 240, 0.14);
--track: #F0BE5A;
--base-a: #4EC57C;
--base-c: #5B9BF0;
--base-g: #F0BE5A;
--base-t: #EC6D5C;
--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
margin: 0;
background: var(--paper);
color: var(--ink);
font-family: var(--body);
font-size: 17px;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
a { color: inherit; }
:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 3px;
border-radius: 2px;
}
.wrap {
max-width: var(--maxw);
margin-inline: auto;
padding-inline: var(--gutter);
}
/* ---------- Eyebrow (position tick) ---------- */
.eyebrow {
font-family: var(--mono);
font-size: 13px;
letter-spacing: 0.02em;
color: var(--muted);
display: inline-flex;
align-items: center;
gap: 8px;
margin: 0 0 18px;
}
.eyebrow::before {
content: "";
width: 0;
height: 0;
border-left: 7px solid var(--accent);
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
}
/* ---------- Top bar ---------- */
.topbar {
border-bottom: 1px solid var(--line);
position: sticky;
top: 0;
background: color-mix(in srgb, var(--paper) 88%, transparent);
backdrop-filter: saturate(1.1) blur(8px);
z-index: 10;
}
.topbar .wrap {
display: flex;
align-items: center;
justify-content: space-between;
height: 60px;
}
.wordmark {
font-family: var(--mono);
font-weight: 500;
font-size: 16px;
letter-spacing: 0.01em;
text-decoration: none;
display: inline-flex;
align-items: baseline;
gap: 2px;
}
.wordmark b { color: var(--accent); font-weight: 500; }
.topbar nav a {
font-family: var(--mono);
font-size: 13.5px;
color: var(--muted);
text-decoration: none;
}
.topbar nav a:hover { color: var(--ink); }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.theme-switch {
display: inline-flex;
border: 1px solid var(--line);
border-radius: 8px;
overflow: hidden;
}
.theme-switch button {
background: none;
border: none;
margin: 0;
padding: 6px 8px;
color: var(--muted);
cursor: pointer;
display: inline-flex;
align-items: center;
line-height: 0;
}
.theme-switch button + button { border-left: 1px solid var(--line); }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
/* ---------- Hero ---------- */
.hero { padding-top: clamp(48px, 9vw, 104px); }
.hero-brand { margin-bottom: 24px; }
.hero-word {
font-family: var(--mono);
font-weight: 500;
font-size: 18px;
letter-spacing: 0.01em;
display: block;
}
.hero-word b { color: var(--accent); font-weight: 500; }
.hero-pron {
font-family: var(--mono);
font-size: 13px;
color: var(--muted);
margin-top: 5px;
display: block;
}
.badge {
font-family: var(--mono);
font-size: 12px;
color: var(--accent);
background: var(--accent-soft);
border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
padding: 4px 10px;
border-radius: 999px;
display: inline-block;
margin-bottom: 26px;
}
h1 {
font-family: var(--display);
font-weight: 700;
font-size: clamp(38px, 7vw, 76px);
line-height: 1.02;
letter-spacing: -0.02em;
margin: 0;
max-width: 15ch;
}
.lede {
font-size: clamp(18px, 2.2vw, 21px);
color: var(--muted);
max-width: 60ch;
margin: 26px 0 0;
}
.cta-row {
display: flex;
flex-wrap: wrap;
gap: 14px;
margin-top: 34px;
}
.btn {
font-family: var(--mono);
font-size: 14px;
text-decoration: none;
padding: 11px 18px;
border-radius: 8px;
border: 1px solid var(--line);
display: inline-flex;
align-items: center;
gap: 8px;
transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #06120F; } }
.btn:hover { transform: translateY(-1px); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
/* ---------- Coverage track (signature) ---------- */
.track { margin-top: clamp(44px, 7vw, 80px); }
.track-svg {
display: block;
width: 100%;
height: auto;
}
.b-a { fill: var(--base-a); }
.b-c { fill: var(--base-c); }
.b-g { fill: var(--base-g); }
.b-t { fill: var(--base-t); }
.brick-top { fill: #fff; opacity: 0.18; }
.brick-bot { fill: #000; opacity: 0.13; }
.stud { fill: #fff; opacity: 0.5; }
.track-reveal { animation: reveal 1.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.axis {
display: flex;
justify-content: space-between;
border-top: 1px solid var(--line);
padding-top: 8px;
font-family: var(--mono);
font-size: 12px;
color: var(--muted);
}
.axis span { position: relative; }
.axis span::before {
content: "";
position: absolute;
top: -9px; left: 0;
width: 1px; height: 6px;
background: var(--line);
}
/* ---------- Section rhythm ---------- */
section { padding-block: clamp(56px, 9vw, 104px); }
section + section { border-top: 1px solid var(--line); }
.section-title {
font-family: var(--display);
font-weight: 500;
font-size: clamp(24px, 3.4vw, 34px);
letter-spacing: -0.01em;
margin: 0;
}
/* ---------- Idea ---------- */
.idea-grid { display: grid; grid-template-columns: 1fr; gap: 22px; max-width: 74ch; margin-top: 24px; }
.idea-grid p { margin: 0; }
.idea-grid p + p { color: var(--muted); }
.idea-grid strong { color: var(--ink); font-weight: 600; }
/* ---------- Projects (as tracks) ---------- */
.project-list { margin-top: 28px; }
.project {
display: grid;
grid-template-columns: minmax(0, 220px) 1fr auto;
gap: 20px;
align-items: baseline;
padding: 22px 0;
border-top: 1px solid var(--line);
text-decoration: none;
transition: padding-left 0.14s ease;
}
.project:last-child { border-bottom: 1px solid var(--line); }
.project:hover { padding-left: 10px; }
.pname { font-family: var(--display); font-weight: 500; font-size: 21px; }
.kind {
font-family: var(--mono);
font-size: 12px;
color: var(--accent);
display: block;
margin-top: 4px;
}
.pdesc { color: var(--muted); font-size: 15.5px; }
.go { font-family: var(--mono); font-size: 14px; color: var(--muted); white-space: nowrap; }
.project:hover .go { color: var(--accent); }
/* ---------- Team ---------- */
.team {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 24px;
margin-top: 30px;
}
.member {
background: var(--card);
border: 1px solid var(--line);
border-radius: 14px;
padding: 18px;
box-shadow: var(--shadow);
}
.member img {
width: 100%;
aspect-ratio: 1 / 1;
object-fit: cover;
border-radius: 10px;
background: var(--line);
display: block;
}
.mname { font-family: var(--display); font-weight: 500; font-size: 19px; margin: 14px 0 2px; }
.affil { font-family: var(--mono); font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.links { margin-top: 12px; display: flex; gap: 14px; }
.links a {
font-family: var(--mono);
font-size: 13px;
color: var(--accent);
text-decoration: none;
}
.links a:hover { text-decoration: underline; }
/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding-block: 40px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
footer a { font-family: var(--mono); font-size: 13.5px; color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; }
.tag { font-family: var(--mono); font-size: 13px; color: var(--muted); }
/* ---------- Responsive ---------- */
@media (max-width: 860px) {
.team { grid-template-columns: repeat(2, 1fr); }
.project { grid-template-columns: 1fr auto; }
.pdesc { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
body { font-size: 16px; }
.team { grid-template-columns: 1fr 1fr; gap: 14px; }
.member { padding: 12px; }
.hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
.track-reveal { animation: none; }
.btn:hover, .project:hover { transform: none; padding-left: 0; }
}
</style>
</head>
<body>
<header class="topbar">
<div class="wrap">
<a class="wordmark" href="/">compo<b>seq</b></a>
<nav>
<div class="theme-switch" role="group" aria-label="Theme">
<button type="button" data-choice="light" aria-label="Light theme" title="Light">
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>
</button>
<button type="button" data-choice="system" aria-label="System theme" title="System">
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8M12 17v4"/></svg>
</button>
<button type="button" data-choice="dark" aria-label="Dark theme" title="Dark">
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>
</button>
</div>
<a href="https://github.com/composeq" rel="noopener"><span class="hide-sm">GitHub </span>↗</a>
</nav>
</div>
</header>
<main>
<!-- Hero -->
<div class="hero wrap">
<div class="hero-brand">
<span class="hero-pron">/kəmˈpoʊsiːk/ · “kuhm-POH-seek”</span>
</div>
<h1>Composable foundations for genomic data.</h1>
<p class="lede">
Building a shared, Arrow-native substrate that lets genomic data flow natively through the
modern data stack. Declarative, streaming, and portable, from cloud storage to GPU.
</p>
<div class="cta-row">
<a class="btn primary" href="https://github.com/composeq" rel="noopener">View on GitHub →</a>
<a class="btn ghost" href="mailto:hello@composeq.dev">hello@composeq.dev</a>
</div>
</div>
<!-- Coverage track (signature) -->
<div class="track wrap" aria-hidden="true">
<svg class="track-svg track-reveal" viewBox="0 0 1200 132" role="presentation">
<g id="bricks"></g>
</svg>
<div class="axis">
<span>chr1 · 0</span>
<span>50 Mb</span>
<span>100 Mb</span>
<span>150 Mb</span>
<span>200 Mb</span>
<span>248 Mb</span>
</div>
</div>
<!-- The idea -->
<section id="idea">
<div class="wrap">
<p class="eyebrow">the idea</p>
<h2 class="section-title">Declare. Stop parsing.</h2>
<div class="idea-grid">
<p>
Genomic data is, at heart, <strong>data on a coordinate system</strong> — interval-based features
located along a reference, with a few domain quirks like strandedness. Yet the tooling around it
is fragmented and welded to file formats, so most effort goes into parsing, copying, and
shuttling data between programs.
</p>
<p>
CompoSeq flips the model: bring genomic data into general-purpose engines that already solve
joins, streaming, and cloud storage — then layer on the few genuinely genomic primitives: interval
operators, coverage and pileup rasterization, and coordinate-aware tensor loading. Generic work is
optimized once, in shared infrastructure; specialized kernels stay modular and reusable over Apache Arrow.
</p>
</div>
</div>
</section>
<!-- Projects -->
<section id="projects">
<div class="wrap">
<p class="eyebrow">projects</p>
<h2 class="section-title">Maintained libraries working together.</h2>
<div class="project-list">
<a class="project" href="https://github.com/abdenlab/oxbow" rel="noopener">
<div><span class="pname">oxbow</span><span class="kind">format bridge</span></div>
<div class="pdesc">Translates conventional genomic file formats into Apache Arrow record batches for any Arrow-native engine.</div>
<div class="go">abdenlab/oxbow ↗</div>
</a>
<a class="project" href="https://github.com/biodatageeks/polars-bio" rel="noopener">
<div><span class="pname">polars-bio</span><span class="kind">dataframe engine</span></div>
<div class="pdesc">Genomic interval operations, a SQL frontend, parallel I/O, and cloud-native streaming, powered by Apache DataFusion.</div>
<div class="go">biodatageeks/polars-bio ↗</div>
</a>
<a class="project" href="https://github.com/jmschrei/tangermeme" rel="noopener">
<div><span class="pname">tangermeme</span><span class="kind">ml toolkit</span></div>
<div class="pdesc">Sequence manipulation, feature attribution, variant effect scoring, and DNA design for genomic ML models.</div>
<div class="go">jmschrei/tangermeme ↗</div>
</a>
<a class="project" href="https://github.com/jmschrei/bpnet-lite" rel="noopener">
<div><span class="pname">bpnet-lite</span><span class="kind">models</span></div>
<div class="pdesc">Compact, state-of-the-art sequence-to-function models for chromatin accessibility, TF binding, and transcription initiation.</div>
<div class="go">jmschrei/bpnet-lite ↗</div>
</a>
</div>
</div>
</section>
<!-- Team -->
<section id="team">
<div class="wrap">
<p class="eyebrow">team</p>
<h2 class="section-title">The team behind the initiative.</h2>
<div class="team">
<div class="member">
<img src="assets/team-na.png" alt="Nezar Abdennur" loading="lazy" />
<div class="mname">Nezar Abdennur</div>
<div class="affil">UMass Chan Medical School</div>
<div class="links">
<a href="https://abdenlab.org" rel="noopener">site ↗</a>
<a href="https://github.com/nvictus" rel="noopener">github ↗</a>
</div>
</div>
<div class="member">
<img src="assets/team-js.jpg" alt="Jacob Schreiber" loading="lazy" />
<div class="mname">Jacob Schreiber</div>
<div class="affil">UMass Chan Medical School</div>
<div class="links">
<a href="https://jmschrei.github.io" rel="noopener">site ↗</a>
<a href="https://github.com/jmschrei" rel="noopener">github ↗</a>
</div>
</div>
<div class="member">
<img src="assets/team-mw.jpg" alt="Marek Wiewiórka" loading="lazy" />
<div class="mname">Marek Wiewiórka</div>
<div class="affil">Warsaw University of Technology</div>
<div class="links">
<a href="https://marekwiewiorka.org" rel="noopener">site ↗</a>
<a href="https://github.com/mwiewior" rel="noopener">github ↗</a>
</div>
</div>
<div class="member">
<img src="assets/team-tg.jpg" alt="Tomasz Gambin" loading="lazy" />
<div class="mname">Tomasz Gambin</div>
<div class="affil">Warsaw University of Technology</div>
<div class="links">
<a href="https://biodatageeks.org" rel="noopener">site ↗</a>
<a href="https://github.com/biodatageeks" rel="noopener">github ↗</a>
</div>
</div>
<div class="member">
<img src="assets/team-cb.jpeg" alt="Conrad Bzura" loading="lazy" />
<div class="mname">Conrad Bzura</div>
<div class="affil">UMass Chan Medical School · Abdennur Lab</div>
<div class="links">
<a href="https://github.com/conradbzura" rel="noopener">github ↗</a>
</div>
</div>
<div class="member">
<img src="assets/team-voy.png" alt="Vedat Yilmaz" loading="lazy" />
<div class="mname">Vedat Yilmaz</div>
<div class="affil">UMass Chan Medical School · Abdennur Lab</div>
<div class="links">
<a href="https://github.com/vedatonuryilmaz" rel="noopener">github ↗</a>
</div>
</div>
</div>
</div>
</section>
</main>
<footer>
<div class="wrap">
<span class="tag">CompoSeq · Composable foundations for genomic data</span>
<div class="foot-links">
<a href="mailto:hello@composeq.dev">hello@composeq.dev</a>
<a href="https://github.com/composeq/.github/blob/main/ROADMAP.md" rel="noopener">Roadmap</a>
<a href="https://github.com/composeq/.github/blob/main/CODE_OF_CONDUCT.md" rel="noopener">Code of Conduct</a>
<a href="https://github.com/composeq" rel="noopener">GitHub</a>
</div>
</div>
</footer>
<script>
// Build the pileup as a wall of LEGO-style bricks — deterministic (no randomness).
(function () {
var h = [
0.25, 0.40, 0.30, 0.50, 0.35, 0.60, 0.45, 0.80, 0.55, 0.40,
0.30, 0.50, 0.70, 1.00, 0.65, 0.45, 0.30, 0.55, 0.40, 0.75,
0.95, 0.60, 0.40, 0.30, 0.50, 0.30
];
var W = 1200, base = 128, brickH = 16, gapY = 3, unit = brickH + gapY;
var maxStack = 6, n = h.length, colW = W / n, brickW = 34;
var bases = "CAGTCGTAACGTGCATTGCAGTCCAG"; // color each column by its base
var g = document.getElementById("bricks");
var out = "";
for (var i = 0; i < n; i++) {
var b = Math.max(1, Math.round(h[i] * maxStack));
var xL = i * colW + (colW - brickW) / 2;
var cls = "b-" + bases.charAt(i % bases.length).toLowerCase();
for (var k = 0; k < b; k++) {
var top = base - k * unit - brickH;
out += '<rect class="' + cls + '" x="' + xL.toFixed(1) + '" y="' + top.toFixed(1) + '" width="' + brickW + '" height="' + brickH + '" rx="3"/>';
out += '<rect class="brick-top" x="' + xL.toFixed(1) + '" y="' + top.toFixed(1) + '" width="' + brickW + '" height="3" rx="1.5"/>';
out += '<rect class="brick-bot" x="' + xL.toFixed(1) + '" y="' + (top + brickH - 3).toFixed(1) + '" width="' + brickW + '" height="3" rx="1.5"/>';
if (k === b - 1) {
var sy = (top - 1).toFixed(1);
out += '<ellipse class="stud" cx="' + (xL + brickW * 0.30).toFixed(1) + '" cy="' + sy + '" rx="6" ry="3.5"/>';
out += '<ellipse class="stud" cx="' + (xL + brickW * 0.70).toFixed(1) + '" cy="' + sy + '" rx="6" ry="3.5"/>';
}
}
}
g.innerHTML = out;
})();
// Theme switch — light / dark / system (system clears the stored choice).
(function () {
var root = document.documentElement;
var sw = document.querySelector(".theme-switch");
if (!sw) return;
var btns = sw.querySelectorAll("button");
function stored() { try { return localStorage.getItem("theme"); } catch (e) { return null; } }
function current() { var s = stored(); return (s === "light" || s === "dark") ? s : "system"; }
function mark() {
var c = current();
btns.forEach(function (b) {
b.setAttribute("aria-pressed", b.dataset.choice === c ? "true" : "false");
});
}
function apply(choice) {
if (choice === "system") {
root.removeAttribute("data-theme");
try { localStorage.removeItem("theme"); } catch (e) {}
} else {
root.setAttribute("data-theme", choice);
try { localStorage.setItem("theme", choice); } catch (e) {}
}
mark();
}
btns.forEach(function (b) {
b.addEventListener("click", function () { apply(b.dataset.choice); });
});
mark();
})();
</script>
</body>
</html>