Skip to content

Commit

Permalink
Center hero image on blog posts
Browse files Browse the repository at this point in the history
Signed-off-by: Eduard Itrich <eduard.itrich@porsche.de>
on-behalf-of: @porscheofficial <open_source_office@porsche.de>
  • Loading branch information
itrich committed Dec 18, 2023
1 parent 0077a7a commit 90c33e6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion content/blog/porsche-digital-campus.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ author:
description: The Porsche Digital Campus is an innovative initiative with the goal of bringing together research and real-world application in the fields of AI, machine learning, and data science.
image: https://uploads-ssl.webflow.com/6419a4c2c9609e21b02a47e8/6454e539d4ea54c08e42aedb_Frame%2010683.png
slug: https://campus.porsche.digital/
readTime: 5min
readTime: 3min
---

<ImageText imageSrc="/assets/blog/pdc/team.jpg" imageAlt="Porsche Digital Campus" theme="light"
Expand Down
3 changes: 2 additions & 1 deletion src/app/blog/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ const BlogPage: React.FC<PageProps> = ({ params }: PageProps) => {
description={description}
subtitle="FOSS@Porsche"
imageSrc={blog.image}
imageAlt=""
imageAlt="Hero Image"
position="center center"
/>

<Section spacing="none">
Expand Down
3 changes: 3 additions & 0 deletions src/components/03_organisms/heroSection/HeroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface HeroSectionProps {
description?: string;
imageSrc: string | StaticImageData;
imageAlt: string;
position?: string;
}

export const HeroSection: React.FC<HeroSectionProps> = ({
Expand All @@ -21,12 +22,14 @@ export const HeroSection: React.FC<HeroSectionProps> = ({
description,
imageSrc,
imageAlt,
position = "right center",
}) => {
return (
<div className={s["hero-container"]}>
<div className={s["background-image-container"]}>
<ExportedImage
className={s["hero-image"]}
style={{ objectPosition: position }}
src={imageSrc}
alt={imageAlt}
fill
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@

.background-image-container {
grid-row: 1;
height: 50rem;
@include pds-media-query-min("m") {
height: 50rem;
}
height: 40rem;
position: relative;

.hero-image {
object-fit: cover;
object-position: right center;
}
.image-overlay {
background: linear-gradient(
Expand Down

0 comments on commit 90c33e6

Please sign in to comment.