@chryb/asciidance
v1.2.0
Published
A beautiful ASCII art animation library with customizable noise patterns and effects.
Downloads
175
Readme
AsciiDance
A beautiful ASCII art animation library with customizable noise patterns and effects.
Live Demo
🎬 View Live Demo on GitHub Pages
Features
- 🌊 Fluid ASCII art animations using noise patterns
- 🎨 Customizable color palettes and visual effects
- ⚡ High-performance Canvas-based rendering
- 📱 Responsive design with mobile support
- ♿ Accessibility features (respects
prefers-reduced-motion) - 🎛️ Runtime configuration options
- 📦 Zero runtime dependencies
Usage
Basic Usage (ESM)
import AsciiDance from '@chryb/asciidance'
const canvas = document.getElementById('ascii-canvas') as HTMLCanvasElement
const asciiField = new AsciiDance(canvas)
asciiField.start()With Custom Options
import { AsciiField } from '@chryb/asciidance'
const canvas = document.getElementById('ascii-canvas') as HTMLCanvasElement
const asciiField = new AsciiField(canvas, {
bg: '#000000',
fg: '#00ff00',
palette: ' .:-=+*#%@',
speed: 0.02,
fontPx: 14,
})
asciiField.start()API
Constructor
new AsciiField(canvas: HTMLCanvasElement, options?: Partial<AsciiFieldOptions>)Methods
start()- Start the animation loopstop()- Stop the animation loopdestroy()- Clean up and destroy the instanceupdate(options: Partial<AsciiFieldOptions>)- Update options at runtimeresize()- Force resize (useful when container size changes)
Installation
npm install @chryb/asciidanceAsciiDance has zero runtime dependencies. The packages in this repo are for development, testing, and publishing only.
Development
# Install dependencies
npm install
# Build the library
npm run build
# Run in development mode
npm run dev
# Run tests
npm testContributing
Contributions are welcome.
- Fork the repository and create a feature branch.
- Make your changes and include tests when possible.
- Run
npm run buildandnpm test. - Open a pull request with a clear description and test notes.
GitHub Pages Setup
This repository is configured for automatic deployment to GitHub Pages:
- The
index.htmlfile in the root serves as the GitHub Pages entry point - GitHub Actions automatically builds and deploys on every push to
main - The live demo is available at: https://biering.github.io/asciidance
License
MIT
