-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangelog.html
More file actions
801 lines (742 loc) · 25.4 KB
/
Copy pathchangelog.html
File metadata and controls
801 lines (742 loc) · 25.4 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
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
<!doctype html>
<html lang="en" class="scroll-smooth">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Changelog - Fireshare</title>
<script
defer
src="https://umami.shaneisrael.net/script.js"
data-website-id="54a348ce-9d04-4e70-80a4-e95338d1dd06"
></script>
<meta
name="description"
content="Fireshare release history and changelog."
/>
<link rel="canonical" href="https://fireshare.net/changelog" />
<link rel="icon" href="favicon.ico" />
<link rel="apple-touch-icon" href="apple-touch-icon.png" />
<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=Inter:wght@300;400;500;600;700;800;900&display=swap"
rel="stylesheet"
/>
<!-- Early theme init to prevent flash -->
<script>
document.documentElement.setAttribute(
"data-theme",
localStorage.getItem("fireshare-theme") || "blaze",
);
</script>
<link rel="stylesheet" href="assets/tailwind.css" />
<style>
/* ===== Theme Definitions ===== */
:root,
[data-theme="blaze"] {
--accent-400: 255 150 30;
--accent-500: 224 50 148;
--accent-600: 200 10 150;
}
[data-theme="ember"] {
--accent-400: 251 147 60;
--accent-500: 249 115 22;
--accent-600: 234 88 12;
}
[data-theme="ocean"] {
--accent-400: 96 165 250;
--accent-500: 59 130 246;
--accent-600: 37 99 235;
}
[data-theme="amethyst"] {
--accent-400: 192 132 252;
--accent-500: 168 85 247;
--accent-600: 147 51 234;
}
body {
font-family: "Inter", sans-serif;
}
/* Nav blur */
.nav-blur {
backdrop-filter: blur(16px) saturate(180%);
-webkit-backdrop-filter: blur(16px) saturate(180%);
}
/* Theme picker */
.theme-option.active {
background: rgba(255, 255, 255, 0.05);
color: #fff;
}
.theme-swatch {
transition: box-shadow 0.2s ease;
}
.theme-option:hover .theme-swatch {
box-shadow: 0 0 8px currentColor;
}
/* Release card */
.release-card {
border: 1px solid rgba(255, 255, 255, 0.06);
transition: border-color 0.2s ease;
}
.release-card:hover {
border-color: rgb(var(--accent-500) / 0.3);
}
/* Markdown body styles */
.release-body h1,
.release-body h2,
.release-body h3,
.release-body h4 {
font-weight: 600;
color: #e2e8f0;
margin-top: 1.25rem;
margin-bottom: 0.5rem;
}
.release-body h1 {
font-size: 1.25rem;
}
.release-body h2 {
font-size: 1.1rem;
}
.release-body h3 {
font-size: 1rem;
}
.release-body p {
margin-bottom: 0.75rem;
color: #94a3b8;
line-height: 1.65;
}
.release-body ul,
.release-body ol {
padding-left: 1.4rem;
margin-bottom: 0.75rem;
color: #94a3b8;
}
.release-body ul {
list-style-type: disc;
}
.release-body ol {
list-style-type: decimal;
}
.release-body li {
margin-bottom: 0.3rem;
line-height: 1.6;
}
.release-body a {
color: rgb(var(--accent-400));
text-decoration: underline;
text-underline-offset: 2px;
}
.release-body a:hover {
color: rgb(var(--accent-500));
}
.release-body code {
background: rgba(255, 255, 255, 0.07);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 4px;
padding: 0.15em 0.4em;
font-size: 0.85em;
font-family: ui-monospace, monospace;
color: #e2e8f0;
}
.release-body pre {
background: #0d0d1a;
border: 1px solid rgb(var(--accent-500) / 0.15);
border-radius: 8px;
padding: 1rem;
overflow-x: auto;
margin-bottom: 0.75rem;
}
.release-body pre code {
background: none;
border: none;
padding: 0;
font-size: 0.85em;
color: #cbd5e1;
}
.release-body blockquote {
border-left: 3px solid rgb(var(--accent-500) / 0.5);
padding-left: 1rem;
margin: 0.75rem 0;
color: #64748b;
font-style: italic;
}
.release-body hr {
border: none;
border-top: 1px solid rgba(255, 255, 255, 0.06);
margin: 1rem 0;
}
/* Skeleton loader */
@keyframes shimmer {
0% {
background-position: -200% 0;
}
100% {
background-position: 200% 0;
}
}
.skeleton {
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0.04) 25%,
rgba(255, 255, 255, 0.08) 50%,
rgba(255, 255, 255, 0.04) 75%
);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
border-radius: 6px;
}
/* Buy Me a Coffee button */
.bmc-btn {
background-color: #ffdd00;
color: #11111b;
transition:
background-color 0.2s ease,
box-shadow 0.2s ease;
}
.bmc-btn:hover {
background-color: #ffe74d;
box-shadow: 0 8px 24px -10px rgba(255, 221, 0, 0.6);
}
</style>
</head>
<body class="bg-dark-950 text-gray-200 antialiased overflow-x-hidden">
<!-- ===== NAVIGATION ===== -->
<nav
class="fixed top-0 left-0 right-0 z-50 nav-blur bg-dark-950/80 border-b border-white/5"
>
<div
class="max-w-7xl mx-auto flex items-center justify-between px-6 py-4"
>
<a href="/" class="flex items-center gap-3 group">
<picture>
<source srcset="assets/images/logo.webp" type="image/webp" />
<img
src="assets/images/logo.png"
alt="Fireshare Logo"
class="h-10 w-auto"
/>
</picture>
<span
class="text-xl font-bold text-white group-hover:text-fire-400 transition-colors"
>Fireshare</span
>
</a>
<div class="hidden md:flex items-center gap-8 text-sm font-medium">
<a
href="/#features"
class="text-gray-400 hover:text-white transition-colors"
>Features</a
>
<a
href="/#demo"
class="text-gray-400 hover:text-white transition-colors"
>Demo</a
>
<a
href="/#screenshots"
class="text-gray-400 hover:text-white transition-colors"
>Screenshots</a
>
<a
href="/#install"
class="text-gray-400 hover:text-white transition-colors"
>Install</a
>
<a href="/changelog" class="text-white transition-colors"
>Changelog</a
>
</div>
<div class="flex items-center gap-3">
<a
href="https://www.buymeacoffee.com/shaneisrael"
target="_blank"
rel="noopener noreferrer"
title="Buy me a coffee"
class="bmc-btn hidden lg:inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-semibold"
>
<svg
class="w-4 h-4"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M18 8h1a4 4 0 010 8h-1M2 8h16v9a4 4 0 01-4 4H6a4 4 0 01-4-4V8zm4-4h8"
/>
</svg>
Buy me a coffee
</a>
<!-- Theme picker -->
<div class="relative" id="theme-toggle-wrapper">
<button
id="theme-toggle-btn"
class="p-2 rounded-lg bg-white/5 hover:bg-white/10 border border-white/10 transition-all text-fire-500"
aria-label="Change theme"
title="Change theme"
>
<svg
class="w-5 h-5"
fill="none"
stroke="currentColor"
stroke-width="2"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"
/>
</svg>
</button>
<div
id="theme-dropdown"
class="hidden absolute right-0 mt-2 w-36 rounded-xl bg-dark-800 border border-white/10 shadow-2xl overflow-hidden z-50"
>
<button
data-theme="blaze"
class="theme-option w-full flex items-center gap-3 px-4 py-2.5 text-sm text-gray-400 hover:bg-white/5 transition-colors"
>
<span
class="theme-swatch w-3 h-3 rounded-full shrink-0"
style="background-color: rgb(224, 50, 148)"
></span>
Blaze
</button>
<button
data-theme="ember"
class="theme-option w-full flex items-center gap-3 px-4 py-2.5 text-sm text-gray-400 hover:bg-white/5 transition-colors"
>
<span
class="theme-swatch w-3 h-3 rounded-full bg-orange-500 shrink-0"
></span>
Ember
</button>
<button
data-theme="ocean"
class="theme-option w-full flex items-center gap-3 px-4 py-2.5 text-sm text-gray-400 hover:bg-white/5 transition-colors"
>
<span
class="theme-swatch w-3 h-3 rounded-full bg-blue-500 shrink-0"
></span>
Ocean
</button>
<button
data-theme="amethyst"
class="theme-option w-full flex items-center gap-3 px-4 py-2.5 text-sm text-gray-400 hover:bg-white/5 transition-colors"
>
<span
class="theme-swatch w-3 h-3 rounded-full bg-purple-500 shrink-0"
></span>
Amethyst
</button>
</div>
</div>
<!-- Mobile menu toggle -->
<button
id="mobile-menu-btn"
class="md:hidden p-2 rounded-lg hover:bg-white/10 transition-colors"
aria-label="Toggle menu"
>
<svg
class="w-5 h-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
</button>
</div>
</div>
<!-- Mobile menu -->
<div
id="mobile-menu"
class="hidden md:hidden border-t border-white/5 px-6 py-4 space-y-3"
>
<a
href="/#features"
class="block text-gray-400 hover:text-white transition-colors text-sm font-medium"
>Features</a
>
<a
href="/#demo"
class="block text-gray-400 hover:text-white transition-colors text-sm font-medium"
>Demo</a
>
<a
href="/#screenshots"
class="block text-gray-400 hover:text-white transition-colors text-sm font-medium"
>Screenshots</a
>
<a
href="/#install"
class="block text-gray-400 hover:text-white transition-colors text-sm font-medium"
>Install</a
>
<a
href="/changelog"
class="block text-white transition-colors text-sm font-medium"
>Changelog</a
>
<a
href="https://www.buymeacoffee.com/shaneisrael"
target="_blank"
rel="noopener noreferrer"
title="Buy me a coffee"
class="bmc-btn inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-semibold"
>
<svg
class="w-4 h-4"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M18 8h1a4 4 0 010 8h-1M2 8h16v9a4 4 0 01-4 4H6a4 4 0 01-4-4V8zm4-4h8"
/>
</svg>
Buy me a coffee
</a>
</div>
</nav>
<!-- ===== CHANGELOG ===== -->
<main class="pt-28 pb-24 min-h-screen">
<div class="max-w-3xl mx-auto px-6">
<!-- Header -->
<div class="mb-6">
<div
class="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-fire-500/10 border border-fire-500/20 text-fire-400 text-xs font-semibold mb-5 tracking-wide uppercase"
>
<svg
class="w-3.5 h-3.5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"
/>
</svg>
Release History
</div>
<h1 class="text-4xl font-extrabold text-white tracking-tight mb-3">
Changelog
</h1>
</div>
<!-- Release list -->
<div id="releases-container" class="space-y-6">
<!-- Skeleton placeholders shown while loading -->
<div class="skeleton h-48 w-full"></div>
<div class="skeleton h-40 w-full"></div>
<div class="skeleton h-52 w-full"></div>
</div>
<!-- Error state (hidden by default) -->
<div id="releases-error" class="hidden text-center py-16">
<svg
class="w-12 h-12 mx-auto mb-4 text-gray-600"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
/>
</svg>
<p class="text-gray-500 text-lg font-medium mb-2">
Failed to load releases
</p>
<p class="text-gray-600 text-sm mb-6">
Could not reach the GitHub API. Try again or view releases directly.
</p>
<a
href="https://github.com/fireshare-app/fireshare/releases"
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-white/5 border border-white/10 hover:bg-white/10 text-sm font-medium transition-all"
>
View on GitHub
<svg
class="w-4 h-4"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
/>
</svg>
</a>
</div>
<!-- Load more -->
<div id="load-more-wrapper" class="hidden mt-8 text-center">
<button
id="load-more-btn"
class="inline-flex items-center gap-2 px-6 py-3 rounded-xl bg-white/5 border border-white/10 hover:bg-white/10 text-sm font-medium transition-all"
>
Load more releases
<svg
class="w-4 h-4"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M19 9l-7 7-7-7"
/>
</svg>
</button>
</div>
</div>
</main>
<!-- ===== FOOTER ===== -->
<footer class="border-t border-white/5 py-8">
<div
class="max-w-7xl mx-auto px-6 flex flex-col sm:flex-row items-center justify-between gap-4 text-sm text-gray-500"
>
<div class="flex items-center gap-2">
<picture>
<source srcset="assets/images/logo.webp" type="image/webp" />
<img src="assets/images/logo.png" alt="Fireshare" class="h-6" />
</picture>
<span>Fireshare — Open source, self-hosted video sharing.</span>
</div>
<div class="flex items-center gap-4">
<a
href="https://github.com/fireshare-app/fireshare"
target="_blank"
rel="noopener noreferrer"
class="hover:text-gray-300 transition-colors"
>GitHub</a
>
<a
href="https://hub.docker.com/r/shaneisrael/fireshare/tags"
target="_blank"
rel="noopener noreferrer"
class="hover:text-gray-300 transition-colors"
>Docker Hub</a
>
<a
href="https://demo.fireshare.net"
target="_blank"
rel="noopener noreferrer"
class="hover:text-gray-300 transition-colors"
>Demo</a
>
<a
href="https://www.buymeacoffee.com/shaneisrael"
target="_blank"
rel="noopener noreferrer"
class="hover:text-gray-300 transition-colors"
>Donate</a
>
</div>
</div>
</footer>
<!-- marked.js for markdown rendering -->
<script src="https://cdn.jsdelivr.net/npm/marked@9/marked.min.js"></script>
<script>
// ── Theme switching ──
const themeColors = {
ember: "#F97316",
ocean: "#3B82F6",
amethyst: "#A855F7",
blaze: "#E03294",
};
function setTheme(theme) {
document.documentElement.setAttribute("data-theme", theme);
localStorage.setItem("fireshare-theme", theme);
document.querySelectorAll(".theme-option").forEach((btn) => {
btn.classList.toggle("active", btn.dataset.theme === theme);
});
}
setTheme(localStorage.getItem("fireshare-theme") || "blaze");
const themeBtn = document.getElementById("theme-toggle-btn");
const themeDropdown = document.getElementById("theme-dropdown");
themeBtn.addEventListener("click", (e) => {
e.stopPropagation();
themeDropdown.classList.toggle("hidden");
});
document.querySelectorAll(".theme-option").forEach((btn) => {
btn.addEventListener("click", () => {
setTheme(btn.dataset.theme);
themeDropdown.classList.add("hidden");
});
});
document.addEventListener("click", (e) => {
if (
!document.getElementById("theme-toggle-wrapper").contains(e.target)
) {
themeDropdown.classList.add("hidden");
}
});
// ── Mobile menu toggle ──
const menuBtn = document.getElementById("mobile-menu-btn");
const mobileMenu = document.getElementById("mobile-menu");
menuBtn.addEventListener("click", (e) => {
e.stopPropagation();
mobileMenu.classList.toggle("hidden");
});
document.addEventListener("click", (e) => {
if (!menuBtn.contains(e.target) && !mobileMenu.contains(e.target)) {
mobileMenu.classList.add("hidden");
}
});
// ── Releases ──
const PER_PAGE = 10;
let page = 1;
let loading = false;
let exhausted = false;
const container = document.getElementById("releases-container");
const errorEl = document.getElementById("releases-error");
const loadMoreWrapper = document.getElementById("load-more-wrapper");
const loadMoreBtn = document.getElementById("load-more-btn");
function formatDate(iso) {
const d = new Date(iso);
return d.toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric",
});
}
function renderRelease(release, isFirst) {
const isLatest = isFirst && page === 1;
const hasBody = release.body && release.body.trim().length > 0;
const bodyHtml = hasBody
? marked.parse(release.body)
: '<p class="text-gray-600 italic">No release notes provided.</p>';
const card = document.createElement("article");
card.className = "release-card rounded-2xl bg-dark-800/60 p-6 md:p-8";
card.innerHTML = `
<div class="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 mb-5">
<div class="flex items-center gap-3 flex-wrap">
<a
href="${release.html_url}"
target="_blank"
rel="noopener noreferrer"
class="text-xl font-bold text-white hover:text-fire-400 transition-colors"
>${escHtml(release.name || release.tag_name)}</a>
${
isLatest
? `<span class="inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full bg-fire-500/15 border border-fire-500/25 text-fire-400 text-xs font-semibold">
<span class="w-1.5 h-1.5 rounded-full bg-fire-400 animate-pulse"></span>
Latest
</span>`
: ""
}
${release.prerelease ? `<span class="px-2.5 py-0.5 rounded-full bg-yellow-500/10 border border-yellow-500/20 text-yellow-400 text-xs font-semibold">Pre-release</span>` : ""}
</div>
<time
datetime="${release.published_at}"
class="text-sm text-gray-500 whitespace-nowrap shrink-0"
>${formatDate(release.published_at)}</time>
</div>
${
hasBody
? `
<div class="release-body text-sm leading-relaxed">${bodyHtml}</div>
`
: `<p class="text-gray-600 italic text-sm">No release notes provided.</p>`
}
<div class="mt-5 pt-4 border-t border-white/5 flex items-center gap-4 text-xs text-gray-600">
<a
href="${release.html_url}"
target="_blank"
rel="noopener noreferrer"
class="flex items-center gap-1.5 hover:text-gray-400 transition-colors"
>
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
</svg>
View on GitHub
</a>
<span class="text-gray-700">•</span>
<span>${escHtml(release.tag_name)}</span>
</div>
`;
return card;
}
function escHtml(str) {
return str
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """);
}
async function loadReleases() {
if (loading || exhausted) return;
loading = true;
loadMoreBtn.disabled = true;
loadMoreBtn.querySelector("svg").classList.add("animate-spin");
try {
const res = await fetch(
`https://api.github.com/repos/fireshare-app/fireshare/releases?per_page=${PER_PAGE}&page=${page}`,
{ headers: { Accept: "application/vnd.github+json" } },
);
if (!res.ok) throw new Error(`GitHub API ${res.status}`);
const releases = await res.json();
// Clear skeletons on first load
if (page === 1) {
container.innerHTML = "";
}
if (releases.length === 0) {
exhausted = true;
loadMoreWrapper.classList.add("hidden");
if (page === 1) {
container.innerHTML = `<p class="text-center text-gray-500 py-12">No releases found.</p>`;
}
return;
}
releases.forEach((release, i) => {
container.appendChild(
renderRelease(release, page === 1 && i === 0),
);
});
if (releases.length < PER_PAGE) {
exhausted = true;
loadMoreWrapper.classList.add("hidden");
} else {
loadMoreWrapper.classList.remove("hidden");
}
page++;
} catch (err) {
if (page === 1) {
container.innerHTML = "";
errorEl.classList.remove("hidden");
} else {
loadMoreWrapper.classList.add("hidden");
}
console.error("Failed to load releases:", err);
} finally {
loading = false;
loadMoreBtn.disabled = false;
loadMoreBtn.querySelector("svg").classList.remove("animate-spin");
}
}
loadMoreBtn.addEventListener("click", loadReleases);
// Initial load
loadReleases();
</script>
</body>
</html>