diff --git a/Cargo.toml b/Cargo.toml index ed833e3..b351814 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2024" [dependencies] -askama = { version = "0.15.4", features = ["std", "derive"] } +askama = { version = "0.15.4", features = ["std", "derive", "serde_json"] } axum = "0.8.8" chrono = { version = "0.4.44", features = ["serde"] } serde = { version = "1.0.228", features = ["derive"] } diff --git a/content/bibou-quotes.json b/content/bibou-quotes.json new file mode 100644 index 0000000..9b81d64 --- /dev/null +++ b/content/bibou-quotes.json @@ -0,0 +1,17 @@ +[ + "The Oracle of the Bibou doth whisper 'neath the moon's pale gaze.", + "He who doth watch in the shadow, seeth all.", + "Verily, even pixels bear a soul, thus speaketh the Bibou.", + "Dread not the error, for 'tis but the path unto the light.", + "Let thy heart guide thy mouse, O child of the web.", + "Each click be a prayer, and the Oracle doth hear.", + "Rise, and partake of a biscuit, for the road be long.", + "This day, thou shalt walk upon the feather of a dove.", + "The owl doth watch thee. Forget not thine duties.", + "A rain of pixels shall fall this very night.", + "The neighbour’s cat doth conspire. Be wary, O soul.", + "Thy click is not in vain, for the Bibou hath seen thee.", + "Verily, 'tis Monday... and courage thou shalt need.", + "Fear not the dark, for the Bibou lurks there, awaiting food.", + "The Bibou's gaze pierceth the soul..." +] \ No newline at end of file diff --git a/src/domain.rs b/src/domain.rs index 3a4c727..9d9f126 100644 --- a/src/domain.rs +++ b/src/domain.rs @@ -5,6 +5,7 @@ pub struct AppState { pub mp_tracks: Vec, pub p_tracks: Vec, pub website_news: Vec, + pub bibou_quotes: Vec, } impl AppState { @@ -31,6 +32,11 @@ impl AppState { news }, + bibou_quotes: serde_json::from_str( + &std::fs::read_to_string("content/bibou-quotes.json") + .expect("bibou-quotes.json non trouvé"), + ) + .expect("JSON invalide"), } } } diff --git a/src/templates/home.rs b/src/templates/home.rs index d2bef0a..322ad2c 100644 --- a/src/templates/home.rs +++ b/src/templates/home.rs @@ -13,12 +13,14 @@ use crate::domain::{AppState, WebsiteArticle}; struct HomeTemplate<'a> { tracks: &'a Vec, news: &'a Vec, + bibou_quotes: &'a Vec, } #[derive(Template)] #[template(path = "partials/home.html")] struct HomePartialTemplate<'a> { news: &'a Vec, + bibou_quotes: &'a Vec, } pub async fn home(headers: HeaderMap, state: State>) -> impl IntoResponse { @@ -26,6 +28,7 @@ pub async fn home(headers: HeaderMap, state: State>) -> impl IntoR Html( HomePartialTemplate { news: &state.website_news, + bibou_quotes: &state.bibou_quotes, } .render() .unwrap(), @@ -35,6 +38,7 @@ pub async fn home(headers: HeaderMap, state: State>) -> impl IntoR HomeTemplate { tracks: &state.mp_tracks, news: &state.website_news, + bibou_quotes: &state.bibou_quotes, } .render() .unwrap(), diff --git a/static/assets/images/boob_oracle_bg.png b/static/assets/images/boob_oracle_bg.png new file mode 100644 index 0000000..bbdcefa Binary files /dev/null and b/static/assets/images/boob_oracle_bg.png differ diff --git a/static/style.css b/static/style.css index c2655c9..81ef3e3 100644 --- a/static/style.css +++ b/static/style.css @@ -465,6 +465,45 @@ home-content { grid-template-columns: repeat(3, 1fr); gap: 2rem; } + + bibou-oracle { + background-image: url(assets/images/boob_oracle_bg.png); + + bibou-container { + position: relative; + display: block; + width: 100px; + margin: 0 auto; + cursor: pointer; + + img { + width: 100%; + display: block; + } + + &:hover .bibou { + opacity: 1; + } + + .bibou { + position: absolute; + top: 0; + left: 0; + opacity: 0; + } + + &:hover .boubou { + opacity: 0; + } + } + + bibou-text { + font-style: italic; + text-align: center; + } + } + + } &#newsbox { diff --git a/templates/partials/home.html b/templates/partials/home.html index 7101a69..033f0e6 100644 --- a/templates/partials/home.html +++ b/templates/partials/home.html @@ -54,6 +54,14 @@ width="30px" alt="Instagram logo" /> Decorative divider + + + Bibou endormi + Bibou éveillé + + + + @@ -81,9 +89,35 @@ \ No newline at end of file