Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kiwamizamurai/scrambling-ascii-art
Scambling text for acsii-art
https://github.com/kiwamizamurai/scrambling-ascii-art
ascii-art scramble scrambling-letters
Last synced: 1 day ago
JSON representation
Scambling text for acsii-art
- Host: GitHub
- URL: https://github.com/kiwamizamurai/scrambling-ascii-art
- Owner: kiwamizamurai
- License: mit
- Created: 2024-12-29T03:39:30.000Z (10 days ago)
- Default Branch: main
- Last Pushed: 2024-12-29T04:06:41.000Z (10 days ago)
- Last Synced: 2024-12-29T04:07:51.026Z (10 days ago)
- Topics: ascii-art, scramble, scrambling-letters
- Language: TypeScript
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Scrambling ASCII Art
![NPM Version](https://img.shields.io/npm/v/scrambling-ascii-art)
![NPM Downloads](https://img.shields.io/npm/dm/scrambling-ascii-art)
[![CI](https://github.com/kiwamizamurai/scrambling-ascii-art/actions/workflows/ci.yml/badge.svg)](https://github.com/kiwamizamurai/scrambling-ascii-art/actions/workflows/ci.yml)A TypeScript library for creating scrambling ASCII art animations with optional React support.
## Features
- 🎨 ASCII art scrambling animation
- ⚛️ React component support
- 🎮 Customizable animation speed and scale
- 📦 Zero dependencies
- 💪 TypeScript support
- 🌐 Browser compatible## Installation
```bash
npm install scrambling-ascii-art
```## Usage
### Vanilla JavaScript/TypeScript
```typescript
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();
```### React Component
```tsx
import { AsciiScramble } from 'scrambling-ascii-art/react';function App() {
const art = [
" ∧_∧ ",
" (。・ω・) ",
"⊂ ノ ",
" しーJ ",
];return (
console.log('Animation completed')}
/>
);
}
```## API Reference
### AsciiScramble Options
| 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 |### Methods
| Method | Return Type | Description |
|--------|-------------|-------------|
| scramble() | Promise | Start scrambling animation |
| stop() | void | Stop current animation |## Contributing
Contributions are welcome! Feel free to submit a Pull Request.
## License
MIT License - see [LICENSE](LICENSE) file for details