2025-11-09 03:00:20 +01:00
|
|
|
mod animation;
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
mod cli;
|
|
|
|
|
mod color;
|
2025-11-09 03:00:20 +01:00
|
|
|
mod figlet;
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
mod parser;
|
|
|
|
|
mod utils;
|
|
|
|
|
|
|
|
|
|
use anyhow::Result;
|
|
|
|
|
use clap::Parser;
|
2025-11-09 03:00:20 +01:00
|
|
|
use cli::PigletCli;
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
|
async fn main() -> Result<()> {
|
|
|
|
|
// Parse CLI arguments
|
|
|
|
|
let args = PigletCli::parse();
|
2025-11-09 03:00:20 +01:00
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
// Show banner on first run
|
|
|
|
|
if std::env::args().len() == 1 {
|
|
|
|
|
show_welcome();
|
|
|
|
|
return Ok(());
|
|
|
|
|
}
|
2025-11-09 03:00:20 +01:00
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
// Verify figlet is installed
|
|
|
|
|
figlet::FigletWrapper::check_installed()?;
|
2025-11-09 03:00:20 +01:00
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
// Run the piglet magic
|
|
|
|
|
run_piglet(args).await?;
|
2025-11-09 03:00:20 +01:00
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async fn run_piglet(args: PigletCli) -> Result<()> {
|
|
|
|
|
use crate::animation::AnimationEngine;
|
|
|
|
|
use crate::color::ColorEngine;
|
|
|
|
|
use crate::utils::terminal::TerminalManager;
|
2025-11-09 03:00:20 +01:00
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
// Parse duration
|
|
|
|
|
let duration_ms = parser::duration::parse_duration(&args.duration)?;
|
2025-11-09 03:00:20 +01:00
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
// Create figlet wrapper and render base ASCII art
|
|
|
|
|
let figlet = figlet::FigletWrapper::new()
|
|
|
|
|
.with_font(args.font.as_deref())
|
|
|
|
|
.with_args(args.figlet_args);
|
2025-11-09 03:00:20 +01:00
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
let ascii_art = figlet.render(&args.text)?;
|
2025-11-09 03:00:20 +01:00
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
// Setup color engine
|
|
|
|
|
let color_engine = ColorEngine::new()
|
2025-11-09 03:00:20 +01:00
|
|
|
.with_palette(args.color_palette.as_deref())?
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
.with_gradient(args.color_gradient.as_deref())?;
|
2025-11-09 03:00:20 +01:00
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
// Setup animation engine
|
2025-11-09 03:00:20 +01:00
|
|
|
let animation_engine = AnimationEngine::new(ascii_art, duration_ms, args.fps)
|
|
|
|
|
.with_effect(&args.motion_effect)?
|
|
|
|
|
.with_easing(&args.motion_ease)?
|
|
|
|
|
.with_color_engine(color_engine);
|
|
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
// Setup terminal
|
|
|
|
|
let mut terminal = TerminalManager::new()?;
|
|
|
|
|
terminal.setup()?;
|
2025-11-09 03:00:20 +01:00
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
// Run animation
|
|
|
|
|
loop {
|
2025-11-09 07:08:24 +01:00
|
|
|
let user_exited = animation_engine.run(&mut terminal).await?;
|
2025-11-09 03:00:20 +01:00
|
|
|
|
2025-11-09 07:08:24 +01:00
|
|
|
// If user pressed exit key, stop looping
|
|
|
|
|
if user_exited {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If not looping, stop after one animation
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
if !args.loop_animation {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-11-09 03:00:20 +01:00
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
// Cleanup
|
|
|
|
|
terminal.cleanup()?;
|
2025-11-09 03:00:20 +01:00
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn show_welcome() {
|
2025-11-09 03:00:20 +01:00
|
|
|
println!(
|
|
|
|
|
r"
|
|
|
|
|
____ _ __ __
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
/ __ \(_)___ _/ /__ / /_
|
|
|
|
|
/ /_/ / / __ `/ / _ \/ __/
|
2025-11-09 03:00:20 +01:00
|
|
|
/ ____/ / /_/ / / __/ /_
|
|
|
|
|
/_/ /_/\__, /_/\___/\__/
|
|
|
|
|
/____/
|
|
|
|
|
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
🐷 Piglet - Animated Figlet Wrapper
|
|
|
|
|
|
|
|
|
|
Usage: piglet [TEXT] [OPTIONS]
|
|
|
|
|
|
|
|
|
|
Examples:
|
2025-11-09 03:00:20 +01:00
|
|
|
piglet Hello -p red,blue,green
|
|
|
|
|
piglet World -g linear-gradient(90deg, red, blue) -e fade-in
|
|
|
|
|
piglet Cool! -e typewriter -d 2s -i ease-out
|
Initial commit: Piglet - Animated figlet wrapper
Add complete Rust implementation with:
- 20+ motion effects (fade, slide, scale, typewriter, wave, bounce, etc.)
- 18+ easing functions (linear, quad, cubic, elastic, back, bounce)
- Color support (CSS4 colors, hex codes, gradients)
- Figlet integration with custom fonts and options
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive CI/CD workflows
- Full test suite with integration tests
- Documentation (README.md, CLAUDE.md)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 01:53:26 +01:00
|
|
|
|
|
|
|
|
Run 'piglet --help' for more information.
|
2025-11-09 03:00:20 +01:00
|
|
|
"
|
|
|
|
|
);
|
|
|
|
|
}
|