-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
493 lines (456 loc) · 23.9 KB
/
Copy pathindex.html
File metadata and controls
493 lines (456 loc) · 23.9 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AetherPak: Distributed, Self-Managed Flatpak Repositories</title>
<meta name="description" content="A flexible hybrid OCI-static hosting model for self-managed Flatpak repositories on any static web host and OCI container registry.">
<meta property="og:title" content="AetherPak: Distributed, Self-Managed Flatpak Repositories">
<meta property="og:description" content="A flexible hybrid OCI-static hosting model for self-managed Flatpak repositories on any static web host and OCI container registry.">
<meta property="og:type" content="website">
<style>
:root {
--bg: #09090b; --card: #18181b; --border: #27272a;
--text: #f4f4f5; --text-muted: #a1a1aa;
--primary: #8b5cf6; --primary-glow: rgba(139,92,246,0.15); --success: #10b981;
--font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font-sans); line-height: 1.6; padding: 2rem 1rem 0; min-height: 100vh; overflow-x: hidden; position: relative; }
body::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: min(800px, 100%); height: 360px; background: radial-gradient(circle, rgba(139,92,246,0.10) 0%, rgba(9,9,11,0) 70%); z-index: -1; pointer-events: none; }
.container { max-width: 760px; margin: 0 auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); overflow-wrap: anywhere; }
header { text-align: center; margin: 1.5rem 0 3rem; animation: fadeIn 0.8s ease-out; }
.badge { display: inline-block; padding: 0.25rem 0.75rem; background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.3); border-radius: 9999px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; color: var(--primary); margin-bottom: 1.25rem; box-shadow: 0 0 15px var(--primary-glow); }
h1 { font-size: 2.75rem; font-weight: 800; letter-spacing: -0.045em; line-height: 1.1; background: linear-gradient(to right, #fff, #d8b4fe); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.tagline { color: var(--text-muted); font-size: 1.15rem; margin-top: 0.75rem; max-width: 580px; margin-inline: auto; }
section { animation: slideUp 0.7s ease-out both; }
section + section { margin-top: 2.5rem; }
h2 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 1rem; }
h3.cfg { font-size: 1rem; font-weight: 600; margin: 1.75rem 0 0.5rem; }
p { color: #d4d4d8; }
.lead { font-size: 1.05rem; }
ul.points { list-style: none; margin-top: 1rem; display: grid; gap: 0.6rem; }
ul.points li { padding-left: 1.5rem; position: relative; color: #d4d4d8; }
ul.points li::before { content: '→'; position: absolute; left: 0; color: var(--primary); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; }
.step { display: flex; gap: 0.9rem; }
.step + .step { margin-top: 1.5rem; }
.step-num { flex-shrink: 0; width: 1.75rem; height: 1.75rem; border-radius: 9999px; background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.3); color: var(--primary); font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; }
.step-body { flex: 1; min-width: 0; }
.step-body h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.step-body p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tab { padding: 0.6rem 1rem; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--text-muted); font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer; transition: color 0.2s; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }
.panels-container { display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr; }
.panel { grid-column: 1; grid-row: 1; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.2s ease-out; }
.panel.active { opacity: 1; visibility: visible; pointer-events: auto; }
.code-block { position: relative; background: rgba(0,0,0,0.35); border: 1px solid var(--border); border-radius: 10px; }
.code-block pre { margin: 0; padding: 0.9rem 3rem 0.9rem 1rem; overflow-x: auto; }
.code-block code { font-size: 0.83rem; color: #e4e4e7; white-space: pre; }
.code-block .k { color: #93c5fd; }
.code-block .s { color: #86efac; }
.code-block .e { color: #d8b4fe; }
.code-block .c { color: #71717a; font-style: italic; }
.btn-copy { position: absolute; top: 0.55rem; right: 0.55rem; background: rgba(255,255,255,0.04); border: 1px solid var(--border); cursor: pointer; color: var(--text-muted); padding: 0.3rem; border-radius: 6px; display: flex; transition: all 0.2s; }
.btn-copy:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.btn-copy.success { color: var(--success); border-color: var(--success); }
.links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.link-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; transition: all 0.2s; }
.link-card:hover { border-color: rgba(139,92,246,0.4); transform: translateY(-2px); text-decoration: none; }
.link-card .t { color: var(--text); font-weight: 600; font-size: 0.95rem; }
.link-card .d { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.15rem; }
footer { text-align: center; padding: 3.5rem 0 2rem; color: var(--text-muted); font-size: 0.85rem; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
section:nth-of-type(1) { animation-delay: 0.05s; }
section:nth-of-type(2) { animation-delay: 0.15s; }
section:nth-of-type(3) { animation-delay: 0.25s; }
section:nth-of-type(4) { animation-delay: 0.35s; }
@media (max-width: 560px) { h1 { font-size: 2.1rem; } .links { grid-template-columns: 1fr; } }
.preview { display: block; margin-top: 1rem; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 30px rgba(139,92,246,0.06); transition: border-color 0.2s; }
.preview:hover { border-color: rgba(139,92,246,0.4); }
.preview img { display: block; width: 100%; height: auto; }
dialog.modal { inset: 0; margin: auto; max-width: 560px; width: calc(100% - 2rem); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
dialog.modal::backdrop { background: rgba(9,9,11,0.7); backdrop-filter: blur(2px); }
.modal-x { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 0.35rem; border-radius: 6px; }
.modal-x:hover { color: var(--text); background: rgba(255,255,255,0.06); }
/* Carousel Modal styles */
dialog.carousel-modal {
max-width: 650px;
width: calc(100% - 2rem);
max-height: 90vh;
max-height: 90dvh;
padding: 0.5rem;
border: 1px solid var(--border);
border-radius: 16px;
background: var(--card);
overflow: hidden;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.carousel-container {
position: relative;
display: flex;
flex-direction: column;
}
.carousel-close {
position: absolute;
top: 0.5rem;
right: 0.5rem;
z-index: 20;
background: rgba(24, 24, 27, 0.7);
border: 1px solid rgba(255, 255, 255, 0.1);
color: var(--text);
width: 36px;
height: 36px;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.4rem;
transition: all 0.2s ease;
user-select: none;
}
.carousel-close:hover {
background: var(--primary);
border-color: var(--primary);
}
.carousel-viewport {
position: relative;
display: flex;
align-items: center;
justify-content: center;
background: #0d0d0f;
border-radius: 10px;
overflow: hidden;
border: 1px solid var(--border);
width: 100%;
}
.carousel-slides {
width: 100%;
display: flex;
}
.carousel-slide {
display: none;
width: 100%;
align-items: center;
justify-content: center;
}
.carousel-slide.active {
display: flex;
}
.carousel-slide img {
width: auto;
max-width: 100%;
height: auto;
max-height: 82vh;
max-height: 82dvh;
object-fit: contain;
display: block;
}
.carousel-nav {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba(24, 24, 27, 0.7);
border: 1px solid rgba(255, 255, 255, 0.1);
color: var(--text);
width: 44px;
height: 44px;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
font-size: 1.2rem;
transition: all 0.25s ease;
user-select: none;
}
.carousel-nav:hover {
background: var(--primary);
border-color: var(--primary);
box-shadow: 0 0 10px var(--primary-glow);
}
.carousel-nav.prev { left: 1rem; }
.carousel-nav.next { right: 1rem; }
.carousel-footer {
display: flex;
justify-content: center;
align-items: center;
margin-top: 0.75rem;
}
.carousel-dots {
display: flex;
gap: 0.5rem;
}
.carousel-dots .dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--border);
cursor: pointer;
transition: all 0.2s ease;
}
.carousel-dots .dot:hover {
background: var(--text-muted);
}
.carousel-dots .dot.active {
background: var(--primary);
transform: scale(1.2);
}
/* "Ask Dosu" pill — fixed launcher that opens the AetherPak knowledge base in a new tab. */
.dosu-launcher { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 50; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.1rem; border: 1px solid rgba(139,92,246,0.45); border-radius: 9999px; background: linear-gradient(135deg, #7c3aed, #8b5cf6); color: #fff; font: inherit; font-weight: 600; font-size: 0.92rem; text-decoration: none; box-shadow: 0 6px 24px rgba(139,92,246,0.35), 0 0 0 1px rgba(0,0,0,0.2); transition: transform 0.18s ease, box-shadow 0.18s ease; animation: dosuPop 0.5s ease-out 0.6s both; }
.dosu-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(139,92,246,0.5), 0 0 0 1px rgba(0,0,0,0.2); text-decoration: none; }
.dosu-launcher:active { transform: translateY(0); }
.dosu-launcher svg { width: 17px; height: 17px; flex-shrink: 0; }
@keyframes dosuPop { from { opacity: 0; transform: translateY(16px) scale(0.9); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .dosu-launcher { bottom: 1rem; right: 1rem; padding: 0.65rem 1rem; } }
</style>
</head>
<body>
<div class="container">
<header>
<div class="badge">AETHERPAK</div>
<h1>Self-hosted Flatpak repos, simplified</h1>
<p class="tagline">AetherPak makes it easy for OSS Linux desktop application maintainers to build and host self-managed, distributed Flatpak repositories.</p>
</header>
<main>
<section>
<h2>What it is</h2>
<p class="lead">Serving a static OSTree repository from a simple web server or static host involves transferring hundreds of small, separate file objects. This results in slow client-side installations and trips provider request limits. AetherPak addresses this with a flexible, hybrid OCI-static hosting model:</p>
<ul class="points">
<li><strong>Static Control Plane:</strong> Host the lightweight JSON repository index, landing installer pages, signing keys, and <code>.flatpakref</code> configurations on <em>any</em> static web host (GitHub Pages, GitLab Pages, Netlify, Cloudflare Pages, S3, or self-hosted HTTP).</li>
<li><strong>OCI Data Plane:</strong> Host the compiled Flatpak binary layers (blobs) as standard container images on <em>any</em> OCI-compliant registry (GitHub Container Registry (GHCR), Docker Hub, Quay.io, or self-hosted registries).</li>
<li><strong>GPG signing:</strong> Support for GPG-signed repositories to authenticate binaries (compatible with Flatpak client versions 1.17+).</li>
<li><strong>App Stream & Catalog Integration:</strong> Generates and exposes full app metadata so that once your repository is added, users can easily discover, install, and update your apps directly from Linux software catalogs like GNOME Software and KDE Discover.</li>
</ul>
</section>
<section>
<h2>What your users get</h2>
<p style="margin-bottom: 1rem; color: #d4d4d8;">Every repository gets a landing page like this, with a one-click <code>.flatpakref</code> install button and copy-paste commands for each app and channel.</p>
<a class="preview" href="#" onclick="openCarousel(0); return false;" aria-label="Open screenshot carousel"><img src="preview.webp" alt="Live AetherPak actions-demo registry page showing GNOME Sudoku with install commands" loading="lazy"></a>
</section>
<section>
<h2>Core Projects</h2>
<div class="links">
<a class="link-card" href="https://aetherpak.github.io/actions">
<div class="t">AetherPak Actions</div>
<div class="d">GitHub Actions integration to compile Flatpaks and coordinate repository deploys.</div>
</a>
<a class="link-card" href="https://aetherpak.github.io/cli">
<div class="t">AetherPak CLI</div>
<div class="d">Zero-dependency Go CLI that handles builder sandboxing, change planning, registry pushing, and site generation.</div>
</a>
</div>
</section>
<section>
<h2>Quick Start</h2>
<div class="card">
<div class="tabs" role="tablist">
<button class="tab" role="tab" data-tab="quick-actions" aria-selected="true">GitHub Actions</button>
<button class="tab" role="tab" data-tab="quick-cli" aria-selected="false">AetherPak CLI</button>
</div>
<div class="panels-container">
<div class="panel active" data-tab="quick-actions">
<p style="margin-bottom: 0.75rem;">To publish a Flatpak application automatically on push, create <code>.github/workflows/publish.yml</code> in your repository:</p>
<div class="code-block">
<pre><code>name: Publish Flatpak
on: { push: { branches: [main] } }
permissions:
contents: read
packages: write
pages: write
id-token: write
jobs:
publish:
uses: aetherpak/actions/.github/workflows/publish.yml@v3
with:
manifest-path: org.example.App.json
secrets:
gpg-private-key: ${{ secrets.AETHERPAK_GPG_KEY }}</code></pre>
<button class="btn-copy" title="Copy" aria-label="Copy" onclick="copyBlock(this)"></button>
</div>
</div>
<div class="panel" data-tab="quick-cli">
<p style="margin-bottom: 0.75rem;">AetherPak CLI compiles manifests, pushes layers, and builds indexes. Run a release flow locally or in any CI runner:</p>
<div class="code-block">
<pre><code># Run a complete build, push, and site reconcile sequence
aetherpak release --base-sha HEAD~1
# Re-build static landing pages and indexes from GHCR state
aetherpak build-site --pages-url https://flatpak.example.com</code></pre>
<button class="btn-copy" title="Copy" aria-label="Copy" onclick="copyBlock(this)"></button>
</div>
</div>
</div>
</div>
</section>
<section>
<h2>Learn more</h2>
<div class="links">
<a class="link-card" href="https://aetherpak.github.io/actions"><div class="t">Actions Project</div><div class="d">View actions documentation and setup guides</div></a>
<a class="link-card" href="https://aetherpak.github.io/cli"><div class="t">CLI Project</div><div class="d">Explore CLI commands, usage, and compilation docs</div></a>
<a class="link-card" href="https://aetherpak.github.io/actions-demo/"><div class="t">Single-App Demo</div><div class="d">Example repository landing page deployed by AetherPak</div></a>
<a class="link-card" href="https://github.com/aetherpak/actions-demo"><div class="t">Demo Repository</div><div class="d">A template repository containing a sample workflow setup</div></a>
</div>
</section>
</main>
<footer>
<p>AetherPak • MIT Licensed • Compatible with any static host & OCI registry</p>
<p style="margin-top: 0.5rem; font-size: 0.8rem;">
<a href="https://aetherpak.github.io/actions" style="color: var(--text-muted);">Actions</a> •
<a href="https://aetherpak.github.io/cli" style="color: var(--text-muted);">CLI</a>
</p>
</footer>
</div>
<!-- Ask Dosu: opens the AetherPak knowledge base Q&A in a new tab. -->
<a class="dosu-launcher" href="https://app.dosu.dev/99e2e465-c579-4a33-bfd9-ea17932b9d47/ask" target="_blank" rel="noopener" aria-label="Ask Dosu about AetherPak">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 3v4M3 5h4M6 17v4M4 19h4M13 3l1.8 4.9L20 9.7l-5.2 1.8L13 16.4l-1.8-4.9L6 9.7l5.2-1.8z"></path></svg>
Ask Dosu
</a>
<dialog id="carousel-modal" class="modal carousel-modal">
<div class="carousel-container">
<button class="carousel-close" aria-label="Close" onclick="closeCarousel()">×</button>
<div class="carousel-viewport">
<button class="carousel-nav prev" aria-label="Previous image" onclick="prevSlide()">❮</button>
<div class="carousel-slides">
<div class="carousel-slide active">
<img src="01-Demo-Dark.webp" alt="Demo - Dark Theme" loading="lazy">
</div>
<div class="carousel-slide">
<img src="01-Demo-Light.webp" alt="Demo - Light Theme" loading="lazy">
</div>
<div class="carousel-slide">
<img src="02-Lemonade-Dark.webp" alt="Lemonade - Dark Theme" loading="lazy">
</div>
<div class="carousel-slide">
<img src="02-Lemonade-Light.webp" alt="Lemonade - Light Theme" loading="lazy">
</div>
<div class="carousel-slide">
<img src="03-Stacklok-Dark.webp" alt="Stacklok - Dark Theme" loading="lazy">
</div>
<div class="carousel-slide">
<img src="03-Stacklok-Light.webp" alt="Stacklok - Light Theme" loading="lazy">
</div>
</div>
<button class="carousel-nav next" aria-label="Next image" onclick="nextSlide()">❯</button>
</div>
<div class="carousel-footer">
<div class="carousel-dots">
<span class="dot active" onclick="setSlide(0)"></span>
<span class="dot" onclick="setSlide(1)"></span>
<span class="dot" onclick="setSlide(2)"></span>
<span class="dot" onclick="setSlide(3)"></span>
<span class="dot" onclick="setSlide(4)"></span>
<span class="dot" onclick="setSlide(5)"></span>
</div>
</div>
</div>
</dialog>
<script>
function copyBlock(btn) {
const code = btn.parentElement.querySelector('code').innerText;
navigator.clipboard.writeText(code).then(() => {
btn.classList.add('success');
setTimeout(() => btn.classList.remove('success'), 1500);
});
}
document.querySelectorAll('.tab').forEach(tab => {
tab.addEventListener('click', () => {
const tabs = tab.closest('.tabs');
tabs.querySelectorAll('.tab').forEach(t => t.setAttribute('aria-selected', String(t === tab)));
const card = tabs.closest('.card');
const panelsContainer = card.querySelector('.panels-container');
if (panelsContainer) {
Array.from(panelsContainer.children).forEach(p => {
p.classList.toggle('active', p.dataset.tab === tab.dataset.tab);
});
}
});
});
// Minimal, dependency-free highlighter for the YAML/shell snippets.
function esc(s) { return s.replace(/[&<>]/g, c => ({ '&': '&', '<': '<', '>': '>' }[c])); }
function highlight(text) {
return text.split('\n').map(line => {
const m = line.match(/(^|\s)(#.*)$/);
const comment = m ? m[2] : '';
const code = m ? line.slice(0, line.length - comment.length) : line;
const h = esc(code)
.replace(/^(\s*(?:-\s*)?)([\w.-]+)(:)/, "$1<span class='k'>$2</span>$3")
.replace(/(\$\{\{[^}]*\}\})/g, "<span class='e'>$1</span>")
.replace(/("[^"]*")/g, "<span class='s'>$1</span>");
return comment ? h + "<span class='c'>" + esc(comment) + "</span>" : h;
}).join('\n');
}
document.querySelectorAll('.code-block code').forEach(c => { c.innerHTML = highlight(c.textContent); });
const ICON = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>';
document.querySelectorAll('.btn-copy').forEach(b => { b.innerHTML = ICON; });
// Carousel script
let currentSlide = 0;
const slides = [
'01-Demo-Dark.webp',
'01-Demo-Light.webp',
'02-Lemonade-Dark.webp',
'02-Lemonade-Light.webp',
'03-Stacklok-Dark.webp',
'03-Stacklok-Light.webp'
];
function openCarousel(startIndex = 0) {
const modal = document.getElementById('carousel-modal');
if (modal) {
currentSlide = startIndex;
updateCarousel();
modal.showModal();
}
}
function closeCarousel() {
const modal = document.getElementById('carousel-modal');
if (modal) {
modal.close();
}
}
function prevSlide() {
currentSlide = (currentSlide - 1 + slides.length) % slides.length;
updateCarousel();
}
function nextSlide() {
currentSlide = (currentSlide + 1) % slides.length;
updateCarousel();
}
function setSlide(index) {
currentSlide = index;
updateCarousel();
}
function updateCarousel() {
const slideElements = document.querySelectorAll('.carousel-slide');
slideElements.forEach((el, idx) => {
el.classList.toggle('active', idx === currentSlide);
});
const dotElements = document.querySelectorAll('.carousel-dots .dot');
dotElements.forEach((el, idx) => {
el.classList.toggle('active', idx === currentSlide);
});
}
document.addEventListener('keydown', e => {
const modal = document.getElementById('carousel-modal');
if (modal && modal.open) {
if (e.key === 'ArrowLeft') {
prevSlide();
} else if (e.key === 'ArrowRight') {
nextSlide();
}
}
});
// Click the backdrop (outside the dialog content) to close.
document.querySelectorAll('dialog.modal').forEach(d => {
d.addEventListener('click', e => { if (e.target === d) d.close(); });
});
</script>
</body>
</html>