JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 32062
  • Score
    100M100P100Q135410F
  • License MIT

A minimal WebGL2 ESM library for AI-style motion mask animation.

Package Exports

  • ai-motion

Readme

ai-motion

Minimal WebGL2 ESM library for an AI-style border+glow animation. No dependencies. Pure JS for modern browsers.

Demo

Usage

npm i -S ai-motion

API

import { Motion } from 'ai-motion';

const motion = new Motion({
    width: document.documentElement.clientWidth,
    height: document.documentElement.clientHeight,
    styles: {
        position: 'fixed',
        inset: '0',
    }
});

// Mount where you like
document.body.appendChild(motion.element);

// start the animation
motion.start()

// pause the rendering
// motion.pause()

// autoResize to another element
// motion.autoResize(container)

// fade in animation
// motion.fadeIn()

// fade out animation
// motion.fadeOut()

// Later, dispose
// motion.dispose();

Demo

npm i
npm start

Build

npm run build
npm run build:demo

License

MIT License.