use std::thread;
use std::time::Duration;
use gilt::console::Console;
use gilt::screen::Screen;
use gilt::style::Style;
use gilt::text::Text;
fn main() {
let mut console = Console::builder()
.width(80)
.height(24)
.force_terminal(true)
.no_color(false)
.build();
console.enter_screen(true);
console.clear();
let mut content = Text::empty();
for _ in 0..8 {
content.append_str("\n", None);
}
let title = format!("{:^80}\n", "Gilt Fullscreen Demo");
content.append_str(&title, Some(Style::parse("bold magenta").unwrap()));
content.append_str(&format!("{:^80}\n", ""), None);
let subtitle = format!("{:^80}\n", "A Rust port of Python's rich library");
content.append_str(&subtitle, Some(Style::parse("italic cyan").unwrap()));
content.append_str(&format!("{:^80}\n", ""), None);
let tagline = format!("{:^80}\n", "Beautiful terminal formatting, blazing fast.");
content.append_str(&tagline, None);
content.append_str(&format!("{:^80}\n", ""), None);
content.append_str(&format!("{:^80}\n", ""), None);
let exit_msg = format!("{:^80}", "Returning to normal screen in 2 seconds...");
content.append_str(&exit_msg, Some(Style::parse("dim").unwrap()));
let screen = Screen::new(content).with_style(Style::parse("on black").unwrap());
console.print(&screen);
thread::sleep(Duration::from_secs(2));
console.exit_screen(true);
println!("Returned to normal screen.");
}