npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

warm-motion

v0.1.0

Published

Tasteful, reduced-motion-aware React interaction primitives — cursor spotlight, magnetic hover, scroll reveals, view transitions.

Downloads

126

Readme

warm-motion

Tasteful, reduced-motion-aware React interaction primitives — a cursor spotlight, magnetic hover, scroll reveals, and view-transition helpers. Extracted from marekzska.space — the site runs on it.

Pre-release: packaged and publish-ready, but not yet on the npm registry. The API below is stable.

  • Accessible by default — every effect honours prefers-reduced-motion and bails on coarse (touch) pointers, so you never ship a dead hover affordance.
  • Owns its physics — the magnetic pull is clamped and spring-smoothed in JS (no reliance on a CSS transition), and its rAF loop idles when settled.
  • Tiny & tree-shakeable — ~1.5 kB gzipped, ESM + CJS, react/react-dom/ framer-motion are peer deps.

Install

npm i warm-motion
// once, near your app root:
import 'warm-motion/styles.css'

Peer dependencies: react >=18, react-dom >=18, framer-motion >=11.

API

useSpotlight(options?)

Tracks the cursor into the --mx / --my CSS variables on :root and toggles a spotlight-live class. Combined with the stylesheet, it lights up any element with the .lit class.

useSpotlight() // options: { lerp?, staticX?, staticY? }

<h1 className="lit">Lit by the cursor</h1>

Map your text colours onto the spotlight:

:root {
  --wm-spotlight-from: #ede6e0; /* bright */
  --wm-spotlight-to:   #8a7e7e; /* dim   */
}

useMagnetic(options?) → ref

Attracts an element toward the cursor once it enters an activation radius. The pull is clamped (maxOffset) and both follow and snap-back are spring-smoothed.

const ref = useMagnetic<HTMLAnchorElement>({ strength: 0.35, radius: 140, maxOffset: 12 })
<a ref={ref} href="…">Contact</a>

<Reveal>

Fades (and optionally rises) children into view once, when scrolled near. Renders a plain wrapper with no animation under reduced motion.

<Reveal delay={0.08} rise>
  <p>…</p>
</Reveal>

withViewTransition(update)

Runs update inside a View Transition when supported, synchronously otherwise, and skips the transition entirely under reduced motion.

withViewTransition(() => flushSync(() => setTheme('dark')))

Constants

EASE, REVEAL_DURATION, REVEAL_RISE, REVEAL_STAGGER — the shared timing the primitives use, exported so your own motion can match.

Behaviour matrix

| Condition | useSpotlight | useMagnetic | Reveal | | --- | --- | --- | --- | | reduced motion | static fallback vars | inert | no animation | | coarse pointer | static fallback vars | inert | animates on scroll |

Versioning

Semantic versioning. The public surface is:

  • the named JS exports above;
  • the CSS custom properties --wm-spotlight-from, --wm-spotlight-to, and --spotlight-radius (spotlight size, default 30rem);
  • the --mx / --my cursor variables written by useSpotlight (read them for your own cursor-driven effects);
  • the .lit and .spotlight-live class names.

These names are intentionally generic — if they collide with your app, scope the stylesheet or override them.

License

MIT