-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
1005 lines (930 loc) · 34.2 KB
/
index.html
File metadata and controls
1005 lines (930 loc) · 34.2 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
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Intellindust AI Lab</title>
<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@400;500;700&family=JetBrains+Mono:wght@500&display=swap" rel="stylesheet">
<style>
:root {
--bg: #040b14;
--bg-soft: #071324;
--card: #0a182b;
--text: #e7f2ff;
--muted: #9eb7d6;
--line: rgba(106, 174, 255, 0.2);
--edge-cyan: #37d9ff;
--edge-blue: #63a6ff;
--edge-lime: #57ffbd;
--glow: 0 0 45px rgba(55, 217, 255, 0.25);
--radius: 14px;
--container: 1080px;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: 'Space Grotesk', sans-serif;
color: var(--text);
line-height: 1.65;
background:
radial-gradient(circle at 20% 0%, rgba(55, 217, 255, 0.2), transparent 45%),
radial-gradient(circle at 95% 15%, rgba(87, 255, 189, 0.13), transparent 35%),
linear-gradient(160deg, #040b14 0%, #061120 35%, #07172a 100%);
min-height: 100vh;
scroll-behavior: smooth;
overflow-x: hidden;
}
body::before {
content: "";
position: fixed;
inset: 0;
pointer-events: none;
background-image:
linear-gradient(rgba(125, 196, 255, 0.08) 1px, transparent 1px),
linear-gradient(90deg, rgba(125, 196, 255, 0.08) 1px, transparent 1px);
background-size: 44px 44px;
mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 92%);
z-index: -2;
}
a {
color: var(--edge-cyan);
text-decoration: none;
transition: color 0.2s ease;
}
a:hover { color: var(--edge-lime); }
.page {
max-width: var(--container);
margin: 0 auto;
padding: 0 20px 60px;
}
header {
padding: 84px 20px 54px;
text-align: center;
position: relative;
}
.lang-switch {
position: absolute;
top: 18px;
right: 20px;
display: inline-flex;
gap: 8px;
border: 1px solid var(--line);
background: rgba(5, 15, 27, 0.85);
border-radius: 999px;
padding: 5px;
backdrop-filter: blur(6px);
}
.lang-btn {
border: 0;
border-radius: 999px;
background: transparent;
color: #9ac6ef;
font-family: 'JetBrains Mono', monospace;
font-size: 0.72rem;
padding: 6px 10px;
cursor: pointer;
transition: background 0.2s ease, color 0.2s ease;
}
.lang-btn.active {
background: rgba(87, 255, 189, 0.2);
color: #d7fff0;
}
h1 {
margin: 0;
font-size: clamp(2.2rem, 5vw, 3.6rem);
line-height: 1.08;
letter-spacing: -0.025em;
text-shadow: var(--glow);
}
.hero-sub {
margin: 12px auto 0;
max-width: 720px;
color: #b8d4f4;
font-size: 1.08rem;
}
.hero-stats {
margin: 30px auto 0;
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 10px;
max-width: 760px;
}
.hero-follow {
margin: 14px auto 0;
color: #b9d7f5;
font-size: 0.95rem;
}
.hero-follow a {
font-weight: 700;
color: var(--edge-lime);
}
.status-strip {
margin: 10px auto 0;
max-width: 760px;
border: 1px solid rgba(255, 200, 120, 0.45);
background: rgba(110, 64, 12, 0.28);
color: #ffd9a4;
border-radius: 10px;
padding: 8px 12px;
font-size: 0.85rem;
text-align: center;
}
.stat {
border: 1px solid var(--line);
background: linear-gradient(165deg, rgba(99, 166, 255, 0.13), rgba(7, 22, 41, 0.75));
border-radius: 12px;
padding: 14px 10px;
transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.stat-link {
display: block;
color: inherit;
text-decoration: none;
border-radius: 12px;
}
.stat-link:hover .stat,
.stat-link:focus-visible .stat {
transform: translateY(-2px);
border-color: rgba(87, 255, 189, 0.55);
box-shadow: 0 10px 24px rgba(0, 17, 30, 0.45);
}
.stat strong {
display: block;
font-size: 1.4rem;
font-weight: 700;
color: #e9f7ff;
text-shadow: 0 0 20px rgba(99, 166, 255, 0.5);
}
.stat span {
font-family: 'JetBrains Mono', monospace;
font-size: 0.74rem;
letter-spacing: 0.03em;
color: #7eb6ec;
text-transform: none;
}
section {
margin-top: 20px;
position: relative;
}
h2 {
font-size: clamp(1.45rem, 3.3vw, 2rem);
margin: 28px 0 14px;
letter-spacing: -0.01em;
}
.section-head {
display: flex;
align-items: center;
border-bottom: 1px solid var(--line);
margin-bottom: 16px;
}
.md-section h2 {
font-size: clamp(1.45rem, 3.3vw, 2rem);
margin: 0 0 14px;
letter-spacing: -0.01em;
border-bottom: 1px solid var(--line);
padding-bottom: 10px;
}
.md-section p {
margin: 8px 0 0;
}
.card {
background:
linear-gradient(165deg, rgba(99, 166, 255, 0.09), rgba(9, 22, 37, 0.88));
border: 1px solid rgba(125, 186, 255, 0.25);
border-radius: var(--radius);
padding: 18px;
box-shadow: inset 0 1px 0 rgba(210, 235, 255, 0.08), 0 10px 35px rgba(0, 8, 18, 0.45);
transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
transform-style: preserve-3d;
}
.card:hover {
transform: translateY(-4px);
border-color: rgba(87, 255, 189, 0.45);
box-shadow: inset 0 1px 0 rgba(210, 235, 255, 0.12), 0 16px 45px rgba(2, 17, 31, 0.62);
}
.about-container {
display: grid;
grid-template-columns: 220px minmax(0, 1fr);
gap: 18px;
align-items: stretch;
}
.about-logo {
border-radius: var(--radius);
border: 1px solid var(--line);
background: rgba(10, 25, 43, 0.8);
display: flex;
align-items: center;
justify-content: center;
padding: 16px;
overflow: hidden;
}
.about-logo img {
width: 100%;
max-width: 180px;
border-radius: 12px;
transition: transform 0.5s ease;
}
.about-logo:hover img { transform: scale(1.06) rotate(1.2deg); }
ul { margin: 0; padding-left: 20px; }
.award-item,
.pub-item {
display: grid;
grid-template-columns: 122px minmax(0, 1fr);
gap: 16px;
align-items: start;
padding: 10px;
border-radius: 12px;
transition: background 0.24s ease, transform 0.24s ease;
margin-bottom: 6px;
}
.award-item {
grid-template-columns: 180px minmax(0, 1fr);
}
.pub-item {
grid-template-columns: 196px minmax(0, 1fr);
}
.award-item:hover,
.pub-item:hover {
background: rgba(83, 171, 255, 0.1);
transform: translateX(4px);
}
.award-item img {
width: 180px;
height: 106px;
object-fit: contain;
border-radius: 8px;
border: 1px solid rgba(120, 190, 255, 0.35);
background: #040f1d;
transition: transform 0.26s ease, box-shadow 0.26s ease;
image-rendering: auto;
}
.pub-item img {
width: 196px;
height: 112px;
object-fit: contain;
border-radius: 8px;
border: 1px solid rgba(120, 190, 255, 0.35);
background: #040f1d;
transition: transform 0.26s ease, box-shadow 0.26s ease;
image-rendering: auto;
}
.award-item:hover img,
.pub-item:hover img {
transform: scale(1.06);
box-shadow: 0 10px 24px rgba(0, 17, 30, 0.6);
}
.award-details h3,
.pub-details h3 {
margin: 0;
font-size: 1.03rem;
line-height: 1.45;
color: #e4f2ff;
}
.award-details p,
.pub-details p {
margin: 4px 0 0;
color: var(--muted);
font-size: 0.94rem;
}
.pub-details p:last-child {
margin-top: 7px;
color: #b7d2ef;
font-family: 'JetBrains Mono', monospace;
font-size: 0.77rem;
letter-spacing: 0.03em;
}
.github-button {
display: inline-block;
border: 1px solid rgba(120, 190, 255, 0.45);
border-radius: 999px;
padding: 2px 10px;
line-height: 1.6;
background: rgba(28, 67, 112, 0.25);
color: #cbe6ff;
font-weight: 500;
}
.github-button.loading {
opacity: 0.8;
animation: starPulse 1.05s ease-in-out infinite;
}
@keyframes starPulse {
0%, 100% { opacity: 0.65; }
50% { opacity: 1; }
}
.github-button:hover {
border-color: rgba(87, 255, 189, 0.65);
color: #d8fff1;
}
footer {
margin-top: 24px;
text-align: center;
padding: 26px 12px;
border-top: 1px solid var(--line);
color: #8db3da;
font-size: 0.88rem;
}
.footer-visitors {
margin-top: 6px;
color: #9cc2e4;
font-family: 'JetBrains Mono', monospace;
font-size: 0.8rem;
letter-spacing: 0.04em;
}
.reveal {
opacity: 0;
transform: translateY(20px);
transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
opacity: 1;
transform: translateY(0);
}
@media (max-width: 860px) {
.lang-switch {
position: static;
margin: 0 auto 14px;
}
.hero-stats { grid-template-columns: 1fr; max-width: 420px; }
.about-container { grid-template-columns: 1fr; }
.about-logo { min-height: 150px; }
.award-item,
.pub-item {
grid-template-columns: 1fr;
}
.award-item img,
.pub-item img {
width: 100%;
height: auto;
}
.award-item img {
max-width: 320px;
}
.pub-item img {
max-width: 320px;
}
}
</style>
</head>
<body>
<header class="reveal">
<div class="lang-switch" role="group" aria-label="Language switch">
<button class="lang-btn active" data-lang="en" type="button">EN</button>
<button class="lang-btn" data-lang="fr" type="button">FR</button>
<button class="lang-btn" data-lang="zh" type="button">中文</button>
</div>
<h1 data-i18n="heroTitle">Intellindust AI Lab</h1>
<p class="hero-sub" data-i18n="heroSub">Pioneering vision AI for edge intelligence with fast, efficient, and robust models deployed in real-world environments.</p>
<div class="hero-stats">
<a class="stat-link" href="https://github.com/orgs/Intellindust-AI-Lab/repositories" target="_blank" rel="noopener noreferrer" aria-label="Open Intellindust AI Lab repositories on GitHub">
<div class="stat"><strong data-stat="stars">Loading...</strong><span data-i18n="statStars">GitHub Stars</span></div>
</a>
<a class="stat-link" href="https://huggingface.co/Intellindust/models" target="_blank" rel="noopener noreferrer" aria-label="Open Intellindust models on Hugging Face">
<div class="stat"><strong data-stat="downloads">Loading...</strong><span data-i18n="statDownloads">Hugging Face Model Downloads</span></div>
</a>
<a class="stat-link" href="https://github.com/orgs/Intellindust-AI-Lab/repositories" target="_blank" rel="noopener noreferrer" aria-label="Open Intellindust AI Lab repositories on GitHub">
<div class="stat"><strong data-stat="repos">Loading...</strong><span data-i18n="statRepos">Open Repositories</span></div>
</a>
</div>
<p class="hero-follow" data-i18n-html="followLine">Follow our <a href="https://github.com/Intellindust-AI-Lab" target="_blank" rel="noopener noreferrer">GitHub repos</a> for latest code, checkpoints, and updates.</p>
<p class="status-strip" data-api-status hidden></p>
</header>
<main class="page">
<section class="reveal md-section" data-md-section="about"><div class="card">Loading...</div></section>
<section class="reveal md-section" data-md-section="research"><div class="card">Loading...</div></section>
<section class="reveal md-section" data-md-section="awards"><div class="card">Loading...</div></section>
<section class="reveal md-section" data-md-section="publications"><div class="card">Loading...</div></section>
<section class="reveal md-section" data-md-section="contact"><div class="card">Loading...</div></section>
<footer>
<p data-i18n="footerText">© 2025 Intellindust AI Lab. All rights reserved.</p>
<p class="footer-visitors"><span data-i18n="statVisitors">Visitors</span>: <span data-stat="visitors">Loading...</span></p>
</footer>
</main>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
const reveals = document.querySelectorAll('.reveal');
const revealObserver = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
}
});
}, { threshold: 0.12 });
reveals.forEach((el, idx) => {
el.style.transitionDelay = `${idx * 60}ms`;
revealObserver.observe(el);
});
const CONTENT_CACHE_VERSION = '2026-03-23-2';
const compactNumber = (value) => new Intl.NumberFormat(undefined, { notation: 'compact', maximumFractionDigits: 1 }).format(value);
const nowMs = () => Date.now();
const cacheKey = (key) => `cache:${key}`;
const readCache = (key, ttlMs) => {
try {
const raw = localStorage.getItem(cacheKey(key));
if (!raw) return null;
const parsed = JSON.parse(raw);
if (!parsed || typeof parsed.ts !== 'number') return null;
if (ttlMs > 0 && (nowMs() - parsed.ts > ttlMs)) return null;
return parsed.value;
} catch (_) {
return null;
}
};
const readStaleCache = (key) => {
try {
const raw = localStorage.getItem(cacheKey(key));
if (!raw) return null;
const parsed = JSON.parse(raw);
return parsed ? parsed.value : null;
} catch (_) {
return null;
}
};
const writeCache = (key, value) => {
try {
localStorage.setItem(cacheKey(key), JSON.stringify({ ts: nowMs(), value }));
} catch (_) {
// Ignore cache write failures.
}
};
const fetchJsonWithCache = async (key, url, ttlMs) => {
const cached = readCache(key, ttlMs);
if (cached !== null) return cached;
try {
const res = await fetch(url);
if (!res.ok) throw new Error(`fetch ${url}`);
const data = await res.json();
writeCache(key, data);
return data;
} catch (_) {
const stale = readStaleCache(key);
if (stale !== null) return stale;
throw _;
}
};
const fetchTextWithCache = async (key, url, ttlMs) => {
const cached = readCache(key, ttlMs);
if (cached !== null) return cached;
try {
const res = await fetch(url, { cache: 'no-store' });
if (!res.ok) throw new Error(`fetch ${url}`);
const text = await res.text();
writeCache(key, text);
return text;
} catch (error) {
const stale = readStaleCache(key);
if (stale !== null) return stale;
throw error;
}
};
const animateCounterTo = (element, target) => {
const safeTarget = Number.isFinite(target) && target >= 0 ? target : 0;
const start = Number(element.dataset.value || 0);
const startTime = performance.now();
const duration = 900;
const step = (now) => {
const progress = Math.min((now - startTime) / duration, 1);
const current = Math.round(start + (safeTarget - start) * progress);
element.textContent = compactNumber(current);
if (progress < 1) {
requestAnimationFrame(step);
return;
}
element.dataset.value = String(safeTarget);
};
requestAnimationFrame(step);
};
const statsEls = {
stars: document.querySelector('[data-stat=\"stars\"]'),
downloads: document.querySelector('[data-stat=\"downloads\"]'),
repos: document.querySelector('[data-stat=\"repos\"]'),
visitors: document.querySelector('[data-stat=\"visitors\"]')
};
const apiStatusEl = document.querySelector('[data-api-status]');
let currentLocale = 'en';
const getLoadingText = () => {
if (currentLocale === 'zh') return '加载中...';
if (currentLocale === 'fr') return 'Chargement...';
return 'Loading...';
};
const setStatLoading = (name) => {
const el = statsEls[name];
if (!el) return;
el.textContent = getLoadingText();
delete el.dataset.value;
};
const metricStatus = {
stars: { done: false, ok: false },
downloads: { done: false, ok: false },
visitors: { done: false, ok: false }
};
const markMetric = (name, ok) => {
if (!metricStatus[name]) return;
metricStatus[name].done = true;
metricStatus[name].ok = !!ok;
renderDataStatus();
};
const tiltedCards = new WeakSet();
const bindCardTilt = (root = document) => {
root.querySelectorAll('.card').forEach((card) => {
if (tiltedCards.has(card)) return;
card.addEventListener('mousemove', (e) => {
if (window.innerWidth < 860) return;
const rect = card.getBoundingClientRect();
const px = (e.clientX - rect.left) / rect.width;
const py = (e.clientY - rect.top) / rect.height;
const rotateY = (px - 0.5) * 5;
const rotateX = (0.5 - py) * 4;
card.style.transform = `translateY(-2px) rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
});
card.addEventListener('mouseleave', () => {
card.style.transform = '';
});
tiltedCards.add(card);
});
};
bindCardTilt();
const i18n = {
en: {
heroTitle: 'Intellindust AI Lab',
heroSub: 'Pioneering vision AI for edge intelligence with fast, efficient, and robust models deployed in real-world environments.',
statStars: 'GitHub Stars',
statDownloads: 'Hugging Face Model Downloads',
statRepos: 'Open Repositories',
statVisitors: 'Unique Visitors',
followLine: 'Follow our <a href=\"https://github.com/Intellindust-AI-Lab\" target=\"_blank\" rel=\"noopener noreferrer\">GitHub repos</a> for latest code, checkpoints, and updates.',
dataStatusPartial: 'Some live metrics are temporarily unavailable.',
loadingText: 'Loading...',
localOpenTitle: 'Local Preview Requires a Web Server',
localOpenBody: 'Opening `index.html` directly via `file://` blocks section loading in browsers. Run `./run_local.sh` and open `http://localhost:8000/index.html` instead.',
footerText: '\u00a9 2025 Intellindust AI Lab. All rights reserved.'
},
fr: {
heroTitle: 'Intellindust AI Lab',
heroSub: "Nous concevons des systèmes de vision par ordinateur pour l'edge, avec des modèles rapides, efficaces et robustes, pensés pour des usages réels.",
statStars: 'Total des stars GitHub',
statDownloads: 'Téléchargements de modèles Hugging Face',
statRepos: 'Dépôts open source',
statVisitors: 'Visiteurs uniques',
followLine: 'Suivez nos <a href=\"https://github.com/Intellindust-AI-Lab\" target=\"_blank\" rel=\"noopener noreferrer\">dépôts GitHub</a> pour accéder à nos derniers codes, checkpoints et mises à jour.',
dataStatusPartial: 'Certaines métriques en direct sont temporairement indisponibles.',
loadingText: 'Chargement...',
localOpenTitle: 'L’aperçu local nécessite un serveur web',
localOpenBody: 'Ouvrir `index.html` directement via `file://` empêche le chargement des sections dans le navigateur. Lancez `./run_local.sh` puis ouvrez `http://localhost:8000/index.html`.',
footerText: '\u00a9 2025 Intellindust AI Lab. Tous droits réservés.'
},
zh: {
heroTitle: '英特灵达人工智能实验室',
heroSub: '面向边缘智能场景,打造快速、高效、可靠的视觉 AI 模型与系统。',
statStars: 'GitHub 总 Star',
statDownloads: 'Hugging Face 模型下载量',
statRepos: '开源仓库',
statVisitors: '独立访客',
followLine: '欢迎关注我们的 <a href=\"https://github.com/Intellindust-AI-Lab\" target=\"_blank\" rel=\"noopener noreferrer\">GitHub 仓库</a>,获取最新代码、权重与更新。',
dataStatusPartial: '部分实时数据暂时不可用。',
loadingText: '加载中...',
localOpenTitle: '本地预览需要通过 Web 服务器打开',
localOpenBody: '直接用 `file://` 打开 `index.html` 时,浏览器会拦截页面对各分区内容的加载。请运行 `./run_local.sh`,然后访问 `http://localhost:8000/index.html`。',
footerText: '\u00a9 2025 Intellindust AI Lab。保留所有权利。'
}
};
const getLocalOpenFallbackHtml = (locale) => {
const pack = i18n[locale] || i18n.en;
return `<div class="card"><h3>${pack.localOpenTitle || i18n.en.localOpenTitle}</h3><p>${pack.localOpenBody || i18n.en.localOpenBody}</p></div>`;
};
const renderDataStatus = () => {
if (!apiStatusEl) return;
const allDone = Object.values(metricStatus).every((m) => m.done);
const allFailed = Object.values(metricStatus).every((m) => m.done && !m.ok);
if (!allDone || !allFailed) {
apiStatusEl.hidden = true;
apiStatusEl.textContent = '';
return;
}
const pack = i18n[currentLocale] || i18n.en;
apiStatusEl.hidden = false;
apiStatusEl.textContent = pack.dataStatusPartial || i18n.en.dataStatusPartial;
};
const fetchMarkdown = async (locale, section) => {
const preferred = `content/${locale}/${section}.md`;
const fallback = `content/en/${section}.md`;
try {
return await fetchTextWithCache(`md_${CONTENT_CACHE_VERSION}_${locale}_${section}`, preferred, 10 * 60 * 1000);
} catch (_) {
return fetchTextWithCache(`md_${CONTENT_CACHE_VERSION}_en_${section}`, fallback, 10 * 60 * 1000);
}
};
const starCache = new Map();
const fetchRepoStarCount = async (repoPath) => {
if (starCache.has(repoPath)) return starCache.get(repoPath);
const data = await fetchJsonWithCache(
`gh_repo_${repoPath}`,
`https://api.github.com/repos/${repoPath}`,
15 * 60 * 1000
);
const count = Number(data.stargazers_count || 0);
starCache.set(repoPath, count);
return count;
};
const hydratePublicationStars = async () => {
const starLinks = Array.from(document.querySelectorAll('a.github-button'));
starLinks.forEach((link) => {
link.textContent = 'Star ...';
link.classList.add('loading');
});
await Promise.all(starLinks.map(async (link) => {
try {
const url = new URL(link.href);
const seg = url.pathname.split('/').filter(Boolean);
if (seg.length < 2) return;
const repoPath = `${seg[0]}/${seg[1]}`;
const stars = await fetchRepoStarCount(repoPath);
link.textContent = `Star ${compactNumber(stars)}`;
} catch (_) {
link.textContent = 'Star';
} finally {
link.classList.remove('loading');
}
}));
};
const loadMarkdownSections = async (locale) => {
const resolved = locale === 'zh' || locale === 'fr' ? locale : 'en';
const parser = window.marked || null;
if (!parser) return;
const sections = document.querySelectorAll('[data-md-section]');
if (window.location.protocol === 'file:') {
const fallbackHtml = getLocalOpenFallbackHtml(resolved);
sections.forEach((host) => {
host.innerHTML = fallbackHtml;
});
bindCardTilt(document);
return;
}
await Promise.all(Array.from(sections).map(async (host) => {
const section = host.dataset.mdSection;
try {
const mdText = await fetchMarkdown(resolved, section);
host.innerHTML = parser.parse(mdText);
} catch (_) {
host.innerHTML = '<div class="card">Content unavailable.</div>';
}
}));
bindCardTilt(document);
await hydratePublicationStars();
};
const fetchAllOrgRepos = async (org) => {
const cacheK = `gh_org_repos_${org}`;
const cached = readCache(cacheK, 15 * 60 * 1000);
if (cached !== null) return cached;
let page = 1;
const all = [];
while (true) {
const url = `https://api.github.com/orgs/${encodeURIComponent(org)}/repos?type=public&per_page=100&page=${page}`;
const res = await fetch(url, { cache: 'no-store' });
if (!res.ok) throw new Error(`github org repos ${org}`);
const repos = await res.json();
if (!Array.isArray(repos) || repos.length === 0) break;
all.push(...repos);
if (repos.length < 100) break;
page += 1;
}
writeCache(cacheK, all);
return all;
};
const fetchAllOrgReposWithFallback = async (org) => {
try {
return await fetchAllOrgRepos(org);
} catch (error) {
const stale = readStaleCache(`gh_org_repos_${org}`);
if (stale !== null) return stale;
throw error;
}
};
const fetchRepoStars = async (repoName) => {
const data = await fetchJsonWithCache(
`gh_org_repo_${repoName}`,
`https://api.github.com/repos/Intellindust-AI-Lab/${repoName}`,
15 * 60 * 1000
);
return Number(data.stargazers_count || 0);
};
const fetchGitHubReleaseDownloads = async (repoName) => {
const releases = await fetchJsonWithCache(
`gh_releases_${repoName}`,
`https://api.github.com/repos/Intellindust-AI-Lab/${repoName}/releases?per_page=5`,
30 * 60 * 1000
);
return releases.reduce((sum, rel) => {
const assets = Array.isArray(rel.assets) ? rel.assets : [];
return sum + assets.reduce((assetSum, asset) => assetSum + Number(asset.download_count || 0), 0);
}, 0);
};
const parseNextLink = (linkHeader) => {
if (!linkHeader) return null;
const parts = linkHeader.split(',');
for (const part of parts) {
const sections = part.split(';').map((s) => s.trim());
if (sections.length < 2) continue;
const url = sections[0].replace(/^<|>$/g, '');
const rel = sections[1];
if (rel === 'rel=\"next\"') return url;
}
return null;
};
const fetchAllHfModelsByAuthor = async (author) => {
const cacheK = `hf_models_${author}`;
const cached = readCache(cacheK, 30 * 60 * 1000);
if (cached !== null) return cached;
let url = `https://huggingface.co/api/models?author=${encodeURIComponent(author)}&full=false&limit=100`;
const all = [];
while (url) {
const res = await fetch(url);
if (!res.ok) throw new Error(`hf author ${author}`);
const models = await res.json();
if (Array.isArray(models)) all.push(...models);
url = parseNextLink(res.headers.get('Link'));
}
writeCache(cacheK, all);
return all;
};
const fetchAllHfModelsByAuthorWithFallback = async (author) => {
try {
return await fetchAllHfModelsByAuthor(author);
} catch (error) {
const stale = readStaleCache(`hf_models_${author}`);
if (stale !== null) return stale;
throw error;
}
};
const fetchHfDownloads = async () => {
const authors = ['Intellindust', 'Intellindust-AI-Lab'];
const modelGroups = await Promise.allSettled(authors.map((author) => fetchAllHfModelsByAuthorWithFallback(author)));
const uniqueById = new Map();
modelGroups.forEach((result) => {
if (result.status !== 'fulfilled' || !Array.isArray(result.value)) return;
result.value.forEach((model) => {
if (model && model.id) uniqueById.set(model.id, model);
});
});
return Array.from(uniqueById.values()).reduce((sum, model) => sum + Number(model.downloads || 0), 0);
};
const loadImpactStats = async () => {
let orgRepos = [];
try {
orgRepos = await fetchAllOrgReposWithFallback('Intellindust-AI-Lab');
} catch (_) {}
const repoCount = orgRepos.length;
if (statsEls.repos && repoCount > 0) {
animateCounterTo(statsEls.repos, repoCount);
} else {
setStatLoading('repos');
}
const totalStars = orgRepos.reduce((sum, repo) => sum + Number(repo && repo.stargazers_count ? repo.stargazers_count : 0), 0);
const starOk = totalStars > 0;
if (statsEls.stars && starOk) {
animateCounterTo(statsEls.stars, totalStars);
} else {
setStatLoading('stars');
}
markMetric('stars', starOk);
let downloads = 0;
try {
downloads = await fetchHfDownloads();
} catch (_) {}
if (downloads <= 0) {
const fallbackRepos = orgRepos
.map((repo) => repo && repo.name)
.filter((name) => typeof name === 'string' && name.length > 0);
if (fallbackRepos.length > 0) {
const orgReleaseResults = await Promise.allSettled(fallbackRepos.map((repo) => fetchGitHubReleaseDownloads(repo)));
downloads = orgReleaseResults.reduce((sum, item) => sum + (item.status === 'fulfilled' ? item.value : 0), 0);
}
}
const downloadsOk = downloads > 0;
if (statsEls.downloads && downloadsOk) {
animateCounterTo(statsEls.downloads, downloads);
} else {
setStatLoading('downloads');
}
markMetric('downloads', downloadsOk);
};
const fetchVisitorCounter = async (endpoint, timeoutMs = 5000) => {
const ctrl = new AbortController();
const timer = window.setTimeout(() => ctrl.abort(), timeoutMs);
try {
const res = await fetch(endpoint, { cache: 'no-store', signal: ctrl.signal });
if (!res.ok) throw new Error('visitor counter fetch failed');
const data = await res.json();
return Number(data && (data.value || data.count) ? String(data.value || data.count).replace(/,/g, '') : 0);
} finally {
window.clearTimeout(timer);
}
};
const fetchCountApiVisitorCount = async () => {
const visitorNamespace = 'intellindust-ai-lab';
const visitorKey = 'homepage-visitors';
const legacyNamespace = 'intellindust-ai-lab.github.io';
const legacyKey = 'uv-homepage';
const localMarker = 'uv-counted-homepage';
const getUrl = `https://api.countapi.xyz/get/${visitorNamespace}/${visitorKey}`;
const hitUrl = `https://api.countapi.xyz/hit/${visitorNamespace}/${visitorKey}`;
const legacyGetUrl = `https://api.countapi.xyz/get/${legacyNamespace}/${legacyKey}`;
const counted = localStorage.getItem(localMarker) === '1';
if (!counted) {
const firstHit = await fetchVisitorCounter(hitUrl);
localStorage.setItem(localMarker, '1');
if (firstHit > 0) return firstHit;
}
const currentValue = await fetchVisitorCounter(getUrl);
if (currentValue > 0) return currentValue;
const healedValue = await fetchVisitorCounter(hitUrl);
if (healedValue > 0) return healedValue;
return fetchVisitorCounter(legacyGetUrl);
};
const loadVisitorCount = async () => {
const visitorCacheKey = 'visitor_count_homepage';
try {
const visitors = await fetchCountApiVisitorCount();
if (visitors > 0) writeCache(visitorCacheKey, visitors);
if (statsEls.visitors && visitors > 0) {
animateCounterTo(statsEls.visitors, visitors);
} else {
setStatLoading('visitors');
}
markMetric('visitors', true);
} catch (_) {
const cachedVisitors = readStaleCache(visitorCacheKey);
if (statsEls.visitors && Number(cachedVisitors) > 0) {
animateCounterTo(statsEls.visitors, Number(cachedVisitors));
markMetric('visitors', true);
} else {
setStatLoading('visitors');
markMetric('visitors', false);
}
}
};
setStatLoading('stars');
setStatLoading('downloads');
setStatLoading('visitors');
loadImpactStats();
loadVisitorCount();
const setLanguage = async (lang) => {
const locale = i18n[lang] ? lang : 'en';
currentLocale = locale;
document.documentElement.lang = locale === 'zh' ? 'zh-CN' : (locale === 'fr' ? 'fr' : 'en');
document.querySelectorAll('[data-i18n]').forEach((el) => {
const key = el.dataset.i18n;
if (i18n[locale][key]) el.textContent = i18n[locale][key];
});
document.querySelectorAll('[data-i18n-html]').forEach((el) => {
const key = el.dataset.i18nHtml;
if (i18n[locale][key]) el.innerHTML = i18n[locale][key];
});
document.querySelectorAll('.lang-btn').forEach((btn) => {
btn.classList.toggle('active', btn.dataset.lang === locale);
});
localStorage.setItem('site-lang', locale);
Object.keys(metricStatus).forEach((k) => {
if (!metricStatus[k].ok) setStatLoading(k);
});
await loadMarkdownSections(locale);
renderDataStatus();
};
document.querySelectorAll('.lang-btn').forEach((btn) => {
btn.addEventListener('click', () => { setLanguage(btn.dataset.lang); });
});
const detectLanguageByIP = async () => {
try {
const res = await fetch('https://ipwho.is/');
if (!res.ok) return 'en';
const data = await res.json();
const countryCode = data && data.country_code ? String(data.country_code).toUpperCase() : '';
if (countryCode === 'CN') return 'zh';
const frenchCountries = new Set([
'FR', 'BE', 'CH', 'CA', 'LU', 'MC',
'DZ', 'MA', 'TN', 'SN', 'CI', 'CM',
'ML', 'NE', 'BF', 'TG', 'BJ', 'GN',
'CD', 'CG', 'GA', 'DJ', 'TD', 'CF',
'RW', 'BI', 'KM', 'MG', 'MU', 'SC',
'VU', 'HT', 'GQ'
]);
if (frenchCountries.has(countryCode)) return 'fr';
return 'en';
} catch (_) {
return 'en';
}
};
const initLanguage = async () => {
const saved = localStorage.getItem('site-lang');
if (saved === 'en' || saved === 'zh' || saved === 'fr') {
await setLanguage(saved);
return;
}
const detected = await detectLanguageByIP();
await setLanguage(detected);
};