1use super::theme::{MOON_EMOJI, ramadan_green};
2
3const ANSI_SHADOW: &str = r#"
4██████╗ █████╗ ███╗ ███╗ █████╗ ██████╗ █████╗ ███╗ ██╗
5██╔══██╗██╔══██╗████╗ ████║██╔══██╗██╔══██╗██╔══██╗████╗ ██║
6██████╔╝███████║██╔████╔██║███████║██║ ██║███████║██╔██╗ ██║
7██╔══██╗██╔══██║██║╚██╔╝██║██╔══██║██║ ██║██╔══██║██║╚██╗██║
8██║ ██║██║ ██║██║ ╚═╝ ██║██║ ██║██████╔╝██║ ██║██║ ╚████║
9╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝
10"#;
11
12const ANSI_COMPACT: &str = r#"
13██████ █████ ███ ███ █████ ██████ █████ ███ ██
14██ ██ ██ ██ ████ ████ ██ ██ ██ ██ ██ ██ ████ ██
15██████ ███████ ██ ████ ██ ███████ ██ ██ ███████ ██ ██ ██
16██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
17██ ██ ██ ██ ██ ██ ██ ██ ██████ ██ ██ ██ ████
18"#;
19
20pub fn get_banner() -> String {
21 let width = std::env::var("COLUMNS")
22 .ok()
23 .and_then(|v| v.parse::<usize>().ok())
24 .unwrap_or(80);
25
26 let art = if width >= 120 {
27 ANSI_SHADOW
28 } else {
29 ANSI_COMPACT
30 };
31 let lead = ramadan_green(&format!(" {MOON_EMOJI} Ramadan CLI"));
32 let tag = " Sehar • Iftar • Ramadan timings";
33 format!("\n{}\n{}\n{}\n", ramadan_green(art.trim_end()), lead, tag)
34}