MotionScript
module MotionScript| Assembly | Partas.Nacara.Plugins.Motion |
Hovers compiled to a script that plays them with anime.js.
Functions and values
entry (source: AnimeSource) (policy: ReducedMotion) (hovers: Hover list) : string
entry (source: AnimeSource) (policy: ReducedMotion) (hovers: Hover list) : stringThe script that plays the hovers.
A bundled source starts with anime.js's licence notice, as a /*! ... */ comment, then a static import of ./anime.esm.js that names only what the hovers use, for the site's bundler to resolve. A CDN source holds no static import: it loads the module with import() inside an async function, so it runs as a classic script.
A token value is read with getComputedStyle each time a hover starts, never written as var(); where the site does not define the token, its fallback is used.
| Parameter | |
|---|---|
source | Where anime.js comes from. |
policy | What the script does for visitors who ask for reduced motion. |
hovers | The hovers to play. |