forked from Jakubantalik/transitions.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
2870 lines (2756 loc) · 124 KB
/
Copy pathexample.html
File metadata and controls
2870 lines (2756 loc) · 124 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" data-theme="light">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Example - Modal multi-page UI</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap" />
<script>
(function seedThemeBeforePaint() {
// Prevent light->dark flash inside embedded iframes by setting
// data-theme before CSS parses. Priority:
// 1) explicit ?theme= param
// 2) parent document theme (same-origin embed)
// 3) OS preference fallback
var html = document.documentElement;
var params = new URLSearchParams(window.location.search);
var q = params.get("theme");
if (q === "dark" || q === "light") {
html.dataset.theme = q;
return;
}
var seeded = null;
if (params.get("embed") === "1") {
try {
if (window.parent && window.parent !== window) {
var parentTheme = window.parent.document.documentElement.dataset.theme;
if (parentTheme === "dark" || parentTheme === "light") seeded = parentTheme;
}
} catch (_) {}
}
if (!seeded && window.matchMedia) {
seeded = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
}
if (seeded) html.dataset.theme = seeded;
})();
</script>
<style>
/* ──────────────────────────────────────────────────────────────
Design tokens — pulled 1:1 from Figma node 450:649 (light) and
450:1101 (dark inversion). Light is the source of truth; dark
mirrors it via overrides so every literal value is in one place.
────────────────────────────────────────────────────────────── */
:root {
/* Surfaces */
--bg-page: #fdfdfd;
--bg-modal: #ffffff;
--bg-input: rgba(58, 58, 58, 0.04);
--bg-tab-active: rgba(61, 61, 61, 0.04);
--bg-ghost-hover: rgba(61, 61, 61, 0.04);
--bg-org-ring: transparent;
--bg-backdrop: rgba(0, 0, 0, 0.12);
/* Text */
--text-strong: #1b1b1b;
--text-body: #474747;
--text-muted: #676767;
--text-soft: #5e6073;
--text-tab-idle: #717171;
--text-placeholder: #9e9e9e;
--text-on-primary: #ffffff;
--text-on-dropdown: #17181c;
--text-error: #cc000b;
/* Strokes */
--stroke-input: rgba(0, 0, 0, 0.04);
--stroke-input-hover: rgba(0, 0, 0, 0.08);
--stroke-input-focus: rgba(0, 0, 0, 0.78);
--stroke-divider: #d9d9d9;
--opacity-divider: 0.3;
/* Primary action — 5 states from Figma 450:1512.
Default → Hover gets one shade lighter, Pressed gets two
shades lighter, Focused stays at Default with a 3px halo,
Disabled stays at Default with the label at 50% opacity. */
--primary-bg: #2d2d2d;
--primary-bg-hover: #4d4d4d;
--primary-bg-active: #5e5e5e;
--primary-text: #ffffff;
--primary-focus-ring: rgba(0, 0, 0, 0.3);
/* Iconography (uses currentColor so theme flips just work) */
--icon-strong: #1b1b1b;
/* Shadows — Figma "Light Mode/Shadow 25" */
--shadow-modal:
0 0 0 1px rgba(0, 0, 0, 0.06),
0 2px 6px 0 rgba(0, 0, 0, 0.05),
0 4px 42px 0 rgba(0, 0, 0, 0.06);
--shadow-primary:
0 1px 1px rgba(0, 0, 0, 0.2),
inset 0 -1px 1px rgba(0, 0, 0, 0.12);
/* Radii / sizes */
--radius-modal: 12px;
--radius-menu: 18px;
--radius-tab: 50px;
--radius-ghost: 8px;
--radius-button: 10px;
}
/* ──────────────────────────────────────────────────────────────
Transitions.dev — universal install. Drop-in semantic
tokens that every t-* snippet reads from. Sourced verbatim
from transitions-dev skill _root.css.
────────────────────────────────────────────────────────────── */
:root {
/* Card resize — sourced from the transitions-dev skill
(01-card-resize.md). Drives the modal-card growing /
shrinking when the error state toggles, plus the
absolutely-positioned children that slide to make room. */
--resize-dur: 300ms;
--resize-ease: cubic-bezier(0.22, 1, 0.36, 1);
/* Menu dropdown */
--dropdown-open-dur: 250ms;
--dropdown-close-dur: 150ms;
--dropdown-pre-scale: 0.97;
--dropdown-closing-scale: 0.99;
--dropdown-ease: cubic-bezier(0.22, 1, 0.36, 1);
/* Modal open / close */
--modal-open-dur: 250ms;
--modal-close-dur: 150ms;
--modal-scale: 0.96;
--modal-scale-close: 0.96;
--modal-ease: cubic-bezier(0.22, 1, 0.36, 1);
/* Page side-by-side */
--page-slide-dur: 200ms;
--page-fade-dur: 200ms;
--page-slide-distance: 8px;
--page-blur: 3px;
--page-stagger: 0ms;
--page-exit-enabled: 1;
--page-slide-ease: cubic-bezier(0.22, 1, 0.36, 1);
--page-fade-ease: cubic-bezier(0.22, 1, 0.36, 1);
/* Icon swap */
--icon-swap-dur: 200ms;
--icon-swap-blur: 2px;
--icon-swap-start-scale: 0.25;
--icon-swap-ease: ease-in-out;
/* Text states swap — synced to the published skill
(P6 defaults): 150ms duration, 4px travel, 2px blur,
ease-in-out. The shorter dur + smaller travel keep
the swap feeling crisp under the publish flow's
two-phase choreography (fade-blur exit, then text-swap
entry) without dragging the badge / check / button
entry beat. enter-delay is the gap (or overlap, if
negative) between the exit beat finishing and the entry
beat starting; 0 means the new content arrives the
instant the old has cleared. */
--text-swap-dur: 150ms;
--text-swap-enter-delay: 0ms;
--text-swap-translate-y: 4px;
--text-swap-blur: 2px;
--text-swap-ease: ease-in-out;
/* Success check */
--check-opacity-dur: 550ms;
--check-rotate-dur: 550ms;
--check-rotate-from: 80deg;
--check-bob-dur: 450ms;
--check-y-amount: 40px;
--check-blur-dur: 500ms;
--check-blur-from: 10px;
--check-path-dur: 550ms;
--check-path-delay: 80ms;
--check-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
--check-ease-opacity: cubic-bezier(0.22, 1, 0.36, 1);
--check-ease-rotate: cubic-bezier(0.22, 1, 0.36, 1);
--check-ease-bob: cubic-bezier(0.34, 1.35, 0.64, 1);
--check-ease-path: cubic-bezier(0.22, 1, 0.36, 1);
/* Avatar group hover */
--avatar-lift: -4px;
--avatar-dur: 320ms;
--avatar-scale: 1.05;
--avatar-falloff: 0.45;
--avatar-ease-in: cubic-bezier(0.22, 1, 0.36, 1);
--avatar-ease-out: cubic-bezier(0.34, 3.85, 0.64, 1);
/* Error state shake */
--shake-distance: 6px;
--shake-overshoot: 4px;
--shake-dur-a: 80ms;
--shake-dur-b: 60ms;
--shake-ease: cubic-bezier(0.22, 1, 0.36, 1);
--revert-hold: 3000ms;
--revert-dur: 280ms;
}
/* Dark mode — values traced from Figma node 450:1101 */
html[data-theme="dark"] {
--bg-page: #070707;
--bg-modal: #181818;
--bg-input: rgba(245, 245, 245, 0.04);
--bg-tab-active: rgba(245, 245, 245, 0.04);
--bg-ghost-hover: rgba(245, 245, 245, 0.06);
--bg-backdrop: rgba(0, 0, 0, 0.55);
--text-strong: #f7f7f7;
--text-body: #f7f7f7;
--text-muted: #888888;
--text-soft: #c6c6c6;
--text-tab-idle: #c6c6c6;
--text-placeholder: #9e9e9e;
--text-on-primary: #1b1b1b;
--text-on-dropdown: #f7f7f7;
--stroke-input: rgba(255, 255, 255, 0.04);
--stroke-input-hover: rgba(255, 255, 255, 0.08);
--stroke-input-focus: rgba(255, 255, 255, 0.8);
--stroke-divider: rgba(255, 255, 255, 0.1);
--opacity-divider: 1;
--primary-bg: #f7f7f7;
--primary-bg-hover: #d7d7d7;
--primary-bg-active: #c4c4c4;
--primary-text: #1b1b1b;
--primary-focus-ring: rgba(255, 255, 255, 0.3);
--icon-strong: #f7f7f7;
--shadow-modal:
0 1px 3px 0 rgba(0, 0, 0, 0.04),
0 0 0 1px rgba(0, 0, 0, 0.06),
0 2px 6px 0 rgba(0, 0, 0, 0.05),
0 4px 42px 0 rgba(0, 0, 0, 0.06),
inset 0 1px 0 rgba(255, 255, 255, 0.04),
inset 0 0 0 1px rgba(0, 0, 0, 0.06),
inset 0 -1px 0 rgba(0, 0, 0, 0.06),
inset 0 0 0 1px rgba(196, 196, 196, 0.1);
}
/* ──────────────────────────────────────────────────────────────
Base — antialiased text on every browser so 13/14px Inter
reads clean on macOS, Windows ClearType, and Firefox/X11.
────────────────────────────────────────────────────────────── */
html {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-smooth: always;
text-rendering: optimizeLegibility;
-webkit-text-size-adjust: 100%;
font-feature-settings: "cv11", "ss01";
}
*, *::before, *::after { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
background: var(--bg-page);
color: var(--text-strong);
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
Helvetica, Arial, sans-serif;
font-size: 13px;
line-height: 16px;
transition: background-color 200ms ease, color 200ms ease;
}
button {
font-family: inherit;
-webkit-font-smoothing: inherit;
-moz-osx-font-smoothing: inherit;
/* iOS Safari paints a gray/blue tap flash on controls inside
the embedded compare iframe. Clear it globally for buttons
so tab/copy/access taps feel native and don't blink. */
-webkit-tap-highlight-color: transparent;
}
input {
font-family: inherit;
-webkit-font-smoothing: inherit;
-moz-osx-font-smoothing: inherit;
}
/* Coarse pointers: avoid long-press callout / accidental
text-selection flashes on high-frequency tap targets in the
modal (tabs, copy, access). */
@media (hover: none) and (pointer: coarse) {
.tab-btn,
.copy-link-btn,
.access-btn {
-webkit-touch-callout: none;
user-select: none;
}
}
/* ──────────────────────────────────────────────────────────────
Embed mode — when the page is loaded inside an iframe with
?embed=1, drop the toolbar/backdrop, make the body
transparent, and let the modal sit naturally in the iframe's
flow so its container can size it.
────────────────────────────────────────────────────────────── */
body[data-embed="true"] {
background: transparent;
min-height: 0;
width: 100%;
overflow-x: hidden;
}
html[data-embed="true"] {
background: transparent;
}
html[data-embed="true"][data-theme="dark"] {
background: transparent;
color-scheme: dark;
}
html[data-embed="true"][data-theme="dark"] body[data-embed="true"] {
background: transparent;
}
body[data-embed="true"] .toolbar { display: none; }
body[data-embed="true"] .modal-backdrop { display: none; }
body[data-embed="true"] .modal-root {
position: relative;
inset: auto;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: 100vh;
padding: 24px 16px;
box-sizing: border-box;
overflow: visible;
}
body[data-embed="true"] .modal-card {
position: relative;
left: auto;
top: auto;
transform: none;
/* Fluid width inside the 16px-padded root — caps at the
340px canvas instead of scaling the whole UI down. */
width: 100%;
max-width: 340px;
height: auto;
min-height: 389px;
}
body[data-embed="true"] .modal-card[data-error="true"] {
height: auto;
min-height: 411px;
}
body[data-embed="true"] .page-stage.t-page-slide {
min-height: 389px;
/* Share the card's resize tween — the stage is absolute-inset
inside the modal-card, so without this min-height change
the inner content area snaps to its new height even though
the card itself is animating. */
transition: min-height var(--resize-dur) var(--resize-ease);
}
body[data-embed="true"] .modal-card[data-error="true"] .page-stage.t-page-slide {
min-height: 411px;
}
/* Share row — input grows, Invite pins to the right edge. */
body[data-embed="true"] .invite-field-wrap {
right: 109px; /* 81px button + 12px gap + 16px inset */
width: auto;
}
body[data-embed="true"] .state-share > .primary-btn {
left: auto;
right: 16px;
}
body[data-embed="true"] .member-list,
body[data-embed="true"] .general-row {
right: 16px;
width: auto;
}
body[data-embed="true"] .member-main {
min-width: 0;
}
body[data-embed="true"] .member-text {
min-width: 0;
}
body[data-embed="true"] .member-name,
body[data-embed="true"] .member-mail {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Publish tab — hero block stays centred but can shrink. */
body[data-embed="true"] .publish-center {
width: min(280px, calc(100% - 32px));
}
body[data-embed="true"] .publish-copy {
width: auto;
max-width: 280px;
}
/* Narrow embed viewports: the card is width:100%, so raising
max-width alone does nothing — the modal-root's 16px side
padding is what caps the rendered width. Shave 15px per side
(+30px total) so the card actually grows on mobile. */
@media (max-width: 760px) {
body[data-embed="true"] .modal-root {
padding-left: 1px;
padding-right: 1px;
}
body[data-embed="true"] .modal-card {
max-width: 370px;
}
}
/* "Generic AI output" style — strip all of the calibrated
motion (icon swap, text swap, modal open, success check,
error shake, …) so they snap, then RE-ADD three transitions
(dropdown, page slide, avatar group hover) using the kind of
timing a generic AI tends to produce: slow, plain `ease`,
and an over-aggressive 85% start scale on the dropdown.
This is the contrast the side-by-side compare toggle is
designed to surface — the "Generic" pane has motion, but
motion that reads as off-the-shelf rather than crafted. */
body[data-style="generic"] *,
body[data-style="generic"] *::before,
body[data-style="generic"] *::after {
transition: none !important;
animation: none !important;
}
/* The fade-in classes we use elsewhere rely on opacity easing;
without the transition, force the end state so the element
isn't stuck invisible. */
body[data-style="generic"] .t-input-wrap.is-error .error-msg,
body[data-style="generic"] .error-msg[data-show="true"] {
opacity: 1;
visibility: visible;
}
body[data-style="generic"] .error-msg:not([data-show="true"]) {
opacity: 0;
visibility: hidden;
}
/* ── Generic-mode "amateurish" transitions ────────────────
The blanket kill above turned everything off; this block
turns three things back on, but with the deliberately
under-tuned values a generic AI tends to emit:
• dropdown: 85% pre-scale + plain `ease` + 205ms
• page slide: same slide+fade+blur shape as skill mode,
but with a chunky 30px distance, 300ms,
and plain `ease` — so the swap is
perceptibly slower and the slide reads as
a sluggish drag instead of a precise glide
• avatar: scale-only on hover (no Y lift, no falloff
polish), 1.2× chunky scale, plain `ease` + 100ms
Wrapped in prefers-reduced-motion: no-preference so a user
who has reduced-motion enabled still gets the snap-instant
behaviour from the kill rule above. */
@media (prefers-reduced-motion: no-preference) {
/* Dropdown — 85% start scale is intentionally too small;
it pops noticeably instead of feeling locked to the
trigger. The matching close uses the same scale so the
dropdown collapses awkwardly back into nothing. */
body[data-style="generic"] .t-dropdown {
transform: scale(0.85) !important;
opacity: 0 !important;
transition:
transform 205ms ease,
opacity 205ms ease !important;
}
body[data-style="generic"] .t-dropdown.is-open {
transform: scale(1) !important;
opacity: 1 !important;
}
body[data-style="generic"] .t-dropdown.is-closing {
transform: scale(0.85) !important;
opacity: 0 !important;
}
/* Page transition — same slide+fade+blur shape as skill
mode (P8), but the knobs are turned to obviously generic
values: distance 30px (4× skill's 8px) so the slide is
a chunky drag rather than a subtle nudge, duration 300ms
(1.5× skill's 200ms), easing plain `ease`. We override
the CSS variables on the body so the existing
.t-page-slide .t-page rule recomputes its translateX /
blur / transitions automatically; the explicit
`transition` override is needed only to defeat the
blanket `transition: none !important` reset above. */
body[data-style="generic"] {
--page-slide-distance: 30px;
--page-slide-dur: 300ms;
--page-fade-dur: 300ms;
--page-slide-ease: ease;
--page-fade-ease: ease;
}
body[data-style="generic"] .t-page-slide .t-page {
transition:
opacity var(--page-fade-dur) var(--page-fade-ease),
transform var(--page-slide-dur) var(--page-slide-ease),
filter var(--page-slide-dur) var(--page-slide-ease) !important;
}
/* Avatar group hover — kill the Y lift entirely and let the
hovered avatar grow by a chunky +20%. JS reads --avatar-lift
and --avatar-scale via computed style, so overriding the
CSS variables is enough; lift=0 makes every neighbor's
--shift compute to 0px (no position movement) and scale=1.2
flows through to the hovered avatar's --scale-active. The
non-hovered siblings still receive scale(1) from JS, so
only the active one resizes. */
body[data-style="generic"] {
--avatar-lift: 0px;
--avatar-scale: 1.2;
}
body[data-style="generic"] .t-avatar {
transition: transform 100ms ease !important;
}
}
/* Small toolbar so the demo is interactive */
.toolbar {
position: fixed;
top: 16px;
right: 16px;
display: flex;
gap: 8px;
z-index: 40;
}
.tool-btn {
height: 34px;
padding: 0 12px;
border-radius: 10px;
background: var(--bg-modal);
border: 1px solid var(--stroke-input-hover);
color: var(--text-strong);
font-weight: 500;
font-size: 13px;
line-height: 16px;
cursor: pointer;
box-shadow: var(--shadow-modal);
}
/* ──────────────────────────────────────────────────────────────
Compare stage (standalone non-embed view). Renders BOTH the
generic and the skill-driven motion in two iframes side-by-side
so the standalone /example.html page shows both at once — no
toggle needed. The standalone modal + toolbar are hidden in
non-embed mode so this stage owns the layout. In embed mode
(when example.html is loaded inside skill.html's compare iframe)
this stage stays hidden and the modal renders directly.
────────────────────────────────────────────────────────────── */
.compare-stage {
display: none;
width: 100%;
max-width: 1100px;
margin: 0 auto;
padding: 64px 24px;
gap: 24px;
flex-direction: row;
justify-content: center;
align-items: stretch;
flex-wrap: wrap;
box-sizing: border-box;
}
body:not([data-embed="true"]) .compare-stage { display: flex; }
body:not([data-embed="true"]) .modal-root,
body:not([data-embed="true"]) #accessMenuShell { display: none !important; }
/* Standalone compare view has no on-page modal — only the dark-
mode toggle is meaningful. Hide "Open modal" so the toolbar
doesn't offer a dead-end action. */
body:not([data-embed="true"]) #reopenModal { display: none; }
.compare-pane {
flex: 1 1 360px;
min-width: 0;
max-width: 540px;
display: flex;
flex-direction: column;
align-items: center;
gap: 14px;
}
.compare-pane-heading {
display: inline-flex;
align-items: center;
gap: 6px;
}
/* Figma 450:547 / 459:1516–459:1518 — 20px status badge with
outer elevation + inset bezel, red (generic) or green (skill). */
.compare-pane-badge {
width: 20px;
height: 20px;
border-radius: 20px;
flex: 0 0 20px;
display: inline-grid;
place-items: center;
box-shadow:
0 1px 1px rgba(0, 0, 0, 0.1),
0 1px 4px rgba(0, 0, 0, 0.08),
inset 0 0 0 1px rgba(0, 0, 0, 0.05),
inset 0 -1px 1px rgba(0, 0, 0, 0.09);
}
.compare-pane-badge--off { background: #f03434; }
.compare-pane-badge--on { background: #35ba00; }
.compare-pane-badge svg {
display: block;
width: 10px;
height: 10px;
}
.compare-pane-label {
font-weight: 500;
font-size: 14px;
line-height: 14px;
color: #232323;
letter-spacing: 0;
}
html[data-theme="dark"] .compare-pane-label { color: #ededed; }
.compare-pane-iframe {
display: block;
width: 100%;
height: 460px;
border: 0;
border-radius: 14px;
background: #f9f9f9;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
html[data-theme="dark"] .compare-pane-iframe {
background: #181818;
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
/* Narrow viewports — stack the two panes. */
@media (max-width: 760px) {
.compare-stage { flex-direction: column; align-items: stretch; padding: 32px 16px; }
.compare-pane { max-width: 100%; }
}
/* ──────────────────────────────────────────────────────────────
Modal — 340 × 389, rounded 12, Figma drop-shadow stack.
────────────────────────────────────────────────────────────── */
.modal-root {
position: fixed;
inset: 0;
display: none;
z-index: 20;
}
.modal-root[data-open="true"] { display: block; }
.modal-backdrop {
position: absolute;
inset: 0;
background: var(--bg-backdrop);
}
.modal-card {
position: absolute;
width: 340px;
height: 389px;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: var(--bg-modal);
border-radius: var(--radius-modal);
box-shadow: var(--shadow-modal);
overflow: hidden;
color: var(--text-strong);
/* Skill mode card resize. Tween both `height` (canvas mode)
and `min-height` (embed mode) so the iframe pane animates
the same as the standalone modal — embed mode runs on
height:auto so the height property never changes there. */
transition:
height var(--resize-dur) var(--resize-ease),
min-height var(--resize-dur) var(--resize-ease);
will-change: height, min-height;
}
/* Error state: grow the modal by 22px so the validation copy
gets its own space, and push every absolutely-positioned
block below the input down by the same amount. */
.modal-card[data-error="true"] { height: 411px; }
.modal-card[data-error="true"] .member-list { top: 158px; }
.modal-card[data-error="true"] .general-label { top: 329px; }
.modal-card[data-error="true"] .general-row { top: 360px; }
/* ── Top row: tab + copy link ─────────────────────────────────
Tabs container at (16, 16). Copy link button at (313, 18). */
.tabs {
position: absolute;
left: 16px;
top: 16px;
display: inline-flex;
align-items: center;
gap: 4px;
z-index: 3;
}
.tab-btn {
height: 36px;
padding: 0 16px;
border: 0;
background: transparent;
border-radius: var(--radius-tab);
font-weight: 500;
font-size: 14px;
line-height: 16px;
color: var(--text-tab-idle);
cursor: pointer;
transition: background-color 120ms ease, color 120ms ease;
}
.tab-btn:hover {
background: var(--bg-ghost-hover);
color: var(--text-strong);
}
.tab-btn[aria-selected="true"] {
background: var(--bg-tab-active);
color: var(--text-strong);
}
.copy-link-btn {
position: absolute;
top: 18px;
right: 16px;
display: inline-flex;
align-items: center;
gap: 6px;
height: 32px;
padding: 0 8px;
border: 0;
border-radius: var(--radius-ghost);
background: transparent;
color: var(--text-strong);
font-weight: 500;
font-size: 13px;
line-height: 16px;
cursor: pointer;
z-index: 3;
}
.copy-link-btn:hover { background: var(--bg-ghost-hover); }
/* Width-pinned slot for the t-text-swap label. The ::before
ghost text always reads "Copy link" (the widest state) and
reserves the slot's layout box, so when the swap morphs to
the shorter "Copied" the slot doesn't collapse and the
button — anchored right:16px — doesn't push the icon
sideways. The visible t-text-swap is absolutely positioned
on top of the ghost, left-aligned, so its transform-based
enter/exit animation still plays without affecting layout. */
.copy-text-slot {
position: relative;
display: inline-block;
line-height: 16px;
}
.copy-text-slot::before {
content: 'Copy link';
display: inline-block;
visibility: hidden;
white-space: nowrap;
}
.copy-text-slot .t-text-swap {
position: absolute;
top: 0;
left: 0;
right: 0;
text-align: left;
white-space: nowrap;
}
/* Generic icon slot — fixed 16×16 box with the SVG centered.
Without this, inline SVG sits on the text baseline and looks
a couple of pixels too high relative to flex-centered text. */
.icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 16px;
height: 16px;
flex: 0 0 16px;
line-height: 0;
}
.icon svg { display: block; }
.copy-link-btn .icon,
.access-btn .icon,
.error-msg .icon { color: currentColor; }
/* Soften the chevron + copy/check icons so the label reads as
the primary surface — Figma uses ~70% icon opacity on these
ghost controls, and using opacity (not a baked rgba) lets the
icons inherit currentColor for both themes. */
.copy-link-btn .icon,
.access-btn .icon-chevron { opacity: 0.7; }
/* Divider directly under top row, modal-wide. */
.modal-divider {
position: absolute;
left: 0;
right: 0;
top: 68px;
height: 1px;
background: var(--stroke-divider);
opacity: var(--opacity-divider);
}
/* Per-state panels. Stacked inside .page-stage; visibility is
driven by the .t-page-slide[data-page] selectors so the page
transition snippet owns the show/hide motion. */
/* The dual-class selector .page-stage.t-page-slide beats the
snippet's .t-page-slide { position: relative } on specificity
so the stage can actually fill the modal-card. Without this
override the relative wrapper collapses to 0×0 (its children
are all position:absolute), pulling every page's content to
the top-left corner. */
.page-stage.t-page-slide {
position: absolute;
inset: 0;
z-index: 1;
}
.state {
position: absolute;
inset: 0;
}
/* ── Share state ──────────────────────────────────────────────
Input at (16, 85) w215 h36. Invite at (243, 85) w81 h36.
Member list at (16, 136) w308, gap 16. */
.invite-field-wrap {
position: absolute;
left: 16px;
top: 85px;
width: 215px;
}
.invite-field {
display: flex;
align-items: center;
justify-content: space-between;
height: 36px;
padding: 0 8px;
background: var(--bg-input);
border: 1px solid var(--stroke-input);
border-radius: var(--radius-button);
/* Use an inset box-shadow for the thicker focus/error stroke
so padding stays put and content doesn't shift. */
transition: border-color 120ms ease, box-shadow 120ms ease;
}
.invite-field:hover { border-color: var(--stroke-input-hover); }
.invite-field:focus-within {
border-color: var(--stroke-input-focus);
box-shadow: inset 0 0 0 0.5px var(--stroke-input-focus);
}
.invite-field.is-error {
border-color: var(--text-error);
box-shadow: inset 0 0 0 0.5px var(--text-error);
}
.invite-field input {
flex: 1;
min-width: 0;
border: 0;
outline: 0;
background: transparent;
color: var(--text-strong);
font-weight: 400;
font-size: 13px;
line-height: 22px;
}
.invite-field input::placeholder {
color: var(--text-placeholder);
opacity: 1;
}
.field-right { display: inline-flex; align-items: center; }
/* Error message floats absolutely beneath the input so the wrap
keeps its 36px footprint at rest — the modal-card resize +
member-list shift create space for it on error. Visibility +
opacity tween is owned by t-error-msg (P12). */
.error-msg {
position: absolute;
left: 0;
top: 42px;
display: inline-flex;
align-items: center;
gap: 6px;
color: var(--text-error);
font-weight: 500;
font-size: 11px;
line-height: 14px;
opacity: 0;
visibility: hidden;
transition:
opacity var(--revert-dur, 280ms) ease-out,
visibility 0s linear var(--revert-dur, 280ms);
}
.t-input-wrap.is-error .error-msg,
.error-msg[data-show="true"] {
opacity: 1;
visibility: visible;
transition:
opacity var(--revert-dur, 280ms) ease-out,
visibility 0s linear 0s;
}
.primary-btn {
position: absolute;
left: 243px;
top: 85px;
width: 81px;
height: 36px;
border: 0;
border-radius: var(--radius-button);
background: var(--primary-bg);
color: var(--primary-text);
font-weight: 500;
font-size: 13px;
line-height: 16px;
box-shadow: var(--shadow-primary);
cursor: pointer;
/* Suppress the browser's default focus outline on click —
Figma 450:1509 specifies a translucent gray ring that we
paint via box-shadow on :focus-visible (keyboard) below.
Click-focus shows just the hover/active surface, matching
the Figma "Pressed" frame which has no surrounding ring. */
outline: none;
-webkit-tap-highlight-color: transparent;
transition:
background-color 120ms ease,
box-shadow 120ms ease,
transform 120ms ease;
}
/* Figma 450:1507 — Hover lifts the surface to #4d4d4d (a
distinct +32 lightness jump from the resting #2d2d2d) so
the change reads at a glance instead of merely tinting. */
.primary-btn:hover {
background: var(--primary-bg-hover);
}
/* Figma 450:1508 — Pressed deepens the highlight to #5e5e5e
and adds an inset 1px shadow + 0.5px nudge so the pill
feels seated under the cursor. */
.primary-btn:active {
background: var(--primary-bg-active);
box-shadow:
0 1px 1px rgba(0, 0, 0, 0.16),
inset 0 1px 1px rgba(0, 0, 0, 0.14);
transform: translateY(0.5px);
}
/* Figma 450:1509 — focused state keeps the resting fill and
adds a 3px translucent halo around the pill. Box-shadow
spread is used (instead of an outline) so the halo blends
cleanly with the existing drop shadow. Only fires on
keyboard focus to avoid noise on mouse clicks. */
.primary-btn:focus-visible {
box-shadow:
0 0 0 3px var(--primary-focus-ring),
var(--shadow-primary);
}
/* Figma 450:1510 — disabled keeps the dark surface; only the
label is dimmed to 50% opacity. We achieve this with a
color-mix on the text (instead of opacity on the whole
button) so the surface stays fully opaque. Hover/active are
suppressed so the button can't appear to react to pointer
events while it's unavailable. */
.primary-btn:disabled,
.primary-btn[aria-disabled="true"] {
cursor: not-allowed;
color: color-mix(in srgb, var(--primary-text) 50%, transparent);
}
.primary-btn:disabled:hover,
.primary-btn[aria-disabled="true"]:hover {
background: var(--primary-bg);
}
.primary-btn:disabled:active,
.primary-btn[aria-disabled="true"]:active {
background: var(--primary-bg);
box-shadow: var(--shadow-primary);
transform: none;
}
.member-list {
position: absolute;
left: 16px;
top: 136px;
width: 308px;
margin: 0;
padding: 0;
list-style: none;
display: flex;
flex-direction: column;
gap: 16px;
/* Sync with .modal-card so the rows slide down in the same
beat as the card grows. Same tokens (--resize-*) keep all
three children locked to the card's resize tween. */
transition: top var(--resize-dur) var(--resize-ease);
}
.member-row {
display: flex;
align-items: center;
justify-content: space-between;
}
.member-main {
display: inline-flex;
align-items: center;
gap: 9px;
}
.avatar {
width: 32px;
height: 32px;
border-radius: 50%;
object-fit: cover;
display: block;
background: rgba(0, 0, 0, 0.06);
}
.member-text {
display: flex;
flex-direction: column;
gap: 2px;
}
.member-name {
font-weight: 500;
font-size: 13px;
line-height: 16px;
color: var(--text-body);
}
.member-mail {
font-weight: 400;
font-size: 13px;
line-height: 16px;
color: var(--text-muted);
}
html[data-theme="dark"] .member-name { color: var(--text-strong); }
/* Figma 450:693 — 32px tall, asymmetric padding (8px left for
the label, 6px right for the chevron), gap 6, radius 8. The