Menu

Animation

Wraps the Web Animations API — animate returns a Promise that resolves on finished. Fallback applies the final keyframe synchronously.

Web Animations APIPromise

animate

js
await F("#box").animate(
  { opacity: [0, 1], transform: ["translateY(8px)", "translateY(0)"] },
  { duration: 300, easing: "ease-out", fill: "forwards" }
);

// number sugar:
await F("#box").animate({ opacity: [0,1] }, 300);

fadeIn / fadeOut / slide

js
await F("#box").fadeIn(300);   // show + opacity 0→1
await F("#box").fadeOut(300);  // opacity 1→0 + hide
await F("#panel").slideDown(280);
await F("#panel").slideUp(280);
Standalone ESM: import { animate, fadeIn } from "flash.js/animation" for tree-shaking.

Live demo

Storage →

⌕