ActionsMotionPause

Open in Create
Search
astronomic.dev

MotionPause

Free

For the one Pause motion button a page with moving parts needs: it stops every marquee and autoplaying video for the visit. Put it in the first marquee.

File
MotionPause.astro
Group
Actions
Kind
Interactive: inline script
Examples
1
import MotionPause from "@astronomic-dev/ui/components/MotionPause.astro";

Examples

Drag the orange handle to set the width. Frames get real breakpoints.

  • Static
  • Interactive
  • Framed

The pause button

One button per page, in the first marquee (pass pause to it), or on its own as here. A press sets data-motion-paused on <html>, which freezes every marquee, stops autoplaying video and turns the motion-ok variant off on the page (as calm does), and keeps the choice for the visit. Put motionScript from @astronomic-dev/ui/lib/motion.ts inline in the page's <head> too: it puts the pause back before the first paint of the next page.

main.astro
Minimal · Light

Waitlist

Be first in line

Join the waitlist and we'll email you the moment it's out.

You'll also get our newsletter: new themes, plugins and guides. Unsubscribe any time.