A TypeScript library for creating scrambling ASCII art animations with optional React support.
- 🎨 ASCII art scrambling animation
- ⚛️ React component support
- 🎮 Customizable animation speed and scale
- 📦 Zero dependencies
- 💪 TypeScript support
- 🌐 Browser compatible
npm install scrambling-ascii-art
import { AsciiScrambleEngine } from 'scrambling-ascii-art';
const container = document.querySelector('#container');
const art = [
" ∧_∧ ",
" (。・ω・) ",
"⊂ ノ ",
" しーJ ",
];
const scrambler = new AsciiScrambleEngine(container, {
art: art,
speed: 80, // Optional: animation speed (default: 40)
scale: 100 // Optional: display scale in percentage (default: 100)
});
// Start animation
scrambler.scramble().then(() => {
console.log('Animation completed!');
});
// Stop animation if needed
scrambler.stop();
import { AsciiScramble } from 'scrambling-ascii-art/react';
function App() {
const art = [
" ∧_∧ ",
" (。・ω・) ",
"⊂ ノ ",
" しーJ ",
];
return (
<AsciiScramble
art={art}
speed={80}
scale={100}
onComplete={() => console.log('Animation completed')}
/>
);
}
Option | Type | Default | Description |
---|---|---|---|
art | string[] | Required | ASCII art as array of strings |
speed | number | 40 | Animation speed (higher is slower) |
scale | number | 100 | Display scale in percentage |
Method | Return Type | Description |
---|---|---|
scramble() | Promise | Start scrambling animation |
stop() | void | Stop current animation |
Contributions are welcome! Feel free to submit a Pull Request.
MIT License - see LICENSE file for details