webamp/packages/ani-cursor
Jordan Eldredge 1db12cfce2 Add missing @types dependencies for ani-cursor
Add @types/jest and @types/node as devDependencies to ani-cursor package.
These were missing but referenced in tsconfig.json, causing TypeScript
compilation failures in CI with pnpm's stricter package isolation.
2025-07-06 13:46:42 -07:00
..
src Avoid blowing the call stack when parsing larg cursor files 2021-01-21 20:10:35 -08:00
.gitignore Pull ani-cursor out into its own package (#1040) 2020-12-09 22:47:50 -08:00
babel.config.js Pull ani-cursor out into its own package (#1040) 2020-12-09 22:47:50 -08:00
CHANGELOG.md Avoid blowing the call stack when parsing larg cursor files 2021-01-21 20:10:35 -08:00
package.json Add missing @types dependencies for ani-cursor 2025-07-06 13:46:42 -07:00
README.md Migrate from yarn to pnpm 2025-07-06 13:20:28 -07:00
tsconfig.json Add missing @types dependencies for ani-cursor 2025-07-06 13:46:42 -07:00

ani-cursor

A library for rendering Windows Animated Cursor files (.ani) in the browser by parsing out the individual frames and constructing a CSS animation.

Built to support .ani files in Winamp skins for https://webamp.org.

I wrote a blog post about this library which you can find here.

Install

npm install ani-cursor

Usage Example

import {convertAniBinaryToCSS} from 'ani-cursor';

async function applyCursor(selector, aniUrl) {
    const response = await fetch(aniUrl);
    const data = new Uint8Array(await response.arrayBuffer());

    const style = document.createElement('style');
    style.innerText = convertAniBinaryToCSS(selector, data);

    document.head.appendChild(style);
}

const h1 = document.createElement('h1');
h1.id = 'pizza';
h1.innerText = 'Pizza Time!';
document.body.appendChild(h1);

applyCursor("#pizza", "https://archive.org/cors/tucows_169906_Pizza_cursor/pizza.ani");

Try the Live Demo on CodeSandbox.