Skip to content

Commit

Permalink
feat: optimize home hero image
Browse files Browse the repository at this point in the history
  • Loading branch information
SidonieBouthors committed Oct 18, 2024
1 parent e97011b commit ad21648
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import InfoBox from "@/components/InfoBox";
import ExportedImage from "next-image-export-optimizer";

export default function Home() {
return (
<>
<div className="home-hero">
<ExportedImage
className="home-hero-image"
src="/home-hero.jpg"
alt="Hero image"
fill={true}
/>
<h1>Welcome to my website!</h1>
<div className="subtitle">Recipes, projects & more</div>
</div>
Expand Down
9 changes: 8 additions & 1 deletion styles/pages/_home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@
@use "sass:map";

.home-hero {
background-image: url(/home-hero.jpg);
background-color: rgba(0, 0, 0, 0.5);
background-blend-mode: overlay;
background-size: cover;
background-position: center;
padding: 0.5em;
height: 90vh;

position: relative;

display: flex;
flex-direction: column;
justify-content: center;
align-items: center;

.home-hero-image {
object-fit: cover;
pointer-events: none;
z-index: -1;
}

h1 {
font-family: $font-black;
font-size: 3rem;
Expand Down

0 comments on commit ad21648

Please sign in to comment.