From 75d01adf02e6edb9a660644811b259a09fbe2dbf Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 25 Mar 2023 12:14:05 -0700 Subject: [PATCH] Added greeting --- src/main.rs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/main.rs b/src/main.rs index 2361ce3..38f7cbe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,6 +15,43 @@ use crate::parser::Token; //use crate::parser::LineLocation; +/* + ###### @@@@@@ + # ##@@ @ + ## #@ @@ + #@@@@@@@@@@@# + @@ @# ## + @ @@## # + @@@@@@ ###### + + Mariposa 0.0.1 +*/ +#[inline(always)] +fn draw_greeter(stdout: &mut RawTerminal) -> Result<(), std::io::Error> { + write!( + stdout, + "\n \ + {a} ###### {b} @@@@@@\r\n \ + {a}# ##{b}@@ @\r\n \ + {a}## #{b}@ @@\r\n \ + {a} #{b}@@@@@@@@@@@{a}#\r\n \ + {b}@@ @{a}# ##\r\n \ + {b}@ @@{a}## #\r\n \ + {b} @@@@@@ {a} ###### {r}\r\n \ + \n \ + {t}Mariposa{r} {v}0.0.1{r}\r\n\n", + a = color::Fg(color::Magenta), + b = color::Fg(color::White), + t = format!("{}{}", color::Fg(color::White), style::Bold), + v = format!("{}{}", color::Fg(color::White), style::Italic), + + r = format!("{}{}", color::Fg(color::Reset), style::Reset), + )?; + + return Ok(()); +} + + fn draw_line( stdout: &mut RawTerminal, s: &String, @@ -46,6 +83,8 @@ fn draw_line( fn main() -> Result<(), std::io::Error> { let mut stdout = stdout().into_raw_mode().unwrap(); + draw_greeter(&mut stdout)?; + //let size = termion::terminal_size().unwrap(); //write!(stdout, "{:?}", size).unwrap();