Skip to content

Commit

Permalink
resolves #35: Recreate blog title display to be more visible
Browse files Browse the repository at this point in the history
  • Loading branch information
PetoMPP committed Feb 13, 2024
1 parent 3b66dc5 commit d43e88d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/input.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@
.grid-cols-auto-2 {
grid-template-columns: auto auto;
}

.aspect-1-1 {
aspect-ratio: 1 / 1;
}

.divider-base-content {
@apply before:bg-base-content after:bg-base-content;
}
}
20 changes: 16 additions & 4 deletions src/pages/blog_post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::{
pages::page_base::PageBase,
router::route::Route,
};
use chrono::{DateTime, Local};
use petompp_web_models::models::blog_data::BlogMetaData;
use yew::{platform::spawn_local, prelude::*};
use yew_router::prelude::*;
Expand Down Expand Up @@ -118,12 +119,23 @@ pub fn blog_post_meta(props: &BlogPostMetaProps) -> Html {
"" => "/img/placeholder.svg".to_string(),
img => BlobClient::get_url(format!("image-upload/{}", img).as_str()),
};
let sign = format!(
"{} by {}",
DateTime::<Local>::from(props.meta.created).format("%Y-%m-%d %H:%M:%S"),
"PetoMPP"
);
html! {
<div class={"hero mb-4 md:pt-36 pt-16 rounded-lg p-2"} style={format!("background-image: url({}); -webkit-mask-image: -webkit-linear-gradient(top, rgba(0,0,0,0),rgba(0,0,0,0.8));", img)}>
<div class={"prose text-neutral text-center max-w-md"}>
<h1 class={"text-neutral"}>{&props.meta.title}</h1>
<p>{&props.meta.summary}</p>
<>
<div class={"hero mb-4 py-12 lg:py-16 rounded-lg p-2"} style={format!("background-image: url({});", img)}>
<div class={"flex p-4 lg:w-1/2 text-base-content font-semibold text-center text-xl lg:text-4xl aspect-1-1 bg-base-100 bg-opacity-60 rounded-full items-center"}>
<div>
<div class={"divider divider-base-content w-5/6 mx-auto"} />
<p class={"px-6 lg:px-12"}>{&props.meta.title}</p>
<div class={"divider divider-base-content w-5/6 mx-auto"} />
</div>
</div>
</div>
<p class={"italic text-lg"}>{sign}</p>
</>
}
}

0 comments on commit d43e88d

Please sign in to comment.