diff --git a/src/data.rs b/src/data.rs index 9340b66..af91751 100644 --- a/src/data.rs +++ b/src/data.rs @@ -2,7 +2,7 @@ use serde::Deserialize; use std::fmt::{self, Display, Write}; use time::Date; -use crate::SETS_BY_NAME; +use crate::{IMG_HOST, SETS_BY_NAME}; #[derive(Debug, Deserialize, PartialEq, Eq, Clone)] pub struct CardInfo { @@ -80,7 +80,18 @@ impl Card { impl Display for Card { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, r#"

{}


"#, &self.name)?; + write!( + f, + r#"

{} {}

"#, + &self.name, + match self.banlist_info.map(|bi| bi.ban_tcg) { + Some(BanlistStatus::Banned) => format!(r#""#, IMG_HOST.as_str()), + Some(BanlistStatus::Limited) => format!(r#""#, IMG_HOST.as_str()), + Some(BanlistStatus::SemiLimited) => + format!(r#""#, IMG_HOST.as_str()), + _ => String::new(), + } + )?; if let Some(level) = self.level { if self.card_type.contains("XYZ") { f.write_str("Rank ")?; diff --git a/static/forbidden.svg b/static/forbidden.svg new file mode 100644 index 0000000..5383ffd --- /dev/null +++ b/static/forbidden.svg @@ -0,0 +1 @@ +forbidden \ No newline at end of file diff --git a/static/limited.svg b/static/limited.svg new file mode 100644 index 0000000..0224669 --- /dev/null +++ b/static/limited.svg @@ -0,0 +1 @@ +limited \ No newline at end of file diff --git a/static/semi_limited.svg b/static/semi_limited.svg new file mode 100644 index 0000000..9a8b612 --- /dev/null +++ b/static/semi_limited.svg @@ -0,0 +1 @@ +semi2 \ No newline at end of file diff --git a/static/style.css b/static/style.css index ceaa3fd..26f5103 100644 --- a/static/style.css +++ b/static/style.css @@ -72,20 +72,23 @@ h2 { font-size: 120%; } -img { - box-shadow: 10px 10px var(--bg); -} - .thumb { max-height: 250px; max-width: 30%; float: right; margin: 0 0 0.8em 1.2em; + box-shadow: 10px 10px var(--bg); } .fullimage { width: 30%; float: right; margin: 0 0 1em 1.5em; + box-shadow: 15px 15px var(--bg); +} +.banlist-icon { + height: 15pt; + width: 15pt; + vertical-align: top; } /* * This is a big element that looks and behaves more like a div