@yewdiel21/motion-kit 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +3 -35
- package/README.md +93 -81
- package/dist/auto/index.d.ts +22 -3
- package/dist/auto/index.js +43 -5
- package/dist/auto/index.js.map +1 -1
- package/dist/{chunk-KLY5BRRI.js → chunk-34EZ7DF4.js} +1 -1
- package/dist/chunk-34EZ7DF4.js.map +1 -0
- package/dist/{chunk-RFDIZYFX.js → chunk-DOOMULVV.js} +20 -20
- package/dist/chunk-DOOMULVV.js.map +1 -0
- package/dist/{chunk-ABNRDDO7.js → chunk-I3DXF2KQ.js} +2 -2
- package/dist/{chunk-Q4LVFNLN.js → chunk-IKQ5FODN.js} +4 -4
- package/dist/chunk-IKQ5FODN.js.map +1 -0
- package/dist/{chunk-2BQGFOA7.js → chunk-J6OCFNGU.js} +2 -2
- package/dist/chunk-J6OCFNGU.js.map +1 -0
- package/dist/{chunk-6OJAP6ZL.js → chunk-QFBOHPWZ.js} +3 -3
- package/dist/chunk-QFBOHPWZ.js.map +1 -0
- package/dist/{chunk-J27KH2A2.js → chunk-RVSKEBIC.js} +1 -1
- package/dist/chunk-RVSKEBIC.js.map +1 -0
- package/dist/{chunk-34XYOXHG.js → chunk-TFNRIZHU.js} +1615 -12
- package/dist/chunk-TFNRIZHU.js.map +1 -0
- package/dist/{chunk-FS2HJVVY.js → chunk-XAKC2QY7.js} +1204 -5
- package/dist/chunk-XAKC2QY7.js.map +1 -0
- package/dist/css/components/calendar.css +159 -0
- package/dist/css/components/chat-background.css +2 -2
- package/dist/css/components/chat.css +1 -1
- package/dist/css/components/cursor.css +3 -3
- package/dist/css/components/dialog.css +3 -3
- package/dist/css/components/hover-card.css +14 -0
- package/dist/css/components/input-otp.css +10 -0
- package/dist/css/components/island.css +1 -1
- package/dist/css/components/menu.css +1 -1
- package/dist/css/components/nav.css +1 -5
- package/dist/css/components/pagination.css +11 -0
- package/dist/css/components/quantity.css +16 -0
- package/dist/css/components/slot-picker.css +126 -0
- package/dist/css/components/steps.css +2 -2
- package/dist/css/components/studio-dock.css +35 -0
- package/dist/css/components/theme-picker.css +1 -1
- package/dist/css/components/toast.css +1 -1
- package/dist/css/components/trailer.css +37 -0
- package/dist/css/controls.css +78 -13
- package/dist/css/effects.css +8 -8
- package/dist/css/fonts.css +1 -1
- package/dist/css/themes/black-green.css +1 -1
- package/dist/css/themes/black.css +1 -1
- package/dist/css/themes/blue.css +1 -1
- package/dist/css/themes/brown.css +1 -1
- package/dist/css/themes/cold-blue.css +1 -1
- package/dist/css/themes/funny.css +1 -1
- package/dist/css/themes/gray.css +1 -1
- package/dist/css/themes/green.css +1 -1
- package/dist/css/themes/modern-1.css +1 -1
- package/dist/css/themes/neogreen.css +1 -1
- package/dist/css/themes/new.css +1 -1
- package/dist/css/themes/new2.css +1 -1
- package/dist/css/themes/oled.css +1 -1
- package/dist/css/themes/orange.css +1 -1
- package/dist/css/themes/pastel-pink.css +1 -1
- package/dist/css/themes/pink.css +1 -1
- package/dist/css/themes/purple.css +1 -1
- package/dist/css/themes/red.css +1 -1
- package/dist/css/themes/super-blue.css +1 -1
- package/dist/css/themes.css +19 -19
- package/dist/css/tokens.css +9 -9
- package/dist/elements/index.d.ts +75 -7
- package/dist/elements/index.js +172 -6
- package/dist/elements/index.js.map +1 -1
- package/dist/{engine-CUr9QijM.d.ts → engine-GDGwQnJE.d.ts} +2 -2
- package/dist/gl/index.js +3 -3
- package/dist/index.css +1076 -63
- package/dist/index.d.ts +17 -17
- package/dist/index.js +49 -7
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +139 -40
- package/dist/react/index.js +355 -8
- package/dist/react/index.js.map +1 -1
- package/dist/{reduced-BM4Ls0g5.d.ts → reduced-BmBzKH94.d.ts} +215 -18
- package/dist/{reveal-WFUWDrei.d.ts → reveal-jsX-uwUz.d.ts} +233 -24
- package/dist/{store-Bqy_obnD.d.ts → store-DYb3tTsZ.d.ts} +5 -5
- package/dist/theme/generate.d.ts +1 -1
- package/dist/theme/generate.js +2 -2
- package/dist/theme/generate.js.map +1 -1
- package/dist/theme/index.d.ts +2 -2
- package/dist/theme/index.js +2 -2
- package/dist/{theme-BFMoCzi6.d.ts → theme-Bjf9qIIy.d.ts} +1 -1
- package/package.json +2 -2
- package/registry.json +230 -156
- package/skills/motion-kit/SKILL.md +209 -189
- package/skills/motion-kit/reference/components.md +5 -5
- package/skills/motion-kit/reference/design.md +14 -14
- package/skills/motion-kit/reference/recipes.md +48 -49
- package/src/auto/auto-init.ts +38 -0
- package/src/components/calendar/README.md +82 -0
- package/src/components/calendar/calendar.css +158 -0
- package/src/components/calendar/element.ts +27 -0
- package/src/components/calendar/engine.ts +412 -0
- package/src/components/calendar/react.tsx +69 -0
- package/src/components/chat/README.md +1 -3
- package/src/components/chat/chat.css +1 -1
- package/src/components/chat/engine.ts +1 -1
- package/src/components/chat/react.tsx +1 -1
- package/src/components/chat-background/README.md +1 -3
- package/src/components/chat-background/audio.ts +1 -1
- package/src/components/chat-background/chat-background.css +2 -2
- package/src/components/chat-background/engine.ts +1 -1
- package/src/components/chat-background/react.tsx +1 -1
- package/src/components/cursor/README.md +3 -5
- package/src/components/cursor/cursor.css +3 -3
- package/src/components/cursor/element.ts +2 -2
- package/src/components/cursor/engine.ts +5 -5
- package/src/components/cursor/react.tsx +1 -1
- package/src/components/dialog/README.md +4 -8
- package/src/components/dialog/dialog.css +3 -3
- package/src/components/dialog/engine.ts +2 -2
- package/src/components/dialog/react.tsx +1 -1
- package/src/components/hover-card/README.md +16 -0
- package/src/components/hover-card/element.ts +8 -0
- package/src/components/hover-card/engine.ts +69 -0
- package/src/components/hover-card/hover-card.css +13 -0
- package/src/components/hover-card/react.tsx +19 -0
- package/src/components/input-otp/README.md +18 -0
- package/src/components/input-otp/element.ts +14 -0
- package/src/components/input-otp/engine.ts +106 -0
- package/src/components/input-otp/input-otp.css +9 -0
- package/src/components/input-otp/react.tsx +21 -0
- package/src/components/island/README.md +7 -7
- package/src/components/island/engine.ts +3 -3
- package/src/components/island/island.css +1 -1
- package/src/components/island/react.tsx +3 -3
- package/src/components/menu/README.md +2 -4
- package/src/components/menu/engine.ts +1 -1
- package/src/components/menu/menu.css +1 -1
- package/src/components/menu/react.tsx +1 -1
- package/src/components/nav/README.md +12 -14
- package/src/components/nav/engine.ts +5 -5
- package/src/components/nav/nav.css +1 -5
- package/src/components/nav/react.tsx +3 -3
- package/src/components/pagination/README.md +17 -0
- package/src/components/pagination/element.ts +14 -0
- package/src/components/pagination/engine.ts +102 -0
- package/src/components/pagination/pagination.css +10 -0
- package/src/components/pagination/react.tsx +22 -0
- package/src/components/quantity/README.md +20 -0
- package/src/components/quantity/element.ts +14 -0
- package/src/components/quantity/engine.ts +85 -0
- package/src/components/quantity/quantity.css +15 -0
- package/src/components/quantity/react.tsx +21 -0
- package/src/components/slot-picker/README.md +68 -0
- package/src/components/slot-picker/element.ts +27 -0
- package/src/components/slot-picker/engine.ts +412 -0
- package/src/components/slot-picker/react.tsx +76 -0
- package/src/components/slot-picker/slot-picker.css +125 -0
- package/src/components/steps/README.md +1 -3
- package/src/components/steps/engine.ts +3 -3
- package/src/components/steps/react.tsx +2 -2
- package/src/components/steps/steps.css +2 -2
- package/src/components/studio-dock/README.md +44 -0
- package/src/components/studio-dock/element.ts +11 -0
- package/src/components/studio-dock/engine.ts +212 -0
- package/src/components/studio-dock/react.tsx +23 -0
- package/src/components/studio-dock/studio-dock.css +34 -0
- package/src/components/theme-picker/README.md +3 -5
- package/src/components/theme-picker/engine.ts +2 -2
- package/src/components/theme-picker/react.tsx +1 -1
- package/src/components/theme-picker/theme-picker.css +1 -1
- package/src/components/toast/README.md +1 -3
- package/src/components/toast/engine.ts +2 -2
- package/src/components/toast/react.tsx +1 -1
- package/src/components/toast/store.ts +1 -2
- package/src/components/toast/toast.css +1 -1
- package/src/components/trailer/README.md +28 -0
- package/src/components/trailer/element.ts +13 -0
- package/src/components/trailer/engine.ts +189 -0
- package/src/components/trailer/react.tsx +16 -0
- package/src/components/trailer/trailer.css +36 -0
- package/src/core/channels.ts +3 -3
- package/src/core/curves.ts +3 -3
- package/src/core/dates.ts +98 -0
- package/src/core/gsap.ts +2 -2
- package/src/core/loop.ts +1 -1
- package/src/core/math.ts +1 -1
- package/src/core/physics-spring.ts +2 -2
- package/src/core/scroll-track.ts +2 -4
- package/src/core/spring.ts +1 -1
- package/src/core/timing.ts +21 -22
- package/src/css/controls/README.md +24 -20
- package/src/css/controls/burger.css +1 -1
- package/src/css/controls/button.css +4 -4
- package/src/css/controls/checkbox.css +1 -1
- package/src/css/controls/chip.css +1 -1
- package/src/css/controls/field.css +2 -2
- package/src/css/controls/glass.css +4 -4
- package/src/css/controls/status.css +63 -0
- package/src/css/default-theme.css +1 -1
- package/src/css/effects/README.md +19 -21
- package/src/css/effects/anim.css +1 -1
- package/src/css/effects/fade.css +1 -1
- package/src/css/effects/float.css +1 -1
- package/src/css/effects/frost.css +1 -1
- package/src/css/effects/grain.css +1 -1
- package/src/css/effects/loading.css +1 -1
- package/src/css/effects/success.css +1 -1
- package/src/css/effects/text.css +1 -1
- package/src/css/fonts.css +1 -1
- package/src/css/states.css +1 -1
- package/src/css/themes/black-green.css +1 -1
- package/src/css/themes/black.css +1 -1
- package/src/css/themes/blue.css +1 -1
- package/src/css/themes/brown.css +1 -1
- package/src/css/themes/cold-blue.css +1 -1
- package/src/css/themes/funny.css +1 -1
- package/src/css/themes/gray.css +1 -1
- package/src/css/themes/green.css +1 -1
- package/src/css/themes/modern-1.css +1 -1
- package/src/css/themes/neogreen.css +1 -1
- package/src/css/themes/new.css +1 -1
- package/src/css/themes/new2.css +1 -1
- package/src/css/themes/oled.css +1 -1
- package/src/css/themes/orange.css +1 -1
- package/src/css/themes/pastel-pink.css +1 -1
- package/src/css/themes/pink.css +1 -1
- package/src/css/themes/purple.css +1 -1
- package/src/css/themes/red.css +1 -1
- package/src/css/themes/super-blue.css +1 -1
- package/src/css/tokens.css +8 -8
- package/src/elements/index.ts +24 -0
- package/src/gl/liquid-blend/README.md +3 -3
- package/src/gl/matcap/README.md +3 -3
- package/src/gl/particle-hero/README.md +1 -1
- package/src/gl/particle-hero/create-particle-hero.ts +3 -5
- package/src/gl/particle-hero/shaders.ts +1 -1
- package/src/gl/shader-blur/README.md +3 -3
- package/src/gl/shader-grain/README.md +3 -3
- package/src/index.ts +25 -0
- package/src/motion/chat.ts +2 -2
- package/src/motion/confetti.ts +1 -1
- package/src/motion/count.ts +1 -1
- package/src/motion/details.ts +1 -1
- package/src/motion/drag-dismiss.ts +1 -1
- package/src/motion/effects.ts +1 -1
- package/src/motion/entrances.ts +1 -1
- package/src/motion/floating.ts +1 -1
- package/src/motion/flow.ts +2 -2
- package/src/motion/indicator.ts +1 -1
- package/src/motion/layout.ts +1 -1
- package/src/motion/liquid.ts +1 -1
- package/src/motion/morph.ts +2 -2
- package/src/motion/reveal.ts +1 -1
- package/src/motion/sheet.ts +1 -1
- package/src/motion/surface.ts +1 -1
- package/src/react/animated-number.tsx +2 -2
- package/src/react/flip-group.tsx +1 -1
- package/src/react/frost.tsx +1 -1
- package/src/react/index.ts +21 -0
- package/src/react/slot-text.tsx +1 -1
- package/src/react/use-action-button.ts +6 -0
- package/src/react/use-card-dock.ts +1 -1
- package/src/react/use-cascade.ts +1 -1
- package/src/react/use-contrast.ts +1 -1
- package/src/react/use-depth-grid.ts +1 -1
- package/src/react/use-editorial-reveal.ts +7 -0
- package/src/react/use-fill-text.ts +1 -1
- package/src/react/use-film-hero.ts +6 -0
- package/src/react/use-font-cycle.ts +7 -0
- package/src/react/use-frame-zoom.ts +1 -1
- package/src/react/use-image-zoom.ts +5 -0
- package/src/react/use-joined-cta.ts +5 -0
- package/src/react/use-letters.ts +1 -1
- package/src/react/use-local-clock.ts +5 -0
- package/src/react/use-marquee.ts +1 -1
- package/src/react/use-mask-text.ts +1 -1
- package/src/react/use-parallax.ts +1 -1
- package/src/react/use-particle-hero.ts +1 -1
- package/src/react/use-scroll-dock.ts +5 -0
- package/src/react/use-snap-strip.ts +1 -1
- package/src/react/use-sticker.ts +5 -0
- package/src/react/use-studio-dock.ts +8 -0
- package/src/react/use-text-roll.ts +1 -1
- package/src/react/use-thumbnail-nav.ts +7 -0
- package/src/react/use-trailer.ts +6 -0
- package/src/react/use-weight-hover.ts +5 -0
- package/src/recipes/action-button/README.md +31 -0
- package/src/recipes/action-button/action-button.css +113 -0
- package/src/recipes/action-button/create-action-button.ts +56 -0
- package/src/recipes/card-dock/README.md +1 -1
- package/src/recipes/card-dock/card-dock.css +1 -1
- package/src/recipes/card-dock/create-card-dock.ts +2 -2
- package/src/recipes/cascade/README.md +1 -3
- package/src/recipes/cascade/create-cascade.ts +3 -3
- package/src/recipes/contrast/README.md +0 -2
- package/src/recipes/contrast/create-contrast.ts +1 -1
- package/src/recipes/counter/README.md +0 -2
- package/src/recipes/counter/create-counter.ts +1 -1
- package/src/recipes/curved-carousel/README.md +0 -2
- package/src/recipes/curved-carousel/create-curved-carousel.ts +2 -2
- package/src/recipes/curved-carousel/curved-carousel.css +1 -1
- package/src/recipes/depth-grid/README.md +0 -2
- package/src/recipes/depth-grid/create-depth-grid.ts +3 -4
- package/src/recipes/details/README.md +0 -2
- package/src/recipes/details/create-details.ts +1 -1
- package/src/recipes/dock-pill/README.md +3 -3
- package/src/recipes/drag-ruler/README.md +3 -3
- package/src/recipes/editorial-reveal/README.md +35 -0
- package/src/recipes/editorial-reveal/create-editorial-reveal.ts +91 -0
- package/src/recipes/editorial-reveal/editorial-reveal.css +17 -0
- package/src/recipes/fill-text/README.md +1 -1
- package/src/recipes/fill-text/create-fill-text.ts +1 -1
- package/src/recipes/film-hero/README.md +23 -0
- package/src/recipes/film-hero/create-film-hero.ts +65 -0
- package/src/recipes/film-hero/film-hero.css +29 -0
- package/src/recipes/fit-text/README.md +0 -2
- package/src/recipes/flow/README.md +0 -2
- package/src/recipes/flow/create-flow.ts +1 -1
- package/src/recipes/font-cycle/README.md +11 -0
- package/src/recipes/font-cycle/create-font-cycle.ts +126 -0
- package/src/recipes/font-cycle/font-cycle.css +36 -0
- package/src/recipes/frame-zoom/README.md +1 -3
- package/src/recipes/frame-zoom/create-frame-zoom.ts +2 -2
- package/src/recipes/image-zoom/README.md +16 -0
- package/src/recipes/image-zoom/create-image-zoom.ts +27 -0
- package/src/recipes/image-zoom/image-zoom.css +7 -0
- package/src/recipes/infinite-reel/README.md +3 -3
- package/src/recipes/joined-cta/README.md +13 -0
- package/src/recipes/joined-cta/create-joined-cta.ts +22 -0
- package/src/recipes/joined-cta/joined-cta.css +17 -0
- package/src/recipes/letters/README.md +2 -4
- package/src/recipes/letters/create-letters.ts +3 -3
- package/src/recipes/local-clock/README.md +31 -0
- package/src/recipes/local-clock/create-local-clock.ts +61 -0
- package/src/recipes/marquee/README.md +0 -2
- package/src/recipes/marquee/create-marquee.ts +3 -3
- package/src/recipes/marquee/marquee.css +1 -1
- package/src/recipes/mask-text/README.md +3 -5
- package/src/recipes/mask-text/create-mask-text.ts +4 -4
- package/src/recipes/parallax/README.md +1 -3
- package/src/recipes/parallax/create-parallax.ts +1 -1
- package/src/recipes/pile/README.md +0 -2
- package/src/recipes/pile/create-pile.ts +1 -1
- package/src/recipes/pile/pile-math.ts +1 -1
- package/src/recipes/pile/pile.css +1 -1
- package/src/recipes/pill/README.md +0 -2
- package/src/recipes/pill/pill.css +2 -2
- package/src/recipes/pop/README.md +0 -2
- package/src/recipes/pop/create-pop.ts +1 -1
- package/src/recipes/radial-menu/README.md +0 -2
- package/src/recipes/radial-menu/create-radial-menu.ts +1 -1
- package/src/recipes/radial-menu/radial-menu.css +1 -1
- package/src/recipes/reflow/README.md +3 -5
- package/src/recipes/reflow/create-reflow.ts +1 -1
- package/src/recipes/repel-bento/README.md +3 -3
- package/src/recipes/reveal/README.md +0 -2
- package/src/recipes/reveal/create-reveal.ts +1 -1
- package/src/recipes/rotator/README.md +3 -3
- package/src/recipes/scroll-dock/README.md +46 -0
- package/src/recipes/scroll-dock/create-scroll-dock.ts +72 -0
- package/src/recipes/scroll-dock/scroll-dock.css +70 -0
- package/src/recipes/slot-text/README.md +0 -2
- package/src/recipes/slot-text/create-slot-text.ts +1 -1
- package/src/recipes/snap-strip/README.md +1 -1
- package/src/recipes/snap-strip/create-snap-strip.ts +5 -6
- package/src/recipes/snap-strip/snap-strip.css +1 -1
- package/src/recipes/sortable/README.md +3 -5
- package/src/recipes/sortable/create-sortable.ts +4 -4
- package/src/recipes/sortable/sortable.css +1 -1
- package/src/recipes/spring-cards/README.md +0 -2
- package/src/recipes/spring-cards/create-spring-cards.ts +1 -1
- package/src/recipes/spring-cards/spring-cards.css +1 -1
- package/src/recipes/sticker/README.md +59 -0
- package/src/recipes/sticker/create-sticker.ts +490 -0
- package/src/recipes/sticker/sticker.css +112 -0
- package/src/recipes/stretch-footer/README.md +0 -2
- package/src/recipes/stretch-footer/create-stretch-footer.ts +1 -1
- package/src/recipes/stretch-footer/stretch-footer.css +1 -1
- package/src/recipes/tabs/README.md +0 -2
- package/src/recipes/tabs/create-tabs.ts +1 -1
- package/src/recipes/text-roll/README.md +1 -3
- package/src/recipes/text-roll/create-text-roll.ts +3 -3
- package/src/recipes/text-roll/text-roll.css +1 -1
- package/src/recipes/thumbnail-nav/README.md +16 -0
- package/src/recipes/thumbnail-nav/create-thumbnail-nav.ts +165 -0
- package/src/recipes/thumbnail-nav/thumbnail-nav.css +108 -0
- package/src/recipes/ticket-menu/README.md +3 -3
- package/src/recipes/weight-hover/README.md +37 -0
- package/src/recipes/weight-hover/create-weight-hover.ts +136 -0
- package/src/recipes/weight-hover/weight-hover.css +7 -0
- package/src/recipes/words/README.md +0 -2
- package/src/recipes/words/create-words.ts +1 -1
- package/src/theme/generate.ts +1 -1
- package/src/theme/presets.ts +2 -2
- package/src/theme/theme.ts +1 -2
- package/dist/chunk-2BQGFOA7.js.map +0 -1
- package/dist/chunk-34XYOXHG.js.map +0 -1
- package/dist/chunk-6OJAP6ZL.js.map +0 -1
- package/dist/chunk-FS2HJVVY.js.map +0 -1
- package/dist/chunk-J27KH2A2.js.map +0 -1
- package/dist/chunk-KLY5BRRI.js.map +0 -1
- package/dist/chunk-Q4LVFNLN.js.map +0 -1
- package/dist/chunk-RFDIZYFX.js.map +0 -1
- /package/dist/{chunk-ABNRDDO7.js.map → chunk-I3DXF2KQ.js.map} +0 -0
package/src/css/tokens.css
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* motion-kit tokens — override any of them on :root, on a [data-mk-theme] or on a component. */
|
|
2
2
|
:root {
|
|
3
|
-
/*
|
|
3
|
+
/* Elastic curves */
|
|
4
4
|
--mk-ease-elastic: linear(0, 0.5737 7.6%, 0.8382 11.87%, 0.9463 14.19%, 1.0292 16.54%, 1.0886 18.97%, 1.1258 21.53%, 1.137 22.97%, 1.1424 24.48%, 1.1423 26.1%, 1.1366 27.86%, 1.1165 31.01%, 1.0507 38.62%, 1.0219 42.57%, 0.9995 46.99%, 0.9872 51.63%, 0.9842 58.77%, 1.0011 81.26%, 1);
|
|
5
5
|
--mk-ease-elastic-hover: linear(0, 0.2178 2.1%, 1.1144 8.49%, 1.2959 10.7%, 1.3463 11.81%, 1.3705 12.94%, 1.3726, 1.3643 14.48%, 1.3151 16.2%, 1.0317 21.81%, 0.941 24.01%, 0.8912 25.91%, 0.8694 27.84%, 0.8698 29.21%, 0.8824 30.71%, 1.0122 38.33%, 1.0357, 1.046 42.71%, 1.0416 45.7%, 0.9961 53.26%, 0.9839 57.54%, 0.9853 60.71%, 1.0012 68.14%, 1.0056 72.24%, 0.9981 86.66%, 1);
|
|
6
6
|
|
|
7
|
-
/*
|
|
7
|
+
/* Motion curves. The signature is a multi-point path sampled as CSS linear(). */
|
|
8
8
|
--mk-ease-signature: linear(0 0%, .017 2.5%, .037 5%, .061 7.5%, .091 10%, .13 12.5%, .184 15%, .275 17.5%, .562 20%, .733 22.5%, .803 25%, .848 27.5%, .88 30%, .902 32.5%, .942 40%, .97 50%, .985 60%, .993 70%, .998 80%, 1 90%, 1 100%);
|
|
9
|
-
/*
|
|
9
|
+
/* backdrop tint uses the same curve. */
|
|
10
10
|
--mk-ease-tint: var(--mk-ease-signature);
|
|
11
11
|
--mk-ease-flow: cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
12
12
|
--mk-ease-close: cubic-bezier(0.56, 0.27, 0, 1);
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
--mk-ease-swatch: cubic-bezier(0.38, 0.49, 0, 1.5);
|
|
17
17
|
--mk-ease-swatch-light: cubic-bezier(0.11, 1, 0, 1);
|
|
18
18
|
--mk-ease-slot: cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
19
|
-
/*
|
|
19
|
+
/* Glass, sheet and control curves */
|
|
20
20
|
--mk-ease-glass: cubic-bezier(0.25, 1, 0.5, 1);
|
|
21
21
|
--mk-ease-sheet: cubic-bezier(0.16, 1, 0.3, 1);
|
|
22
22
|
--mk-ease-siena: cubic-bezier(0.19, 1, 0.22, 1);
|
|
23
23
|
--mk-ease-quint: cubic-bezier(0.23, 1, 0.32, 1);
|
|
24
|
-
/*
|
|
24
|
+
/* springs (Motion 400/10 press, 260/18 success), sampled by springLinear(); a test keeps them in sync. */
|
|
25
25
|
--mk-ease-press: linear(0, 0.1957, 0.6333, 1.0817, 1.3717, 1.4412, 1.3274, 1.1249, 0.934, 0.8221, 0.808, 0.8691, 0.9612, 1.0413, 1.0833, 1.0824, 1.0513, 1.01, 0.9769, 0.9618, 0.9651, 0.9804, 0.9986, 1.0121, 1.0173, 1.0146, 1.0072, 0.9993, 0.9939, 0.9923, 0.994, 0.9974, 1.0008, 1.003, 1.0034, 1.0024, 1.0008, 0.9994, 0.9986, 0.9985, 1);
|
|
26
26
|
--mk-dur-press: 1.346s;
|
|
27
27
|
--mk-ease-success: linear(0, 0.0437, 0.1533, 0.3004, 0.4617, 0.6197, 0.7624, 0.8825, 0.9767, 1.0451, 1.0895, 1.1133, 1.1208, 1.1161, 1.1032, 1.0856, 1.0662, 1.047, 1.0296, 1.0149, 1.0034, 0.9949, 0.9894, 0.9864, 0.9854, 0.9859, 0.9874, 0.9895, 0.9919, 0.9942, 0.9963, 0.9981, 0.9995, 1.0006, 1.0012, 1.0016, 1.0018, 1.0017, 1.0015, 1.0013, 1);
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
--mk-shadow: 0 9px 21px rgb(0 0 0 / 0.1), 0 38px 38px rgb(0 0 0 / 0.09), 0 85px 51px rgb(0 0 0 / 0.05);
|
|
35
35
|
--mk-shadow-soft: 0 9px 21px rgb(0 0 0 / 0.05), 0 38px 38px rgb(0 0 0 / 0.045), 0 85px 51px rgb(0 0 0 / 0.025);
|
|
36
36
|
|
|
37
|
-
/* Shape:
|
|
37
|
+
/* Shape: large capsules */
|
|
38
38
|
--mk-radius-card: 1rem;
|
|
39
39
|
--mk-radius-xs: 8px;
|
|
40
40
|
--mk-radius-sm: 12px;
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
--mk-radius-chat: var(--mk-radius-3xl);
|
|
51
51
|
--mk-radius-dock: var(--mk-radius-4xl);
|
|
52
52
|
|
|
53
|
-
/* Spacing, 4 px steps.
|
|
53
|
+
/* Spacing, 4 px steps. navigation breakpoint is 680px (media queries use it literally). */
|
|
54
54
|
--mk-space-1: 4px;
|
|
55
55
|
--mk-space-2: 8px;
|
|
56
56
|
--mk-space-3: 12px;
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
/* Type: DM Sans, Geist Mono, Material Symbols Rounded (css/fonts.css loads them). */
|
|
73
73
|
--mk-font: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
|
|
74
74
|
--mk-font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
75
|
-
/* Material 3 type scale
|
|
75
|
+
/* Material 3 type scale; font weights are unitless. */
|
|
76
76
|
--md-sys-typescale-display-large-font: var(--mk-font);
|
|
77
77
|
--md-sys-typescale-display-large-size: 57px;
|
|
78
78
|
--md-sys-typescale-display-large-line-height: 64px;
|
package/src/elements/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { MkStudioDockElement } from '../components/studio-dock/element';
|
|
2
|
+
import { MkTrailerElement } from '../components/trailer/element';
|
|
1
3
|
import { defineElement } from './base';
|
|
2
4
|
import { MkThemePickerElement } from '../components/theme-picker/element';
|
|
3
5
|
import { MkDialogElement } from '../components/dialog/element';
|
|
@@ -9,6 +11,12 @@ import { MkNavElement } from '../components/nav/element';
|
|
|
9
11
|
import { MkStepsElement } from '../components/steps/element';
|
|
10
12
|
import { MkCursorElement } from '../components/cursor/element';
|
|
11
13
|
import { MkIslandElement } from '../components/island/element';
|
|
14
|
+
import { MkQuantityElement } from '../components/quantity/element';
|
|
15
|
+
import { MkPaginationElement } from '../components/pagination/element';
|
|
16
|
+
import { MkHoverCardElement } from '../components/hover-card/element';
|
|
17
|
+
import { MkInputOtpElement } from '../components/input-otp/element';
|
|
18
|
+
import { MkCalendarElement } from '../components/calendar/element';
|
|
19
|
+
import { MkSlotPickerElement } from '../components/slot-picker/element';
|
|
12
20
|
// new-component:imports (scripts/new-component.mjs inserts above this line)
|
|
13
21
|
|
|
14
22
|
export { MkElement, SafeHTMLElement, defineElement, type OptionType } from './base';
|
|
@@ -23,6 +31,14 @@ export { MkStepsElement } from '../components/steps/element';
|
|
|
23
31
|
export { MkCursorElement } from '../components/cursor/element';
|
|
24
32
|
export { toast } from '../components/toast/store';
|
|
25
33
|
export { MkIslandElement } from '../components/island/element';
|
|
34
|
+
export { MkQuantityElement } from '../components/quantity/element';
|
|
35
|
+
export { MkPaginationElement } from '../components/pagination/element';
|
|
36
|
+
export { MkHoverCardElement } from '../components/hover-card/element';
|
|
37
|
+
export { MkInputOtpElement } from '../components/input-otp/element';
|
|
38
|
+
export { MkStudioDockElement, defineStudioDock } from '../components/studio-dock/element';
|
|
39
|
+
export { MkTrailerElement, defineTrailer } from '../components/trailer/element';
|
|
40
|
+
export { MkCalendarElement } from '../components/calendar/element';
|
|
41
|
+
export { MkSlotPickerElement } from '../components/slot-picker/element';
|
|
26
42
|
// new-component:exports
|
|
27
43
|
|
|
28
44
|
/** Tag name → element class, for every component. */
|
|
@@ -37,6 +53,14 @@ export const ELEMENTS = {
|
|
|
37
53
|
'mk-steps': MkStepsElement,
|
|
38
54
|
'mk-cursor': MkCursorElement,
|
|
39
55
|
'mk-island': MkIslandElement,
|
|
56
|
+
'mk-quantity': MkQuantityElement,
|
|
57
|
+
'mk-pagination': MkPaginationElement,
|
|
58
|
+
'mk-hover-card': MkHoverCardElement,
|
|
59
|
+
'mk-input-otp': MkInputOtpElement,
|
|
60
|
+
'mk-studio-dock': MkStudioDockElement,
|
|
61
|
+
'mk-trailer': MkTrailerElement,
|
|
62
|
+
'mk-calendar': MkCalendarElement,
|
|
63
|
+
'mk-slot-picker': MkSlotPickerElement,
|
|
40
64
|
// new-component:entries
|
|
41
65
|
} as const;
|
|
42
66
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# liquid-blend
|
|
2
2
|
|
|
3
|
-
Mezcla de dos texturas con deformación UV
|
|
3
|
+
Mezcla de dos texturas con deformación UV.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
import { createLiquidBlend } from '@yewdiel21/motion-kit/gl';
|
|
@@ -18,6 +18,6 @@ Controles: `setProgress(0..1)`, `setAmount(0..100)`, `pause()`, `resume()`, `mod
|
|
|
18
18
|
|
|
19
19
|
Pausa fuera de pantalla y con pestaña oculta. Movimiento reducido: frame fijo, con controles manuales. Sin WebGL, error de textura o contexto perdido: canvas oculto, HTML original disponible. Contexto restaurado: recompila y vuelve a cargar texturas. Destroy libera texturas, buffer, shaders y programa, desconecta observers y restaura la clase original.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Mezcla dos texturas de imagen con ondas UV centradas. `amount` vale.15 por defecto; los extremos de progreso 0 y 1 conservan exactamente la primera y la segunda imagen.
|
|
22
22
|
|
|
23
|
-
Desde 0.9.0.
|
|
23
|
+
Desde 0.9.0.
|
package/src/gl/matcap/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# matcap
|
|
2
2
|
|
|
3
|
-
Superficie esférica iluminada con matcap y hemisferio
|
|
3
|
+
Superficie esférica iluminada con matcap y hemisferio.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
import { createMatcap } from '@yewdiel21/motion-kit/gl';
|
|
@@ -18,6 +18,6 @@ Controles: `setProgress(0..1)`, `setAmount(0..100)`, `pause()`, `resume()`, `mod
|
|
|
18
18
|
|
|
19
19
|
Pausa fuera de pantalla y con pestaña oculta. Movimiento reducido: frame fijo, con controles manuales. Sin WebGL, error de textura o contexto perdido: canvas oculto, HTML original disponible. Contexto restaurado: recompila y vuelve a cargar texturas. Destroy libera texturas, buffer, shaders y programa, desconecta observers y restaura la clase original.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Calcula normales de una esfera analítica y coordenadas UV.495+.5, con iluminación hemisférica y ganancia.15. Una imagen opcional actúa como matcap; sin imagen utiliza iluminación calculada. El progreso gira el material y `amount` regula el brillo. No carga modelos ni refleja una escena.
|
|
22
22
|
|
|
23
|
-
Desde 0.9.0.
|
|
23
|
+
Desde 0.9.0.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Una nube de puntos simulada en la GPU que se posa sobre las líneas de un patrón de interferencia que cambia solo (modos de Chladni de [3, 5, 7] cada 6–12 s, frecuencia 20–45 cada 5–10 s, distorsión 0–5 en 1.2–3 s) mientras una parte de los puntos (40–80 %) se va a dibujar una palabra y luego vuelve. El puntero los empuja según su velocidad. Aparece en 1 s tras 0.3 s.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Simula `size²` puntos (16 384 por defecto, hasta 65 536) y dibuja las palabras en local. Sin WebGL2 con texturas float utiliza unos 1800 puntos en Canvas2D; sin canvas mantiene el HTML visible.
|
|
6
6
|
|
|
7
7
|
Vive en la entrada opcional `@yewdiel21/motion-kit/gl`, así las páginas sin él no cargan sus shaders.
|
|
8
8
|
|
|
@@ -6,16 +6,14 @@ import { warnOnce, type Instance } from '../../core/types';
|
|
|
6
6
|
import { fullscreenVertex, pointsFragment, pointsVertex, simulationFragment } from './shaders';
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
|
-
*
|
|
9
|
+
* particle-hero: a cloud of points simulated on the GPU (two RGBA32F
|
|
10
10
|
* textures, position + velocity, ping-pong) that settles on the zero lines of a
|
|
11
11
|
* shifting interference pattern — Chladni modes from [3, 5, 7] every 6–12 s, a
|
|
12
12
|
* frequency of 20–45 every 5–10 s, a distortion tween of 1.2–3 s — while part of
|
|
13
13
|
* the points (40–80 %, eased) leave to draw a word, then return. The pointer
|
|
14
14
|
* pushes them away in proportion to its speed. It fades in over 1 s after 0.3 s.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
* smaller own implementation (size² points, 16 384 by default) with words drawn
|
|
18
|
-
* locally. Without WebGL2 float targets it falls back to ~1800 points on a 2D
|
|
16
|
+
* Simulates size² points (16 384 by default), with words drawn locally. Without WebGL2 float targets it falls back to ~1800 points on a 2D
|
|
19
17
|
* canvas; with no canvas at all it does nothing. Reduced motion draws one still
|
|
20
18
|
* frame. The canvas is decorative (aria-hidden): the hero's text lives in HTML.
|
|
21
19
|
*/
|
|
@@ -89,7 +87,7 @@ function random(seed: number) {
|
|
|
89
87
|
};
|
|
90
88
|
}
|
|
91
89
|
|
|
92
|
-
/** Points sampled from the dark pixels of a word drawn on a 640 × 320 canvas (
|
|
90
|
+
/** Points sampled from the dark pixels of a word drawn on a 640 × 320 canvas (default: red < 120). */
|
|
93
91
|
function wordMask(word: string, count: number, rng: () => number) {
|
|
94
92
|
const result = new Float32Array(count * 4);
|
|
95
93
|
const canvas = document.createElement('canvas');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Shaders for the particle hero. Own GLSL
|
|
2
|
+
* Shaders for the particle hero. Own GLSL: state texture XY = position,
|
|
3
3
|
* ZW = velocity; the simulation pulls each point toward the zero lines of a
|
|
4
4
|
* radial / grid / square field mixed with a Chladni plate (four Newton-like
|
|
5
5
|
* projections, step .4) or toward a word, and pushes it away from the pointer.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# shader-blur
|
|
2
2
|
|
|
3
|
-
Desenfoque direccional de siete muestras por shader
|
|
3
|
+
Desenfoque direccional de siete muestras por shader.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
import { createShaderBlur } from '@yewdiel21/motion-kit/gl';
|
|
@@ -18,6 +18,6 @@ Controles: `setProgress(0..1)`, `setAmount(0..100)`, `pause()`, `resume()`, `mod
|
|
|
18
18
|
|
|
19
19
|
Pausa fuera de pantalla y con pestaña oculta. Movimiento reducido: frame fijo, con controles manuales. Sin WebGL, error de textura o contexto perdido: canvas oculto, HTML original disponible. Contexto restaurado: recompila y vuelve a cargar texturas. Destroy libera texturas, buffer, shaders y programa, desconecta observers y restaura la clase original.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Aplica siete muestras con pesos.19648255/.29690696/.09447040/.01038136 y offsets 1.41176471/3.29411765/5.17647059. `amount` vale 5 píxeles de la imagen por defecto; el progreso rota la dirección de horizontal a vertical. `amount` 0 conserva la imagen.
|
|
22
22
|
|
|
23
|
-
Desde 0.9.0.
|
|
23
|
+
Desde 0.9.0.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# shader-grain
|
|
2
2
|
|
|
3
|
-
Grano de película animado por shader, intensidad
|
|
3
|
+
Grano de película animado por shader, intensidad.07.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
import { createShaderGrain } from '@yewdiel21/motion-kit/gl';
|
|
@@ -18,6 +18,6 @@ Controles: `setProgress(0..1)`, `setAmount(0..100)`, `pause()`, `resume()`, `mod
|
|
|
18
18
|
|
|
19
19
|
Pausa fuera de pantalla y con pestaña oculta. Movimiento reducido: frame fijo, con controles manuales. Sin WebGL, error de textura o contexto perdido: canvas oculto, HTML original disponible. Contexto restaurado: recompila y vuelve a cargar texturas. Destroy libera texturas, buffer, shaders y programa, desconecta observers y restaura la clase original.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Genera ruido con semilla temporal a 24 Hz e intensidad.07 por defecto. `amount` 0 conserva la imagen. Con movimiento reducido mantiene un frame fijo.
|
|
22
22
|
|
|
23
|
-
Desde 0.9.0.
|
|
23
|
+
Desde 0.9.0.
|
package/src/index.ts
CHANGED
|
@@ -175,3 +175,28 @@ export {
|
|
|
175
175
|
type ToastAction,
|
|
176
176
|
} from './components/toast/store';
|
|
177
177
|
export { createIsland, type IslandOptions, type IslandInstance } from './components/island/engine';
|
|
178
|
+
export { createQuantity, type QuantityOptions, type QuantityInstance } from './components/quantity/engine';
|
|
179
|
+
export { createPagination, type PaginationOptions, type PaginationInstance } from './components/pagination/engine';
|
|
180
|
+
export { createHoverCard, type HoverCardOptions, type HoverCardInstance } from './components/hover-card/engine';
|
|
181
|
+
export { createInputOtp, type InputOtpOptions, type InputOtpInstance } from './components/input-otp/engine';
|
|
182
|
+
export { createJoinedCta, type JoinedCtaOptions, type JoinedCtaInstance } from './recipes/joined-cta/create-joined-cta';
|
|
183
|
+
export { createImageZoom, type ImageZoomOptions, type ImageZoomInstance } from './recipes/image-zoom/create-image-zoom';
|
|
184
|
+
export { createFontCycle, type FontCycleOptions, type FontCycleInstance } from './recipes/font-cycle/create-font-cycle';
|
|
185
|
+
export { createThumbnailNav, type ThumbnailNavOptions, type ThumbnailNavInstance } from './recipes/thumbnail-nav/create-thumbnail-nav';
|
|
186
|
+
export { createActionButton, type ActionButtonOptions, type ActionButtonInstance } from './recipes/action-button/create-action-button';
|
|
187
|
+
export { createFilmHero, type FilmHeroOptions, type FilmHeroInstance } from './recipes/film-hero/create-film-hero';
|
|
188
|
+
export { createEditorialReveal, type EditorialRevealOptions, type EditorialRevealInstance } from './recipes/editorial-reveal/create-editorial-reveal';
|
|
189
|
+
export { createStudioDock, type StudioDockOptions, type StudioDockInstance } from './components/studio-dock/engine';
|
|
190
|
+
export { createTrailer, type TrailerOptions, type TrailerInstance } from './components/trailer/engine';
|
|
191
|
+
export type { FontCycleFace } from './recipes/font-cycle/create-font-cycle';
|
|
192
|
+
export type { ActionButtonVariant } from './recipes/action-button/create-action-button';
|
|
193
|
+
export type { StudioDockState, StudioDockView } from './components/studio-dock/engine';
|
|
194
|
+
export { createCalendar, type CalendarOptions, type CalendarInstance } from './components/calendar/engine';
|
|
195
|
+
export { createSlotPicker, type SlotPickerOptions, type SlotPickerInstance } from './components/slot-picker/engine';
|
|
196
|
+
export type { CalendarEvent, CalendarEventStatus, CalendarRange, CalendarView, CalendarLabels } from './components/calendar/engine';
|
|
197
|
+
export type { SlotSource, SlotValue, SlotPickerLabels } from './components/slot-picker/engine';
|
|
198
|
+
export { dayKey, toDate, type DateInput } from './core/dates';
|
|
199
|
+
export { createWeightHover, type WeightHoverOptions, type WeightHoverInstance } from './recipes/weight-hover/create-weight-hover';
|
|
200
|
+
export { createSticker, type StickerOptions, type StickerInstance, type StickerState } from './recipes/sticker/create-sticker';
|
|
201
|
+
export { createScrollDock, type ScrollDockOptions, type ScrollDockInstance } from './recipes/scroll-dock/create-scroll-dock';
|
|
202
|
+
export { createLocalClock, type LocalClockOptions, type LocalClockInstance } from './recipes/local-clock/create-local-clock';
|
package/src/motion/chat.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { TIMING } from '../core/timing';
|
|
|
4
4
|
import { splitWords } from '../core/split';
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
|
-
*
|
|
7
|
+
* chat (PrettyChat): new bubbles grow from their speaker's side
|
|
8
8
|
* (scale .5, 24 px blur, 0.7 s, 60 ms apart) while their words rise into place
|
|
9
9
|
* (16 px, 6 px blur, 0.25 s, 50 ms apart, back.out). Words are split only for
|
|
10
10
|
* the animation; tables and code stay whole; if splitting would reflow the text
|
|
@@ -76,7 +76,7 @@ export function fitComposer(field: HTMLTextAreaElement, min = 64) {
|
|
|
76
76
|
return gsap.to(field, { height: to, duration: TIMING.composer, ease: 'power2.out', overwrite: 'auto' });
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
/** Scroll a conversation to its newest message
|
|
79
|
+
/** Scroll a conversation to its newest message. */
|
|
80
80
|
export function scrollToLatest(scroller: HTMLElement) {
|
|
81
81
|
const top = scroller.scrollHeight - scroller.clientHeight;
|
|
82
82
|
if (reduced()) {
|
package/src/motion/confetti.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { reduced } from '../core/reduced';
|
|
|
2
2
|
import { TIMING } from '../core/timing';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
*
|
|
5
|
+
* success confetti: 45 paper pieces burst from a point (2–8 px a
|
|
6
6
|
* frame, a little upward), fall with gravity .15, slow by .98 a frame, spin and
|
|
7
7
|
* fade (.015–.03 a frame). Physics per 60 fps frame, scaled by the real frame
|
|
8
8
|
* time. The canvas is decorative and removes itself when the last piece fades.
|
package/src/motion/count.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { TIMING } from '../core/timing';
|
|
|
4
4
|
import { requestFrame } from '../core/frame';
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
|
-
* Numbers that count to their new value:
|
|
7
|
+
* Numbers that count to their new value: animated number (`numberSoft`,
|
|
8
8
|
* 0.6 s; 0.7 s on prices) and the onboarding's revealed balance (rAF, 0.9 s,
|
|
9
9
|
* ease-out cubic). Both continue from the value currently shown.
|
|
10
10
|
*/
|
package/src/motion/details.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { reduced } from '../core/reduced';
|
|
|
3
3
|
import { TIMING } from '../core/timing';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
*
|
|
6
|
+
* Details: a disclosure grows to its content's height while the
|
|
7
7
|
* content fades in, and folds back to its summary (0.32 s, signature). A
|
|
8
8
|
* `[data-mk-chevron]` inside the summary turns 180° in 0.25 s.
|
|
9
9
|
*/
|
|
@@ -3,7 +3,7 @@ import { reduced } from '../core/reduced';
|
|
|
3
3
|
import { TIMING } from '../core/timing';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
*
|
|
6
|
+
* modal drag: a surface follows a drag (or a pull
|
|
7
7
|
* with the wheel) at half speed and shrinks as it goes down (1 − y/400); past
|
|
8
8
|
* 100 px it is dismissed, otherwise it springs back (elastic.out(.5,.5), 0.5 s).
|
|
9
9
|
* A drag starts after 6 px, ignores controls, scrollable areas that can still
|
package/src/motion/effects.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TIMING } from '../core/timing';
|
|
|
3
3
|
import { warnOnce } from '../core/types';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
* Play
|
|
6
|
+
* Play utility animations (css/effects/anim.css) from code: animate()
|
|
7
7
|
* restarts one even when it is already playing and resolves when it ends;
|
|
8
8
|
* leave() plays an exit and then removes (or hides) the element.
|
|
9
9
|
*/
|
package/src/motion/entrances.ts
CHANGED
package/src/motion/floating.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { reduced } from '../core/reduced';
|
|
|
3
3
|
import { TIMING } from '../core/timing';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
*
|
|
6
|
+
* floating modal: on desktop (≥ 680 px) a handle
|
|
7
7
|
* lifts a surface into a window that moves on a spring (1100/38, mass by area),
|
|
8
8
|
* glides when flung (≥ 350 px/s, decays in 0.18 s), stays inside the viewport
|
|
9
9
|
* (8 px margin), resizes from its corners (min 320 × 240) and remembers where it
|
package/src/motion/flow.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { nextFrame } from '../core/frame';
|
|
|
5
5
|
import { clearStyles } from '../core/styles';
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
*
|
|
8
|
+
* flowIn / flowOut: items drop in from 20 px above out of a 16 px blur,
|
|
9
9
|
* 0.5 s, 50 ms apart (`flowSoft`), and leave 20 px down into the same blur.
|
|
10
10
|
* Style 2 grows them from 90 % instead of moving them.
|
|
11
11
|
*/
|
|
@@ -98,7 +98,7 @@ export function flowOut(targets: gsap.TweenTarget, options: FlowOutOptions = {})
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* step change: the current children flow out, `mutate` swaps the
|
|
102
102
|
* content (render the next step there), and after a frame the new children flow in.
|
|
103
103
|
*/
|
|
104
104
|
export async function stepChange(
|
package/src/motion/indicator.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { reduced } from '../core/reduced';
|
|
|
3
3
|
import { TIMING } from '../core/timing';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
*
|
|
6
|
+
* Tabs: the indicator fits the selected option's box in 0.45 s
|
|
7
7
|
* on the signature curve (Flip.fit in the original; here the same box is
|
|
8
8
|
* tweened directly). The indicator is an absolutely positioned child at 0,0 of
|
|
9
9
|
* the group. A scrolling group centres the selected option.
|
package/src/motion/layout.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { reduced } from '../core/reduced';
|
|
|
3
3
|
import { TIMING } from '../core/timing';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
*
|
|
6
|
+
* layout reflow: items that changed place travel there on a spring
|
|
7
7
|
* (0.62 s, ratio .52) and new ones grow in (scale .94, in 60 % of the time).
|
|
8
8
|
* Capture before the DOM change, reflow after it; items pair by `data-flip-id`.
|
|
9
9
|
* Don't make the items `position: absolute` — the list would collapse.
|
package/src/motion/liquid.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { TIMING } from '../core/timing';
|
|
|
4
4
|
import { transparentColor } from './surface';
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
|
-
*
|
|
7
|
+
* liquid modal: the opener's colour melts into the
|
|
8
8
|
* surface. Two blobs (one on the opener, one with the surface's shape) sit under
|
|
9
9
|
* a "goo" filter (blur 20, alpha threshold 19·a − 9), so while the surface's
|
|
10
10
|
* blob swings out of the opener on a spring (144/14, kick 2400 px/s) they
|
package/src/motion/morph.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { liquidClose, liquidOpen } from './liquid';
|
|
|
6
6
|
import { backdropVeil, ghostOf, transparentColor } from './surface';
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
|
-
* Container transform
|
|
9
|
+
* Container transform: a surface
|
|
10
10
|
* (dialog, menu, option list) grows out of the control that opened it and folds
|
|
11
11
|
* back into it. The surface itself is never scaled: it starts clipped to the
|
|
12
12
|
* opener's size and corners, moved onto the opener, and widens to its own box
|
|
@@ -460,7 +460,7 @@ export function morphClose(surface: HTMLElement, origin: HTMLElement | null, onC
|
|
|
460
460
|
if (parts.length) {
|
|
461
461
|
timeline
|
|
462
462
|
.to(parts, { ...group, duration, ease: toward }, 0)
|
|
463
|
-
//
|
|
463
|
+
// Rounds the content toward a 400 px radius while it fades and blurs.
|
|
464
464
|
.to(parts, { opacity: 0, borderRadius: '400px', duration, ease: EASE.fadeAway }, 0)
|
|
465
465
|
.to(parts, { filter: 'blur(32px)', duration, ease: EASE.blurAway }, 0);
|
|
466
466
|
}
|
package/src/motion/reveal.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { pointer } from '../core/pointer';
|
|
|
4
4
|
import { TIMING } from '../core/timing';
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
|
-
*
|
|
7
|
+
* reveal: a veil in the
|
|
8
8
|
* surface's own colour covers it and a round opening grows from the origin,
|
|
9
9
|
* uncovering the content like a wave; then the veil fades. Overshoot 2 lets the
|
|
10
10
|
* opening pass the far corner halfway through, so the end is soft.
|
package/src/motion/sheet.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { TIMING } from '../core/timing';
|
|
|
6
6
|
import { backdropVeil, ghostOf } from './surface';
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
|
-
*
|
|
9
|
+
* project sheet: the surface rises from below the screen (0.72 s,
|
|
10
10
|
* cubic(.16,1,.3,1)) while the page behind ([data-mk-underlay]) sinks to
|
|
11
11
|
* scale .98 / opacity .4 on a 300/30 spring. It closes through an inert copy
|
|
12
12
|
* that drops away, so focus returns at once.
|
package/src/motion/surface.ts
CHANGED
|
@@ -28,7 +28,7 @@ export function closeModal(dialog: DialogLike) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* Fade a modal <dialog>'s ::backdrop in (
|
|
31
|
+
* Fade a modal <dialog>'s ::backdrop in (tint: 0.5 s on the signature
|
|
32
32
|
* curve) or out (linear). Resolves at once without the Web Animations API.
|
|
33
33
|
*/
|
|
34
34
|
export function fadeBackdrop(dialog: HTMLElement, direction: 'in' | 'out'): Promise<void> {
|
|
@@ -7,13 +7,13 @@ export interface AnimatedNumberProps {
|
|
|
7
7
|
value: number;
|
|
8
8
|
/** How the shown value is written. Default: whole numbers. */
|
|
9
9
|
format?: (shown: number) => string;
|
|
10
|
-
/** Seconds. Default 0.6
|
|
10
|
+
/** Seconds. Default 0.6; prices use 0.7. */
|
|
11
11
|
duration?: number;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const whole = (shown: number) => String(Math.round(shown));
|
|
15
15
|
|
|
16
|
-
/** A number that counts to each new value from the one shown
|
|
16
|
+
/** A number that counts to each new value from the one shown. */
|
|
17
17
|
export function AnimatedNumber({ value, format = whole, duration }: AnimatedNumberProps) {
|
|
18
18
|
const [shown, setShown] = useState(value);
|
|
19
19
|
const current = useRef(value);
|
package/src/react/flip-group.tsx
CHANGED
|
@@ -14,7 +14,7 @@ export interface FlipGroupProps {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* Plays
|
|
17
|
+
* Plays layout reflow when `signature` changes: the layout is
|
|
18
18
|
* measured just before React commits and the items travel from there. A class
|
|
19
19
|
* component, because only `getSnapshotBeforeUpdate` reads the DOM before the commit.
|
|
20
20
|
*/
|
package/src/react/frost.tsx
CHANGED
|
@@ -12,7 +12,7 @@ export interface FrostProps {
|
|
|
12
12
|
style?: CSSProperties;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
/**
|
|
15
|
+
/** progressive frost: five blur layers. Put it inside a positioned container (or use `fixed`). */
|
|
16
16
|
export function Frost({ position = 'bottom', fixed = false, height, strength, className, style }: FrostProps) {
|
|
17
17
|
const vars: Record<string, string> = {};
|
|
18
18
|
if (height !== undefined) vars['--mk-frost-height'] = typeof height === 'number' ? `${height}px` : height;
|
package/src/react/index.ts
CHANGED
|
@@ -78,3 +78,24 @@ export { confetti, type ConfettiOptions } from '../motion/confetti';
|
|
|
78
78
|
export { MK_HEAD_SCRIPT } from '../core/reduced';
|
|
79
79
|
export { MK_THEME_HEAD_SCRIPT, themeHeadScript } from '../theme/theme';
|
|
80
80
|
export { Island, IslandDots, type IslandProps, type IslandPanel } from '../components/island/react';
|
|
81
|
+
export { Quantity, type QuantityProps } from '../components/quantity/react';
|
|
82
|
+
export { Pagination, type PaginationProps } from '../components/pagination/react';
|
|
83
|
+
export { HoverCard, type HoverCardProps } from '../components/hover-card/react';
|
|
84
|
+
export { InputOtp, type InputOtpProps } from '../components/input-otp/react';
|
|
85
|
+
export { useJoinedCta } from './use-joined-cta';
|
|
86
|
+
export { useImageZoom } from './use-image-zoom';
|
|
87
|
+
export { useFontCycle } from './use-font-cycle';
|
|
88
|
+
export { useThumbnailNav } from './use-thumbnail-nav';
|
|
89
|
+
export { useActionButton } from './use-action-button';
|
|
90
|
+
export { useFilmHero } from './use-film-hero';
|
|
91
|
+
export { useEditorialReveal } from './use-editorial-reveal';
|
|
92
|
+
export { useStudioDock } from './use-studio-dock';
|
|
93
|
+
export { useTrailer } from './use-trailer';
|
|
94
|
+
export { StudioDock, type StudioDockProps } from '../components/studio-dock/react';
|
|
95
|
+
export { Trailer, type TrailerProps } from '../components/trailer/react';
|
|
96
|
+
export { Calendar, type CalendarProps } from '../components/calendar/react';
|
|
97
|
+
export { SlotPicker, type SlotPickerProps } from '../components/slot-picker/react';
|
|
98
|
+
export { useWeightHover } from './use-weight-hover';
|
|
99
|
+
export { useSticker } from './use-sticker';
|
|
100
|
+
export { useScrollDock } from './use-scroll-dock';
|
|
101
|
+
export { useLocalClock } from './use-local-clock';
|
package/src/react/slot-text.tsx
CHANGED
|
@@ -12,7 +12,7 @@ export interface SlotTextProps extends Omit<SlotTextOptions, 'text' | 'accessibl
|
|
|
12
12
|
const escapeHtml = (text: string) => text.replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`);
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Text whose letters roll when it changes
|
|
15
|
+
* Text whose letters roll when it changes. The server
|
|
16
16
|
* renders the text itself; React never reconciles the letters (they belong to
|
|
17
17
|
* the recipe), and screen readers read the plain copy.
|
|
18
18
|
*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { DependencyList, RefObject } from 'react';
|
|
3
|
+
import { useRecipe } from './use-recipe';
|
|
4
|
+
import { createActionButton, type ActionButtonOptions } from '../recipes/action-button/create-action-button';
|
|
5
|
+
export const useActionButton = (ref: RefObject<HTMLElement | null>, options?: ActionButtonOptions, deps?: DependencyList) =>
|
|
6
|
+
useRecipe(ref, createActionButton, options, deps);
|
|
@@ -4,6 +4,6 @@ import type { DependencyList, RefObject } from 'react';
|
|
|
4
4
|
import { useRecipe } from './use-recipe';
|
|
5
5
|
import { createCardDock, type CardDockOptions } from '../recipes/card-dock/create-card-dock';
|
|
6
6
|
|
|
7
|
-
/**
|
|
7
|
+
/** product dock (stacked glass cards that spread on hover). */
|
|
8
8
|
export const useCardDock = (ref: RefObject<HTMLElement | null>, options?: CardDockOptions, deps?: DependencyList) =>
|
|
9
9
|
useRecipe(ref, createCardDock, options, deps);
|
package/src/react/use-cascade.ts
CHANGED
|
@@ -4,6 +4,6 @@ import type { DependencyList, RefObject } from 'react';
|
|
|
4
4
|
import { useRecipe } from './use-recipe';
|
|
5
5
|
import { createCascade, type CascadeOptions } from '../recipes/cascade/create-cascade';
|
|
6
6
|
|
|
7
|
-
/**
|
|
7
|
+
/** reveal group: rules, fades and rises one after another. */
|
|
8
8
|
export const useCascade = (ref: RefObject<HTMLElement | null>, options?: CascadeOptions, deps?: DependencyList) =>
|
|
9
9
|
useRecipe(ref, createCascade, options, deps);
|
|
@@ -4,6 +4,6 @@ import type { DependencyList, RefObject } from 'react';
|
|
|
4
4
|
import { useRecipe } from './use-recipe';
|
|
5
5
|
import { createContrast, type ContrastOptions } from '../recipes/contrast/create-contrast';
|
|
6
6
|
|
|
7
|
-
/**
|
|
7
|
+
/** header contrast from the section under it. */
|
|
8
8
|
export const useContrast = (ref: RefObject<HTMLElement | null>, options?: ContrastOptions, deps?: DependencyList) =>
|
|
9
9
|
useRecipe(ref, createContrast, options, deps);
|
|
@@ -4,6 +4,6 @@ import type { DependencyList, RefObject } from 'react';
|
|
|
4
4
|
import { useRecipe } from './use-recipe';
|
|
5
5
|
import { createDepthGrid, type DepthGridOptions } from '../recipes/depth-grid/create-depth-grid';
|
|
6
6
|
|
|
7
|
-
/**
|
|
7
|
+
/** grid gathering from depth as it scrolls. */
|
|
8
8
|
export const useDepthGrid = (ref: RefObject<HTMLElement | null>, options?: DepthGridOptions, deps?: DependencyList) =>
|
|
9
9
|
useRecipe(ref, createDepthGrid, options, deps);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { DependencyList, RefObject } from 'react';
|
|
3
|
+
import { useRecipe } from './use-recipe';
|
|
4
|
+
import { createEditorialReveal, type EditorialRevealOptions } from '../recipes/editorial-reveal/create-editorial-reveal';
|
|
5
|
+
export function useEditorialReveal(ref: RefObject<HTMLElement | null>, options: EditorialRevealOptions = {}, deps?: DependencyList) {
|
|
6
|
+
return useRecipe(ref, createEditorialReveal, options, deps);
|
|
7
|
+
}
|
|
@@ -4,6 +4,6 @@ import type { DependencyList, RefObject } from 'react';
|
|
|
4
4
|
import { useRecipe } from './use-recipe';
|
|
5
5
|
import { createFillText, type FillTextOptions } from '../recipes/fill-text/create-fill-text';
|
|
6
6
|
|
|
7
|
-
/**
|
|
7
|
+
/** fill-text: letters fill in as the text scrolls up. */
|
|
8
8
|
export const useFillText = (ref: RefObject<HTMLElement | null>, options?: FillTextOptions, deps?: DependencyList) =>
|
|
9
9
|
useRecipe(ref, createFillText, options, deps);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { DependencyList, RefObject } from 'react';
|
|
3
|
+
import { useRecipe } from './use-recipe';
|
|
4
|
+
import { createFilmHero, type FilmHeroOptions } from '../recipes/film-hero/create-film-hero';
|
|
5
|
+
export const useFilmHero = (ref: RefObject<HTMLElement | null>, options?: FilmHeroOptions, deps?: DependencyList) =>
|
|
6
|
+
useRecipe(ref, createFilmHero, options, deps);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import type { DependencyList, RefObject } from 'react';
|
|
3
|
+
import { useRecipe } from './use-recipe';
|
|
4
|
+
import { createFontCycle, type FontCycleOptions } from '../recipes/font-cycle/create-font-cycle';
|
|
5
|
+
|
|
6
|
+
export const useFontCycle = (ref: RefObject<HTMLElement | null>, options?: FontCycleOptions, deps?: DependencyList) =>
|
|
7
|
+
useRecipe(ref, createFontCycle, options, deps);
|