use crate::app::Config;
use maud::{html, Markup};
use std::sync::Arc;
pub mod nag;
pub fn xeblog_salary_history(cfg: Arc) -> Markup {
html! {
table.salary_history {
tr {
th { "Title" }
th { "Start Date" }
th { "End Date" }
th { "Days Worked" }
th { "Salary" }
th { "How I Left" }
}
@for job in &cfg.clone().job_history {
(job.pay_history_row())
}
}
}
}
pub fn xeblog_talk_warning() -> Markup {
html! {
div.warning {
(xeblog_conv("Cadey".to_string(), "coffee".to_string(), html!{
"So you are aware: you are reading the written version of a conference talk. This is written in a different style that is more lighthearted, conversational and different than the content normally on this blog. The words being said are the verbatim words that were spoken at the conference. The slides are the literal slides for each spoken utterance. If you want to hide the non-essential slides, please install this userstyle: "
a href="/css/no-fun-allowed.user.css" {code {"No fun allowed"}}
". If this isn't enough, please edit it to also hide this CSS class: "
code { "xeblog-slides-essential" }
". Doing this may make the presentation page harder to understand."
}))
}
}
}
pub fn xeblog_slide(name: String, essential: bool) -> Markup {
html! {
div.hero.{@if essential {("xeblog-slides-essential")} @else {("xeblog-slides-fluff")}} {
picture style="margin:0" {
source type="image/avif" srcset={"https://cdn.xeiaso.net/file/christine-static/talks/" (name) ".avif"};
source type="image/webp" srcset={"https://cdn.xeiaso.net/file/christine-static/talks/" (name) ".webp"};
img style="padding:0" loading="lazy" src={"https://cdn.xeiaso.net/file/christine-static/talks/" (name) "-smol.png"};
}
}
}
}
pub fn xeblog_hero(file: String, prompt: Option, ai: Option) -> Markup {
let ai = ai.unwrap_or("MidJourney".to_string());
html! {
meta property="og:image" content={"https://cdn.xeiaso.net/file/christine-static/hero/" (file) "-smol.png"}
figure.hero style="margin:0" {
picture style="margin:0" {
source type="image/avif" srcset={"https://cdn.xeiaso.net/file/christine-static/hero/" (file) ".avif"};
source type="image/webp" srcset={"https://cdn.xeiaso.net/file/christine-static/hero/" (file) ".webp"};
img style="padding:0" loading="lazy" alt={"hero image " (file)} src={"https://cdn.xeiaso.net/file/christine-static/hero/" (file) "-smol.png"};
}
figcaption {
"Image generated by "
(ai)
@if let Some(prompt) = prompt { " -- " (prompt) }
}
}
}
}
pub fn xeblog_conv(name: String, mood: String, body: Markup) -> Markup {
let name_lower = name.clone().to_lowercase();
html! {
.conversation {
."conversation-picture"."conversation-smol" {
picture {
source type="image/avif" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".avif"};
source type="image/webp" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".webp"};
img alt={(name) " is " (mood)} loading="lazy" src={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".png"};
}
}
."conversation-chat" {
"<"
b { (name) }
"> "
(body)
}
}
}
}
pub fn xeblog_sticker(name: String, mood: String) -> Markup {
let name_lower = name.to_lowercase();
html! {
center {
picture {
source type="image/avif" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".avif"};
source type="image/webp" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".webp"};
img alt={(name) " is " (mood)} src={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".png"};
}
}
}
}