-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
797 lines (693 loc) · 23 KB
/
index.html
File metadata and controls
797 lines (693 loc) · 23 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>mimicode</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #0a0a0b;
--surface: #111113;
--surface2: #16161a;
--border: #1e1e22;
--border-hover: #2a2a30;
--text: #e8e8ed;
--muted: #909099;
--subtle: #5a5a6a;
--dim: #2e2e3a;
--font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}
html { scroll-behavior: smooth; }
body {
background-color: var(--bg);
background-image:
linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px),
linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
font-size: 15px;
line-height: 1.6;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
}
/* ── Nav ── */
header {
position: sticky;
top: 0;
z-index: 100;
width: 100%;
background: transparent;
border-bottom: 1px solid transparent;
transition: background 0.25s, border-color 0.25s;
}
header.scrolled {
background: rgba(10, 10, 11, 0.85);
backdrop-filter: blur(14px);
-webkit-backdrop-filter: blur(14px);
border-bottom-color: var(--border);
}
nav {
width: 100%;
max-width: 920px;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
padding: 18px 24px;
}
.nav-logo {
font-size: 16px;
font-weight: 600;
letter-spacing: -0.02em;
color: var(--text);
text-decoration: none;
}
.nav-links {
display: flex;
gap: 32px;
list-style: none;
}
.nav-links a {
color: var(--muted);
text-decoration: none;
font-size: 14px;
transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
/* ── Main ── */
main {
flex: 1;
width: 100%;
max-width: 920px;
padding: 72px 24px 140px;
display: flex;
flex-direction: column;
align-items: center;
}
/* ── Hero ── */
.hero {
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
}
h1 {
font-size: clamp(52px, 9vw, 88px);
font-weight: 700;
letter-spacing: -0.05em;
line-height: 1;
margin-bottom: 22px;
color: var(--text);
}
.tagline {
font-size: clamp(15px, 2.2vw, 19px);
color: var(--muted);
max-width: 520px;
margin-bottom: 12px;
line-height: 1.75;
}
.tagline strong { color: var(--text); font-weight: 500; }
.sub-tagline {
font-size: 13px;
color: var(--muted);
max-width: 440px;
margin-bottom: 44px;
opacity: 0.65;
line-height: 1.7;
}
/* ── Install widget (desktop) ── */
.install-wrap {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
width: 100%;
max-width: 540px;
}
.install-widget {
display: flex;
align-items: stretch;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--surface);
overflow: visible;
width: 100%;
transition: border-color 0.2s;
}
.install-widget:hover { border-color: var(--border-hover); }
.install-select {
display: flex;
align-items: center;
gap: 6px;
padding: 0 14px;
border-right: 1px solid var(--border);
border-radius: 10px 0 0 10px;
cursor: pointer;
white-space: nowrap;
position: relative;
user-select: none;
transition: background 0.15s;
overflow: visible;
}
.install-select:hover { background: rgba(255,255,255,0.03); }
.select-label {
font-size: 11px;
font-weight: 500;
color: var(--muted);
letter-spacing: 0.01em;
}
.select-icon {
color: var(--muted);
transition: transform 0.2s;
flex-shrink: 0;
}
.install-select.open .select-icon { transform: rotate(180deg); }
.dropdown {
position: absolute;
top: calc(100% + 8px);
left: 0;
background: var(--surface2);
border: 1px solid var(--border);
border-radius: 8px;
min-width: 188px;
overflow: hidden;
z-index: 200;
display: none;
box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.install-select.open .dropdown { display: block; }
.dropdown-item {
padding: 10px 14px;
font-size: 12px;
color: var(--muted);
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
transition: background 0.1s, color 0.1s;
}
.dropdown-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.dropdown-item.active { color: var(--text); }
.command-display {
display: flex;
align-items: center;
flex: 1;
padding: 0 6px 0 14px;
gap: 6px;
min-width: 0;
}
.command-text {
font-family: var(--font-mono);
font-size: 12px;
color: var(--text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
background: none;
border: none;
outline: none;
padding: 14px 0;
}
.copy-btn {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 6px;
border: none;
background: transparent;
color: var(--muted);
cursor: pointer;
flex-shrink: 0;
transition: background 0.15s, color 0.15s;
position: relative;
}
.copy-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.copy-btn.copied { color: var(--text); }
.tooltip {
position: absolute;
bottom: calc(100% + 6px);
left: 50%;
transform: translateX(-50%);
background: #1e1e24;
border: 1px solid var(--border);
color: var(--text);
font-size: 11px;
padding: 3px 8px;
border-radius: 5px;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity 0.15s;
}
.copy-btn:hover .tooltip,
.copy-btn.copied .tooltip { opacity: 1; }
/* Mobile: guide button replaces install widget */
.guide-btn {
display: none;
align-items: center;
gap: 8px;
padding: 12px 22px;
border-radius: 10px;
border: 1px solid var(--border);
background: var(--surface);
color: var(--text);
font-size: 14px;
font-weight: 500;
cursor: pointer;
text-decoration: none;
transition: border-color 0.2s, background 0.2s;
}
.guide-btn:hover { border-color: var(--border-hover); background: var(--surface2); }
@media (max-width: 580px) {
.install-widget { display: none; }
.guide-btn { display: flex; }
}
.stats-meta {
margin-top: 78px;
margin-bottom: 10px;
color: var(--subtle);
font-size: 12px;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.hero-image {
width: 100%;
height: auto;
display: block;
background: transparent;
transform: scale(1.35);
transform-origin: center top;
margin-bottom: 260px;
}
.stats-meta .demo-tag {
color: var(--muted);
letter-spacing: 0.04em;
margin-left: 4px;
}
/* ── Stats strip ── */
.stats-strip {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1px;
width: 100%;
margin-top: 0;
border: 1px solid var(--border);
border-radius: 12px;
overflow: hidden;
background: var(--border);
}
.stat-cell {
background: var(--surface);
padding: 28px 24px;
display: flex;
flex-direction: column;
gap: 4px;
}
.stat-number {
font-size: clamp(28px, 4vw, 42px);
font-weight: 700;
letter-spacing: -0.04em;
line-height: 1;
color: var(--text);
}
.stat-label {
font-size: 12px;
color: var(--subtle);
line-height: 1.4;
}
/* ── Section eyebrow ── */
.section-eyebrow {
font-size: 11px;
font-weight: 500;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--subtle);
margin-bottom: 24px;
}
/* ── Why section ── */
.why-section {
width: 100%;
max-width: 820px;
margin-top: 80px;
align-self: flex-start;
}
.why-body {
font-size: 15px;
color: var(--muted);
line-height: 1.8;
margin-bottom: 18px;
}
.why-body:last-child { margin-bottom: 0; }
/* ── Comparison table ── */
.compare-section {
width: 100%;
margin-top: 80px;
}
.compare-header {
display: grid;
grid-template-columns: 1fr 160px 160px;
gap: 0;
padding: 0 0 14px 0;
border-bottom: 1px solid var(--border);
}
.compare-header span {
font-size: 11px;
font-weight: 500;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--muted);
}
.compare-header .col-mimi { color: var(--text); }
.compare-row {
display: grid;
grid-template-columns: 1fr 160px 160px;
gap: 0;
padding: 18px 0;
border-bottom: 1px solid var(--border);
align-items: center;
}
.compare-row:hover { background: rgba(255,255,255,0.01); }
.compare-metric {
font-size: 13px;
color: var(--muted);
}
.compare-val {
font-size: 13px;
font-family: var(--font-mono);
}
.compare-val.bad { color: var(--muted); }
.compare-val.good { color: var(--text); }
.compare-bar-wrap {
width: 100%;
margin-top: 80px;
display: flex;
flex-direction: column;
gap: 20px;
}
.bar-row {
display: grid;
grid-template-columns: 180px 1fr 64px;
align-items: center;
gap: 16px;
}
.bar-label { font-size: 12px; color: var(--muted); }
.bar-track {
height: 6px;
border-radius: 999px;
background: var(--surface2);
overflow: hidden;
position: relative;
}
.bar-fill {
height: 100%;
border-radius: 999px;
transition: width 1s cubic-bezier(0.16,1,0.3,1);
}
.bar-fill.them { background: var(--dim); }
.bar-fill.us { background: var(--text); }
.bar-pct { font-size: 12px; font-family: var(--font-mono); color: var(--muted); text-align: right; }
/* ── Footer ── */
footer {
width: 100%;
max-width: 920px;
padding: 24px;
border-top: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 8px;
}
footer span { font-size: 12px; color: var(--muted); }
/* ── Responsive ── */
@media (max-width: 720px) {
.hero-image {
transform: scale(1.18);
margin-bottom: 110px;
}
.stats-meta {
margin-top: 36px;
}
.stats-strip { grid-template-columns: repeat(2, 1fr); }
.compare-header, .compare-row { grid-template-columns: 1fr 100px 100px; }
.bar-row { grid-template-columns: 120px 1fr 50px; }
}
@media (max-width: 500px) {
.hero-image {
transform: scale(1.08);
margin-bottom: 36px;
}
.stats-meta {
margin-top: 22px;
}
.nav-links { display: none; }
.stats-strip { grid-template-columns: 1fr 1fr; }
}
</style>
</head>
<body>
<header>
<nav>
<a class="nav-logo" href="#">mimicode</a>
<ul class="nav-links">
<li><a href="#why">why</a></li>
<li><a href="#compare">compare</a></li>
<li><a href="/docs.html">docs</a></li>
<li><a href="https://github.com/alvinliju/mimicode" target="_blank" rel="noopener">github</a></li>
</ul>
</nav>
</header>
<main>
<!-- ── Hero ── -->
<div class="hero">
<h1>mimicode</h1>
<p class="tagline">
A <strong>memory-efficient</strong>, <strong>token-optimized</strong> coding agent
built to do more with less. No bloat. No waste.
</p>
<p class="sub-tagline">
mimicode tracks only what matters — keeping context tight, tokens lean,
and every action deliberate. Ship faster without burning through your budget.
</p>
<div class="install-wrap">
<div class="install-widget">
<div class="install-select" id="installSelect">
<span class="select-label" id="selectLabel">macOS / Linux</span>
<svg xmlns="http://www.w3.org/2000/svg" class="select-icon" width="12" height="12" viewBox="0 0 1024 1024">
<path d="M482.95936 717.33248a36.864 36.864 0 0 0 52.0192-0.08192l285.696-285.696a36.864 36.864 0 1 0-52.10112-52.10112l-259.72736 259.6864-261.69344-259.80928a36.864 36.864 0 1 0-51.93728 52.34688l287.744 285.65504z" fill="currentColor"/>
</svg>
<div class="dropdown" id="dropdown">
<div class="dropdown-item active" data-cmd="curl -fsSL https://trymimicode.github.io/install.sh | bash" data-label="macOS / Linux">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="18" height="14" rx="2"/><path d="M8 21h8M12 17v4"/>
</svg>
macOS / Linux
</div>
<div class="dropdown-item" data-cmd="irm https://trymimicode.github.io/install.ps1 | iex" data-label="Windows">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18M9 21V9"/>
</svg>
Windows
</div>
<div class="dropdown-item" data-cmd="pip install mimicode" data-label="pip (Python)">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2C8 2 5 4 5 8v2c0 2 1 3 3 4v2c0 2 2 4 4 4s4-2 4-4v-2c2-1 3-2 3-4V8c0-4-3-6-7-6z"/>
</svg>
pip (Python)
</div>
</div>
</div>
<div class="command-display">
<code class="command-text" id="commandText">curl -fsSL https://trymimicode.github.io/install.sh | bash</code>
<button class="copy-btn" id="copyBtn" aria-label="Copy command">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 1024 1024">
<path d="M725.333333 302.933333a166.4 166.4 0 0 1 166.4 166.4v256a166.4 166.4 0 0 1-166.4 166.4h-256A166.4 166.4 0 0 1 302.933333 725.333333v-256A166.4 166.4 0 0 1 469.333333 302.933333h256z m-256 76.8A89.6 89.6 0 0 0 379.733333 469.333333v256c0 49.493333 40.106667 89.6 89.6 89.6h256a89.6 89.6 0 0 0 89.6-89.6v-256A89.6 89.6 0 0 0 725.333333 379.733333h-256z" fill="currentColor"/>
<path d="M554.666667 132.266667a166.4 166.4 0 0 1 144.128 83.2 38.4 38.4 0 0 1-66.517334 38.4A89.514667 89.514667 0 0 0 554.666667 209.066667H298.666667A89.6 89.6 0 0 0 209.066667 298.666667v256c0 33.109333 17.92 62.08 44.8 77.653333a38.4 38.4 0 0 1-38.4 66.474667A166.4 166.4 0 0 1 132.266667 554.666667V298.666667A166.4 166.4 0 0 1 298.666667 132.266667h256z" fill="currentColor"/>
</svg>
<span class="tooltip" id="copyTooltip">Copy</span>
</button>
</div>
</div>
<a class="guide-btn" href="#">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/>
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/>
</svg>
User Guide
</a>
</div>
</div>
<img
class="hero-image"
src="assets/image.png"
alt="mimicode demo terminal screenshot"
/>
<!-- ── Stats strip ── -->
<div class="stats-meta">statistics <span class="demo-tag">(demo)</span></div>
<div class="stats-strip">
<div class="stat-cell">
<div class="stat-number">85.7%</div>
<div class="stat-label">pass rate on internal suite<br>(6/7 tasks)</div>
</div>
<div class="stat-cell">
<div class="stat-number">62%</div>
<div class="stat-label">less avg input tokens per task<br>vs ~12.4k industry avg</div>
</div>
<div class="stat-cell">
<div class="stat-number">$0.15</div>
<div class="stat-label">est. session cost (10-turn)<br>vs $0.42 all-Sonnet</div>
</div>
<div class="stat-cell">
<div class="stat-number">73%</div>
<div class="stat-label">cache hit rate<br>vs 18–25% industry avg</div>
</div>
</div>
<!-- ── Why ── -->
<div class="why-section" id="why">
<div class="section-eyebrow">why mimicode</div>
<p class="why-body">
Most coding agents treat tokens like they're free. They load your whole codebase, narrate every step,
and ask the model to figure out what's relevant. It works — but it's wasteful, slow, and expensive.
</p>
<p class="why-body">
mimicode starts from the opposite assumption: the model works best when it only sees what it needs.
So before anything is sent, context is pruned. Files are targeted, not explored. Prompts are compressed,
not padded. Every action is planned once, not negotiated across five back-and-forth rounds.
</p>
<p class="why-body">
The result is an agent that's quieter, leaner, and cheaper to run — without being any less capable.
You get the same quality of output, just without burning through your API budget to get there.
</p>
</div>
<!-- ── Comparison ── -->
<div class="compare-section" id="compare">
<div class="section-eyebrow" style="margin-bottom:24px">mimicode vs typical agent</div>
<div class="compare-header">
<span>metric</span>
<span>typical agent</span>
<span class="col-mimi">mimicode</span>
</div>
<div class="compare-row">
<span class="compare-metric">Avg tokens per task</span>
<span class="compare-val bad">~12,400</span>
<span class="compare-val good">~4,753</span>
</div>
<div class="compare-row">
<span class="compare-metric">Cache hit rate</span>
<span class="compare-val bad">~22%</span>
<span class="compare-val good">73%</span>
</div>
<div class="compare-row">
<span class="compare-metric">Avg cost per session</span>
<span class="compare-val bad">$0.42</span>
<span class="compare-val good">$0.15</span>
</div>
<div class="compare-row">
<span class="compare-metric">Tool error rate</span>
<span class="compare-val bad">8–12%</span>
<span class="compare-val good">4.3%</span>
</div>
<div class="compare-row">
<span class="compare-metric">Suite pass rate (industry est.)</span>
<span class="compare-val bad">~70%</span>
<span class="compare-val good">85.7%</span>
</div>
<div class="compare-row">
<span class="compare-metric">Context pruning</span>
<span class="compare-val bad">none</span>
<span class="compare-val good">aggressive</span>
</div>
<!-- Visual bar comparison -->
<div class="compare-bar-wrap" style="margin-top:40px">
<div class="section-eyebrow">token usage — normalized to task complexity</div>
<div class="bar-row">
<span class="bar-label">typical agent</span>
<div class="bar-track">
<div class="bar-fill them" id="barThem" style="width:0%"></div>
</div>
<span class="bar-pct">100%</span>
</div>
<div class="bar-row">
<span class="bar-label">mimicode</span>
<div class="bar-track">
<div class="bar-fill us" id="barUs" style="width:0%"></div>
</div>
<span class="bar-pct">38%</span>
</div>
</div>
</div>
</main>
<footer>
<span>mimicode © 2026</span>
<span>memory-efficient · token-optimized · minimal</span>
</footer>
<script>
// ── Dropdown ──
const select = document.getElementById('installSelect');
const cmdText = document.getElementById('commandText');
const selLabel = document.getElementById('selectLabel');
select.addEventListener('click', e => {
if (e.target.closest('.dropdown-item')) return;
select.classList.toggle('open');
});
document.addEventListener('click', e => {
if (!select.contains(e.target)) select.classList.remove('open');
});
document.querySelectorAll('.dropdown-item').forEach(item => {
item.addEventListener('click', () => {
document.querySelectorAll('.dropdown-item').forEach(i => i.classList.remove('active'));
item.classList.add('active');
cmdText.textContent = item.dataset.cmd;
selLabel.textContent = item.dataset.label;
select.classList.remove('open');
});
});
// ── Copy ──
const copyBtn = document.getElementById('copyBtn');
const tooltip = document.getElementById('copyTooltip');
copyBtn.addEventListener('click', async () => {
try {
await navigator.clipboard.writeText(cmdText.textContent);
} catch {
const r = document.createRange();
r.selectNode(cmdText);
window.getSelection().removeAllRanges();
window.getSelection().addRange(r);
document.execCommand('copy');
window.getSelection().removeAllRanges();
}
copyBtn.classList.add('copied');
tooltip.textContent = 'Copied!';
setTimeout(() => { copyBtn.classList.remove('copied'); tooltip.textContent = 'Copy'; }, 1800);
});
// ── Animate bars on scroll ──
const barThem = document.getElementById('barThem');
const barUs = document.getElementById('barUs');
const io = new IntersectionObserver(entries => {
entries.forEach(e => {
if (e.isIntersecting) {
barThem.style.width = '100%';
barUs.style.width = '38%';
io.disconnect();
}
});
}, { threshold: 0.4 });
io.observe(barThem.closest('.compare-bar-wrap'));
// ── Sticky nav ──
const hdr = document.querySelector('header');
const onScroll = () => hdr.classList.toggle('scrolled', window.scrollY > 0);
window.addEventListener('scroll', onScroll, { passive: true });
onScroll();
</script>
</body>
</html>