Skip to content

Commit

Permalink
Merge pull request #885 from razzeee/rework-blog-images
Browse files Browse the repository at this point in the history
Contain blogpost image and add a blur behind
  • Loading branch information
razzeee authored Apr 8, 2024
2 parents 9eb8e68 + 1677ba0 commit d979aea
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/components/BlogPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,23 @@ export default function BlogPost(props: { preview?: any; blogPost?: any }) {
>
<div className="max-w-7xl mx-auto">
<div className="relative shadow-xl rounded-2xl overflow-hidden">
<div className="absolute inset-0">
<img
className="h-full w-full object-fill"
src={blogPost.frontmatter.featured_image.src}
title={blogPost.frontmatter.featured_image.title}
alt={blogPost.frontmatter.featured_image.alt}
/>
<div
style={{
backgroundImage: `url('${blogPost.frontmatter.featured_image.src}')`,
backgroundSize: "fill",
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
}}
className="absolute inset-0"
>
<div className="absolute inset-0 backdrop-blur-lg bg-black/10">
<img
className="h-full w-full object-contain"
src={blogPost.frontmatter.featured_image.src}
title={blogPost.frontmatter.featured_image.title}
alt={blogPost.frontmatter.featured_image.alt}
/>
</div>
</div>
<div className="relative px-6 py-40"></div>
</div>
Expand Down

0 comments on commit d979aea

Please sign in to comment.