Complete piglet implementation with animations and effects
- Implement complete animation system with 20+ motion effects - Add 18+ easing functions (quad, cubic, elastic, back, bounce) - Implement color system with palette and gradient support - Add parser for durations, colors, and CSS gradients - Create comprehensive test suite (14 tests passing) - Add linting and formatting with clippy/rustfmt - Support for figlet integration with custom fonts - Terminal rendering with crossterm - Fix all clippy warnings and lint issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,13 +3,13 @@ use crossterm::style::Color as CrosstermColor;
|
||||
|
||||
pub fn apply_color_to_char(ch: char, color: Color) -> String {
|
||||
use crossterm::style::Stylize;
|
||||
|
||||
|
||||
let crossterm_color = CrosstermColor::Rgb {
|
||||
r: color.r,
|
||||
g: color.g,
|
||||
b: color.b,
|
||||
};
|
||||
|
||||
|
||||
format!("{}", ch.to_string().with(crossterm_color))
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ pub fn apply_color_to_line(line: &str, colors: &[Color]) -> String {
|
||||
if colors.is_empty() {
|
||||
return line.to_string();
|
||||
}
|
||||
|
||||
|
||||
line.chars()
|
||||
.enumerate()
|
||||
.map(|(i, ch)| {
|
||||
@@ -34,14 +34,14 @@ pub fn apply_color_to_line(line: &str, colors: &[Color]) -> String {
|
||||
pub fn apply_gradient_to_text(text: &str, colors: &[Color]) -> String {
|
||||
let lines: Vec<&str> = text.lines().collect();
|
||||
let total_chars: usize = lines.iter().map(|l| l.chars().count()).sum();
|
||||
|
||||
|
||||
if total_chars == 0 || colors.is_empty() {
|
||||
return text.to_string();
|
||||
}
|
||||
|
||||
|
||||
let mut result = String::new();
|
||||
let mut char_index = 0;
|
||||
|
||||
|
||||
for (line_idx, line) in lines.iter().enumerate() {
|
||||
for ch in line.chars() {
|
||||
if ch.is_whitespace() {
|
||||
@@ -53,11 +53,11 @@ pub fn apply_gradient_to_text(text: &str, colors: &[Color]) -> String {
|
||||
char_index += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if line_idx < lines.len() - 1 {
|
||||
result.push('\n');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user