forked from Jakubantalik/transitions.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprototypes.html
More file actions
4030 lines (3800 loc) · 165 KB
/
Copy pathprototypes.html
File metadata and controls
4030 lines (3800 loc) · 165 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>Prototypes</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=Inter:wght@400;500&family=Roboto+Mono:wght@500&display=swap"
rel="stylesheet"
/>
<style>
:root {
--bg: #fdfdfd;
--text: #0d0d0d;
--btn-base: #bfc0cb;
--btn-overlay: rgba(243, 243, 243, 0.9);
--btn-text: #17181c;
--skeleton: #eeeeef;
--modal-bg: #ffffff;
--muted: #5e6773;
--token-light: #f4f4f4;
--shadow:
0 0 0 1px rgba(0, 0, 0, 0.06),
0 2px 6px rgba(0, 0, 0, 0.05),
0 4px 42px rgba(0, 0, 0, 0.06);
--r-btn: 40px;
--r-card: 12px;
--font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
Roboto, Helvetica, Arial, sans-serif;
--font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
Consolas, monospace;
/* ========================================================== */
/* Prototype transition knobs (read by the control panel) */
/* ========================================================== */
/* P1 — Notification badge */
--p1-pos-open-dur: 260ms;
--p1-scale-open-dur: 500ms;
--p1-scale-close-dur: 180ms;
--p1-opacity-open-dur: 400ms;
--p1-opacity-close-dur: 180ms;
--p1-blur: 2px;
--p1-distance-x: -8.2px;
--p1-distance-y: 12.4px;
--p1-bounce: 1.36;
--p1-ease-pos-open: cubic-bezier(0.22, 1, 0.36, 1);
--p1-ease-scale-open: cubic-bezier(0.34, 1.36, 0.64, 1);
--p1-ease-close: cubic-bezier(0.4, 0, 0.2, 1);
/* P2 — Dropdown.
`--p2-origin` is the scale transform-origin. The transition is
origin-aware: the anchor point should sit where the trigger is
(e.g. "top center" when the trigger button is above the menu,
"top right" when it opens from a right-aligned button, etc.). */
--p2-open-dur: 250ms;
--p2-close-dur: 150ms;
--p2-pre-scale: 0.97;
--p2-closing-scale: 0.99;
--p2-origin: top center;
--p2-ease: cubic-bezier(0.22, 1, 0.36, 1);
/* P3 — Panel (Figma 213:1375 "Dropdown", 296×187) */
--p3-open-dur: 400ms;
--p3-close-dur: 350ms;
--p3-panel-height: 187px;
/* Movement trajectory = 50% of the panel height. The panel
also fades opacity 0 ↔ 1 AND cross-blurs 2px ↔ 0 over the
same timing, so the shortened travel still reads as a full
open / close. */
--p3-translate-y: calc(var(--p3-panel-height) * 0.5);
--p3-blur: 2px;
/* Gutter inside the clip so box-shadow is not clipped by overflow:hidden */
--p3-clip-pad: 14px;
--p3-open-lift: 30px;
--p3-ease: cubic-bezier(0.22, 1, 0.36, 1);
--p3-surface-bg: #ffffff;
--p3-surface-shadow:
0 0 0 1px rgba(0, 0, 0, 0.06),
0 2px 6px rgba(0, 0, 0, 0.05),
0 4px 42px rgba(0, 0, 0, 0.06);
/* P4 — Card resize */
--p4-dur: 300ms;
--p4-ease: cubic-bezier(0.22, 1, 0.36, 1);
/* P5 — Hamburger ↔ Close */
--p5-dur: 200ms;
--p5-blur: 2px;
--p5-start-scale: 0.25;
--p5-ease: ease-in-out;
/* P6 — Text enter/exit */
--p6-dur: 150ms;
--p6-translate-y: 4px;
--p6-blur: 2px;
--p6-ease: ease-in-out;
/* Offset between the exit phase finishing and the enter phase
starting. 0 = back-to-back (old default). Positive values add
a gap so the stage briefly sits empty. Negative values pull
the enter earlier so it cross-fades with the exit. */
--p6-enter-delay: 0ms;
/* P7 — Modal open/close (scale + opacity, Figma skeleton 261×172) */
--p7-open-dur: 250ms;
--p7-close-dur: 150ms;
--p7-scale: 0.96;
--p7-scale-close: 0.96;
--p7-ease: cubic-bezier(0.22, 1, 0.36, 1);
--p7-shadow:
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);
/* P8 — Page slide */
--p8-slide-dur: 200ms;
--p8-fade-dur: 200ms;
--p8-distance: 8px;
--p8-blur: 3px;
--p8-stagger: 0ms;
/* Exit animation multiplier (1 = slide+blur the outgoing page,
0 = fade it out in place). */
--p8-exit-enabled: 1;
--p8-slide-ease: cubic-bezier(0.22, 1, 0.36, 1);
--p8-fade-ease: cubic-bezier(0.22, 1, 0.36, 1);
/* P9 — Number pop-in */
--p9-dur: 500ms;
--p9-distance: 8px;
--p9-stagger: 70ms;
--p9-blur: 2px;
--p9-bounce: 1.45;
--p9-ease: cubic-bezier(0.34, 1.45, 0.64, 1);
/* Direction multipliers: where each digit starts relative to its
final resting position. (0, 1) = rises from below (default).
The keyframe multiplies --p9-distance by these, so flipping a
sign changes the starting corner instantly. */
--p9-dir-x: 0;
--p9-dir-y: 1;
/* P10 — Success check (appear/disappear) */
--p10-opacity-dur: 550ms;
--p10-rotate-dur: 550ms;
--p10-rotate-from: 80deg;
/* Bob is a single Y rise from --p10-y-amount below rest up
to rest, using --p10-ease-bob to add overshoot via a
subtle-bounce cubic-bezier (the cubic itself produces the
"lands and settles" feel — no manual keyframe overshoot). */
--p10-bob-dur: 450ms;
--p10-y-amount: 40px;
--p10-blur-dur: 500ms;
--p10-blur-from: 10px;
/* Exit uses its own (softer) blur amount so the disappearance
reads as a gentle fade rather than a full reverse of entry. */
--p10-blur-out-from: 4px;
--p10-path-dur: 550ms;
--p10-path-delay: 80ms;
--p10-out-dur: 500ms;
--p10-ease-out: cubic-bezier(0.22, 1, 0.36, 1); /* exit + entry blur */
--p10-ease-opacity: cubic-bezier(0.22, 1, 0.36, 1);
--p10-ease-rotate: cubic-bezier(0.22, 1, 0.36, 1);
--p10-ease-bob: cubic-bezier(0.34, 1.35, 0.64, 1); /* subtle overshoot via the curve, not via keyframes */
--p10-ease-path: cubic-bezier(0.22, 1, 0.36, 1); /* SVG check stroke-draw */
/* P11 — Avatar group hover spring.
Each neighbor at distance d from the hovered avatar lifts by
--p11-lift * pow(--p11-falloff, d). Falloff between 0 and 1
controls how quickly the spring effect drops off — 0 = only
the hovered avatar moves, 1 = every avatar moves the full
amount. The default ease is a subtle-overshoot bezier so
the lift "pops" a hair past --p11-lift before settling, and
the rest "pops" a hair past 0 on the way back — that tiny
overshoot is the spring read in the design. */
--p11-lift: -4px;
--p11-dur: 320ms;
/* Direction-aware easing: lifting toward the hover state uses
a clean ease (no overshoot — feels intentional and locked
in), while returning to rest uses an overshoot ease so the
group "settles" with a gentle spring. JS swaps the
transition-timing-function per phase before each shift
write so a single transition-property handles both. */
--p11-ease-in: cubic-bezier(0.22, 1, 0.36, 1);
--p11-ease-out: cubic-bezier(0.34, 3.85, 0.64, 1);
/* --p11-bounce drives the Y of the second cubic-bezier control
point on --p11-ease-out (the return-to-rest ease). The CP
"Bounce" knob rewrites --p11-ease-out via the template
`cubic-bezier(0.34, {bounce}, 0.64, 1)`:
1.0 → no overshoot (settles flat)
~1.35 → subtle bounce
3.8+ → very pronounced overshoot on return. */
--p11-bounce: 3.85;
/* Scale applied to the avatar that is directly hovered. Set
to 1 to disable. Non-hovered avatars stay at their natural
size and only translate. */
--p11-scale: 1.05;
--p11-falloff: 0.45;
/* P12 — Input shake on error.
Four-phase translateX with a per-segment cubic-bezier so each
leg of the wobble matches the Figma curve exactly. Total dur
is 80 + 80 + 60 + 60 = 280ms. After the shake we hold the
error state for --p12-revert-hold then fade back to neutral
over --p12-revert-dur, so the demo self-resets without the
user needing to type. */
--p12-shake-distance: 6px;
--p12-shake-overshoot: 4px;
--p12-shake-dur-a: 80ms;
--p12-shake-dur-b: 60ms;
--p12-shake-ease: cubic-bezier(0.22, 1, 0.36, 1);
--p12-error-border: #e23014;
--p12-error-text: #d62b11;
--p12-revert-hold: 3000ms;
--p12-revert-dur: 280ms;
/* P13 — Functional input field with clear transition.
Monochrome port of /Users/jakub/Dropbox/Work 2023+/cursor/ease/
border-beam/AI seach.html. The clear effect builds a per-word
radial-gradient streak under the text (greyscale-only — no
rainbow) and then translates the rendered text DOWN with blur
+ opacity fade while the placeholder falls in from above with
the mirror math (both elements travel downward together, just
like the source template). --p13-text-out-dur / --p13-text-in-dur
and matching fly + ease vars drive the cleared text exit and
placeholder entrance independently. --p13-clear-dur is the outer
envelope (covers the glow's fade-in/out tail). */
--p13-clear-dur: 1000ms;
--p13-text-out-dur: 400ms;
--p13-text-in-dur: 400ms;
--p13-text-out-fly: 12px;
--p13-text-in-fly: 12px;
--p13-text-out-ease: cubic-bezier(0.22, 1, 0.36, 1);
--p13-text-in-ease: cubic-bezier(0.22, 1, 0.36, 1);
--p13-blur: 2px;
/* --p13-glow-delay holds the per-word streak completely
invisible for the first N ms so the text begins falling
on its own and only then does the streak ignite. */
--p13-glow-delay: 50ms;
--p13-glow-peak-at: 0.15;
--p13-glow-opacity: 0.42;
--p13-glow-spread: 1.5;
/* P14 — Skeleton loader → user row reveal.
The skeleton pulses at --p14-pulse-dur for --p14-pulse-count
iterations, drops to --p14-pulse-min mid-cycle, then on
animationend the wrapper flips to the revealed state and the
real content fades + un-blurs over --p14-reveal-dur. */
--p14-pulse-dur: 1000ms;
--p14-pulse-count: 1;
--p14-pulse-min: 0.5;
--p14-reveal-dur: 400ms;
--p14-reveal-blur: 2px;
--p14-reveal-ease: ease-in-out;
--p14-skeleton-color: #eeeeee;
/* P15 — Beautiful shimmer on text.
Continuous sweep masked into the glyphs via background-clip:
text. --p15-band controls the highlight's width as a
percentage of the text — wider band reads as a softer,
slower-feeling sweep at the same duration. --p15-ease drives
the per-cycle pacing; linear feels mechanical, smooth-out
eases each pass into rest at the end. */
--p15-dur: 2000ms;
--p15-base: #7c7c7c;
--p15-highlight: #0d0d0d;
--p15-band: 400%;
--p15-ease: linear;
/* P16 — Tabs with sliding active indicator.
Per Figma: 36px outer pill on #eee, 30px-tall inner tabs
with 12px×4px padding, 13px Inter Medium. The active tab
is a white pill that slides + resizes via inline transform/
width writes from JS. Inactive tabs carry a 1px #efefef
outline so the segmented look reads on the gray bar even
while the white indicator is mid-flight. */
--p16-dur: 200ms;
--p16-ease: cubic-bezier(0.22, 1, 0.36, 1);
--p16-text-muted: rgba(15, 15, 15, 0.8);
--p16-text-active: #0f0f0f;
--p16-bar-bg: #eeeeee;
--p16-pill-bg: #ffffff;
--p16-inactive-border: #efefef;
/* P17 — Tooltip with appear-only delay.
"Hover me" button trigger; the 50ms delay is set ONLY in
the :hover/:focus rule, so leaving the trigger snaps the
delay back to 0 and the fade-out plays immediately.
Pure CSS — no JS. */
--p17-in-dur: 150ms;
--p17-out-dur: 50ms;
--p17-scale-from: 0.98;
--p17-delay: 80ms;
--p17-in-ease: ease-out;
--p17-out-ease: ease-out;
--p17-bg: #ffffff;
--p17-fg: #17181c;
/* P18 — Primary + secondary text appear with stagger.
Both lines rise from --p18-distance with --p18-dur; the
secondary line is held back by --p18-stagger so the eye
locks onto the primary first. */
--p18-dur: 600ms;
--p18-distance: 12px;
--p18-stagger: 40ms;
--p18-blur: 3px;
--p18-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
}
body {
background: var(--bg);
color: var(--text);
font-family: var(--font-sans);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
min-height: 100vh;
}
main.grid {
max-width: 1200px;
margin: 0 auto;
padding: 64px 24px 120px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 48px 24px;
}
.proto-card {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
}
.proto-label {
font-family: var(--font-mono);
font-weight: 500;
font-size: 15px;
line-height: 13px;
color: var(--text);
opacity: 0.5;
margin: 0 0 8px;
align-self: center;
}
.stage {
width: 100%;
min-height: 300px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 24px;
position: relative;
}
/* Shared button */
.btn {
appearance: none;
border: 0;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
height: 36px;
padding: 6px 12px;
border-radius: var(--r-btn);
font-family: var(--font-sans);
font-weight: 500;
font-size: 13px;
line-height: 16px;
color: var(--btn-text);
background-color: var(--btn-base);
background-image: linear-gradient(
90deg,
var(--btn-overlay) 0%,
var(--btn-overlay) 100%
);
white-space: nowrap;
user-select: none;
-webkit-tap-highlight-color: transparent;
transition: filter 120ms ease;
}
.btn:hover {
filter: brightness(0.98);
}
.btn:active {
filter: brightness(0.95);
}
.btn:focus-visible {
outline: 2px solid #17181c;
outline-offset: 2px;
}
/* Shared card surface */
.surface {
background: var(--modal-bg);
border-radius: var(--r-card);
box-shadow: var(--shadow);
overflow: hidden;
}
.skeleton {
background: var(--skeleton);
border-radius: 4px;
}
/* ============================================================ */
/* Prototype 1 — Notification badge open ↔ close */
/* ============================================================ */
.p1-stage {
gap: 50px;
}
/* Bell button (Button/Medium/Secondary/Icon only) */
.bell-btn {
position: relative;
width: 40px;
height: 40px;
border-radius: 40px;
background: #ffffff;
box-shadow:
0 1px 0 0 rgba(0, 0, 0, 0.04),
0 0 0 1px rgba(0, 0, 0, 0.04),
0 2px 3px 0 rgba(0, 0, 0, 0.04);
display: inline-flex;
align-items: center;
justify-content: center;
}
.bell-btn .bell-icon {
width: 18px;
height: 18px;
display: block;
pointer-events: none;
user-select: none;
}
/* Notification badge.
Two-part structure so we can run two independent timing curves:
• outer (.bell-badge) → translate (diagonal slide)
• inner (.bell-badge-inner) → scale (springy pop-in) + opacity + blur
The badge slides on a 4px diagonal trajectory along the vector from
the button's center toward the badge's resting position. Resting
position center relative to the button's center gives a diagonal
unit vector (-0.8, +0.6). Scaled to 4px = (-3.2px, +2.4px). The
inner scales around its own center, so the visible travel equals
exactly the 4px translate (no extra "unfold" contribution from the
scale). A 2px blur fades in on close / out on open for a subtle
haze on the motion. */
.bell-badge {
position: absolute;
top: -6px;
right: -8px;
width: 20px;
height: 20px;
pointer-events: none;
/* Transform is driven by a one-shot keyframe animation that fires
only when the badge opens (see rule below). On close there is
no transform change, so the badge does not move out — it just
scales/fades via the inner element. */
will-change: transform;
}
/* Open-only slide: 4px diagonal translate from the button's center
back to the badge's resting position. Runs every time the button
enters the "open" state. */
.bell-btn[data-badge-open="true"] .bell-badge {
animation: p1-badge-slide-in var(--p1-pos-open-dur) var(--p1-ease-pos-open);
}
@keyframes p1-badge-slide-in {
0% { transform: translate(var(--p1-distance-x), var(--p1-distance-y)); }
100% { transform: translate(0, 0); }
}
.bell-badge-inner {
display: flex;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
border-radius: 50%;
background-image: linear-gradient(
-51.52deg,
rgb(238, 41, 51) 13.929%,
rgb(236, 2, 72) 112.7%
);
color: #ffffff;
font-family: var(--font-sans);
font-weight: 500;
font-size: 11.744px;
line-height: 1;
letter-spacing: -0.1174px;
box-shadow:
0 0.338px 1.351px 0 rgba(0, 0, 0, 0.17),
0 0.676px 2.703px 0 rgba(0, 0, 0, 0.04),
inset 0 -0.338px 0 0 rgba(0, 0, 0, 0.16);
transform-origin: center;
transform: scale(1);
opacity: 1;
filter: blur(0);
transition:
transform var(--p1-scale-open-dur) var(--p1-ease-scale-open),
opacity var(--p1-opacity-open-dur) var(--p1-ease-scale-open),
filter var(--p1-scale-open-dur) var(--p1-ease-scale-open);
will-change: transform, opacity, filter;
}
.bell-btn[data-badge-open="false"] .bell-badge-inner {
transform: scale(0);
opacity: 0;
filter: blur(var(--p1-blur));
transition:
transform var(--p1-scale-close-dur) var(--p1-ease-close),
opacity var(--p1-opacity-close-dur) var(--p1-ease-close),
filter var(--p1-scale-close-dur) var(--p1-ease-close);
}
/* ============================================================ */
/* Prototype 2 — Toggle menu dropdown */
/* ============================================================ */
.p2-stage {
gap: 10px;
justify-content: flex-start;
padding-top: 20px;
}
/* Default resting state: pre-open (hidden).
Scale anchors at --p2-origin so the menu visually "grows" from
the trigger (top center by default — trigger button above).
Every transform carries a trailing translateZ(0) so Safari
pre-promotes the compositor layer and paints the .surface
box-shadow up-front. Without it, WebKit defers the layer
paint until the scale settles, making the shadow snap in
~150-200 ms after the open animation starts. */
.p2-dropdown {
width: 234px;
height: 136px;
position: relative;
padding: 8px;
transform-origin: var(--p2-origin);
transform: scale(var(--p2-pre-scale)) translateZ(0);
opacity: 0;
pointer-events: none;
transition:
transform var(--p2-open-dur) var(--p2-ease),
opacity var(--p2-open-dur) var(--p2-ease);
}
.p2-dropdown.is-open {
transform: scale(1) translateZ(0);
opacity: 1;
pointer-events: auto;
}
.p2-dropdown.is-closing {
transform: scale(var(--p2-closing-scale)) translateZ(0);
opacity: 0;
pointer-events: none;
transition:
transform var(--p2-close-dur) var(--p2-ease),
opacity var(--p2-close-dur) var(--p2-ease);
}
.p2-dropdown .skeleton {
position: absolute;
height: 14px;
}
.p2-dropdown .s1 {
left: 18px;
top: 23px;
width: 173px;
}
.p2-dropdown .s2 {
left: 18px;
top: 63px;
width: 131px;
}
.p2-dropdown .s3 {
left: 18px;
top: 103px;
width: 194px;
}
/* ============================================================ */
/* Prototype 3 — Toggle panel (vertical) */
/* ============================================================ */
.p3-stage {
gap: 10px;
justify-content: flex-start;
padding-top: 20px;
}
/* Clips the panel so it can hide purely via translateY — no opacity
fade. Clip is larger than the panel by --p3-clip-pad on each side so
box-shadow and border ring stay visible (overflow:hidden no longer
crops them). */
.p3-panel-clip {
width: calc(296px + 2 * var(--p3-clip-pad));
height: calc(var(--p3-panel-height) + 2 * var(--p3-clip-pad));
overflow: hidden;
flex-shrink: 0;
container-type: size;
}
.p3-panel {
width: 296px;
height: var(--p3-panel-height);
margin: var(--p3-clip-pad) auto 0;
border-radius: var(--r-card);
background: var(--p3-surface-bg);
box-shadow: var(--p3-surface-shadow);
overflow: hidden;
position: relative;
/* Closed = open rest position + the 50% travel offset. Opacity
is 0 and blur is 2px here, so the shorter trajectory still
reads as a full open/close when combined with the fade. */
transform: translateY(
calc(-1 * var(--p3-open-lift) + var(--p3-translate-y))
);
opacity: 0;
filter: blur(var(--p3-blur));
pointer-events: none;
/* Base (close) transition — used when returning to hidden state. */
transition:
transform var(--p3-close-dur) var(--p3-ease),
opacity var(--p3-close-dur) var(--p3-ease),
filter var(--p3-close-dur) var(--p3-ease);
will-change: transform, opacity, filter;
}
.p3-panel.is-open {
transform: translateY(calc(-1 * var(--p3-open-lift)));
opacity: 1;
filter: blur(0);
pointer-events: auto;
/* Open transition overrides the base timing. */
transition:
transform var(--p3-open-dur) var(--p3-ease),
opacity var(--p3-open-dur) var(--p3-ease),
filter var(--p3-open-dur) var(--p3-ease);
}
.p3-panel .lines {
position: absolute;
left: 35px;
top: 28px;
width: 173px;
display: flex;
flex-direction: column;
gap: 4px;
}
.p3-panel .lines .l1 {
height: 10px;
width: 100%;
}
.p3-panel .lines .l2 {
height: 10px;
width: 131px;
}
.p3-panel .tiles {
position: absolute;
left: 35px;
top: 73px;
width: 226px;
display: flex;
flex-wrap: wrap;
gap: 17px 14px;
}
.p3-panel .tiles .tile {
width: 106px;
height: 46px;
}
/* ============================================================ */
/* Prototype 4 — Card resize */
/* ============================================================ */
.p4-stage {
gap: 30px;
}
/* Pin the Animate button to a fixed spot within the P4 stage so it
doesn't bob up/down while the card resizes. The card stays the
sole flex-centred item and can subtly shift with its own size
change, but the button acts as a stable anchor for the user. */
.p4-stage > .btn {
position: absolute;
left: 50%;
bottom: 48px;
transform: translateX(-50%);
}
.p4-card {
width: 220px;
height: 112px;
background: var(--modal-bg);
border-radius: var(--r-card);
box-shadow: var(--shadow);
position: relative;
overflow: hidden;
transition:
width var(--p4-dur) var(--p4-ease),
height var(--p4-dur) var(--p4-ease);
}
.p4-card.is-small {
width: 154px;
height: 128px;
}
/* Skeleton geometry: everything is anchored to a 14px horizontal
inset on both sides. Full-width lines use `right: 14px` so they
automatically reflow as the card's width transitions. Partial
lines (title, short paragraph end) are sized as a fraction of
the inner width so they scale proportionally. */
.p4-card .sk {
position: absolute;
left: 14px;
right: 14px;
background: var(--skeleton);
border-radius: 4px;
}
.p4-card .sk-1 { top: 14px; height: 10px; right: auto; width: calc((100% - 28px) * 0.526); }
.p4-card .sk-2 { top: 28px; height: 7px; }
.p4-card .sk-3 { top: 39px; height: 7px; }
.p4-card .sk-4 { top: 50px; height: 7px; right: auto; width: calc((100% - 28px) * 0.734); }
.p4-card .sk-5 { top: 78px; height: 7px; }
.p4-card .sk-6 { top: 89px; height: 7px; }
/* ============================================================ */
/* Prototype 5 — Hamburger ↔ Close */
/* ============================================================ */
.p5-stage {
gap: 60px;
}
.p5-icon-wrap {
position: relative;
width: 24px;
height: 24px;
}
.p5-icon-wrap .icon {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
transition:
opacity var(--p5-dur) var(--p5-ease),
filter var(--p5-dur) var(--p5-ease),
transform var(--p5-dur) var(--p5-ease);
will-change: opacity, filter, transform;
}
.p5-icon-wrap[data-animated="false"] .icon-menu {
opacity: 1;
filter: blur(0);
transform: scale(1);
}
.p5-icon-wrap[data-animated="false"] .icon-close {
opacity: 0;
filter: blur(var(--p5-blur));
transform: scale(var(--p5-start-scale));
}
.p5-icon-wrap[data-animated="true"] .icon-menu {
opacity: 0;
filter: blur(var(--p5-blur));
transform: scale(var(--p5-start-scale));
}
.p5-icon-wrap[data-animated="true"] .icon-close {
opacity: 1;
filter: blur(0);
transform: scale(1);
}
/* ============================================================ */
/* Prototype 6 — Text enter/exit */
/* ============================================================ */
.p6-stage {
gap: 60px;
}
.p6-text {
font-family: var(--font-sans);
font-weight: 500;
font-size: 15px;
line-height: 18px;
color: var(--text);
white-space: nowrap;
transform: translateY(0);
filter: blur(0);
opacity: 1;
transition:
transform var(--p6-dur) var(--p6-ease),
filter var(--p6-dur) var(--p6-ease),
opacity var(--p6-dur) var(--p6-ease);
will-change: transform, filter, opacity;
}
.p6-text.is-exit {
transform: translateY(calc(var(--p6-translate-y) * -1));
filter: blur(var(--p6-blur));
opacity: 0;
}
.p6-text.is-enter-start {
transform: translateY(var(--p6-translate-y));
filter: blur(var(--p6-blur));
opacity: 0;
transition: none;
}
/* ============================================================ */
/* Prototype 7 — Modal open/close */
/* ============================================================ */
.p7-stage {
gap: 0;
justify-content: center;
/* Reserve strip for pinned button (matches demo card-stage rhythm). */
padding-bottom: 64px;
}
.p7-stage > .btn {
position: absolute;
left: 50%;
bottom: 20px;
transform: translateX(-50%);
}
.p7-dropdown {
width: 261px;
height: 172px;
background: var(--modal-bg);
border-radius: var(--r-card);
box-shadow: var(--p7-shadow);
position: relative;
overflow: hidden;
transform-origin: center;
transform: scale(var(--p7-scale));
opacity: 0;
pointer-events: none;
transition:
transform var(--p7-open-dur) var(--p7-ease),
opacity var(--p7-open-dur) var(--p7-ease);
will-change: transform, opacity;
}
.p7-dropdown.is-open {
transform: scale(1);
opacity: 1;
pointer-events: auto;
}
.p7-dropdown.is-closing {
transform: scale(var(--p7-scale-close));
opacity: 0;
pointer-events: none;
transition:
transform var(--p7-close-dur) var(--p7-ease),
opacity var(--p7-close-dur) var(--p7-ease);
}
.p7-dropdown .title {
position: absolute;
left: 16px;
top: 29px;
width: 167px;
height: 14px;
background: var(--skeleton);
border-radius: 4px;
}
.p7-dropdown .close-dot {
position: absolute;
left: 237px;
top: 8px;
width: 16px;
height: 16px;
background: var(--skeleton);
border-radius: 43px;
}
.p7-dropdown .pill {
position: absolute;
top: 135px;
width: 66px;
height: 21px;
background: var(--skeleton);
border-radius: 6px;
}
.p7-dropdown .pill-1 { left: 107px; }
.p7-dropdown .pill-2 { left: 179px; }
.p7-dropdown .body-1,
.p7-dropdown .body-2,
.p7-dropdown .body-3 {
position: absolute;
left: 16px;
height: 10px;
background: var(--skeleton);
border-radius: 4px;
}
.p7-dropdown .body-1 { top: 57px; width: 227px; }
.p7-dropdown .body-2 { top: 73px; width: 227px; }
.p7-dropdown .body-3 { top: 89px; width: 141px; }
/* ============================================================ */
/* Prototype 8 — Token list ↔ Amount screen */
/* ============================================================ */
.p8-stage { gap: 0; }
.p8-modal {
width: 260px;
height: 267px;
background: var(--modal-bg);
border-radius: var(--r-card);
box-shadow: var(--shadow);
position: relative;
overflow: hidden;
}
/* Each page has a "resting direction" on its own side of the modal.
Page 1 rests to the left, Page 2 rests to the right. */
.p8-modal .page-1 { --p8-from-x: calc(var(--p8-distance) * -1); }
.p8-modal .page-2 { --p8-from-x: var(--p8-distance); }
/* Resting (inactive) state: translated to the page's side, blurred,
and fully transparent. The `--p8-exit-enabled` multiplier lets the
control panel turn the slide+blur off so the outgoing page just
fades in place. */
.p8-modal .page {
position: absolute;
inset: 0;
opacity: 0;
pointer-events: none;
transform: translateX(calc(var(--p8-from-x, 0px) * var(--p8-exit-enabled)));
filter: blur(calc(var(--p8-blur) * var(--p8-exit-enabled)));
transition:
opacity var(--p8-fade-dur) var(--p8-fade-ease),
transform var(--p8-slide-dur) var(--p8-slide-ease),
filter var(--p8-slide-dur) var(--p8-slide-ease);
will-change: opacity, transform, filter;
}
/* Active (incoming) page: translate to 0, un-blur, fade in. The
stagger delay applies only to the incoming page, so the outgoing
page starts its exit immediately. */
.p8-modal[data-page="1"] .page-1,
.p8-modal[data-page="2"] .page-2 {
opacity: 1;
pointer-events: auto;
transform: translateX(0);
filter: blur(0);
transition-delay: var(--p8-stagger);
}
/* Chip icon button (close / back) — matches Figma bg rgba(244,244,244,0.5) */
.p8-modal .chip-btn {
appearance: none;
border: 0;
padding: 0;
width: 32px;
height: 32px;
border-radius: 60px;
background: rgba(244, 244, 244, 0.5);
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
transition: background-color 120ms ease;
}
.p8-modal .chip-btn:hover { background: rgba(244, 244, 244, 0.9); }
.p8-modal .chip-btn svg { display: block; }
.p8-modal .page-title {
position: absolute;
left: 50%;
top: 25px;
transform: translateX(-50%);
width: 95px;
height: 14px;
background: var(--skeleton);
border-radius: 4px;
}