scrin 0.1.0

A minimal hello-world demo
use std::io::{self, Write};
use std::thread::sleep;
use std::time::Duration;

use aisling::{Effect, EffectConfig, EffectKind};

fn main() {
    let config = EffectConfig::default()
        .with_duration(28)
        .with_canvas_size(36, 3);

    let effect = Effect::with_config(EffectKind::Wipe, "Hello, World!", config);

    let mut stdout = io::stdout();
    for frame in effect.iter() {
        let _ = write!(
            stdout,
            "\x1b[2J\x1b[H{}\n\nAisling effect page\n",
            frame.to_plain_string()
        );
        let _ = stdout.flush();
        sleep(Duration::from_millis(40));
    }

    let _ = writeln!(stdout, "\x1b[2J\x1b[HDone.\n");
    let _ = writeln!(stdout, "Aisling hello-world page powered by scrin");
    let _ = stdout.flush();
}