Make hero full-width background
Refactored HeroSection to render a full-width, edge-to-edge background using the section itself, applied cover sizing and center positioning, and added a semi-transparent overlay. Updated structure to remove per-element background divs and rely on section styling for the image. X-Lovable-Edit-ID: edt-86270d43-16fa-4fba-8a5e-4570c4a2c1af
This commit is contained in:
@@ -3,17 +3,20 @@ import heroBakeryImage from "@/assets/hero-bakery.jpg";
|
|||||||
|
|
||||||
const HeroSection = () => {
|
const HeroSection = () => {
|
||||||
return (
|
return (
|
||||||
<section className="relative flex flex-col justify-center items-center text-center py-16 pt-20 pb-12 overflow-visible">
|
<section
|
||||||
{/* Background image with opacity - full viewport width */}
|
className="relative flex flex-col justify-center items-center text-center min-h-[70vh] w-screen"
|
||||||
<div
|
style={{
|
||||||
className="pointer-events-none absolute inset-y-0 left-1/2 w-screen -translate-x-1/2 bg-cover bg-center opacity-40"
|
backgroundImage: `url(${heroBakeryImage})`,
|
||||||
style={{ backgroundImage: `url(${heroBakeryImage})` }}
|
backgroundSize: 'cover',
|
||||||
/>
|
backgroundPosition: 'center',
|
||||||
<div
|
backgroundRepeat: 'no-repeat',
|
||||||
className="pointer-events-none absolute inset-y-0 left-1/2 w-screen -translate-x-1/2 bg-background/60"
|
backgroundColor: '#8b5a2b'
|
||||||
/>
|
}}
|
||||||
|
>
|
||||||
|
{/* Overlay for opacity effect */}
|
||||||
|
<div className="absolute inset-0 bg-background/60" />
|
||||||
|
|
||||||
<div className="animate-fade-up max-w-4xl relative z-10 px-6">
|
<div className="animate-fade-up max-w-4xl relative z-10 px-6 py-16">
|
||||||
<img
|
<img
|
||||||
src={logoImage}
|
src={logoImage}
|
||||||
alt="Lennart Svensson Konditorivaror"
|
alt="Lennart Svensson Konditorivaror"
|
||||||
|
|||||||
Reference in New Issue
Block a user