mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-24 02:36:00 +00:00
| .. | ||
| __tests__ | ||
| .gitignore | ||
| babel.config.js | ||
| index.ts | ||
| package.json | ||
| parser.ts | ||
| README.md | ||
| tsconfig.json | ||
Install
yarn add ani-cursor
or
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");