gallery/src/components/sections/FullBleedSection.astro

110 lines
2.1 KiB
Plaintext

---
interface Props {
image: string;
title: string;
description: string;
align: 'left' | 'right' | 'center';
}
const { image, title, description, align } = Astro.props;
---
<section class="full-bleed-section fade-in-section" data-align={align}>
<div class="full-bleed-image-wrapper">
<img src={image} alt={title} loading="lazy" />
</div>
<div class="full-bleed-content">
<h2>{title}</h2>
<p>{description}</p>
</div>
</section>
<style>
.full-bleed-section {
position: relative;
height: 100vh;
overflow: hidden;
opacity: 0;
transform: translateY(50px);
transition: opacity 0.8s ease, transform 0.8s ease;
}
.full-bleed-section.visible {
opacity: 1;
transform: translateY(0);
}
.full-bleed-image-wrapper {
position: absolute;
inset: 0;
}
.full-bleed-image-wrapper img {
width: 100%;
height: 100%;
object-fit: cover;
}
.full-bleed-image-wrapper::after {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(
to bottom,
rgba(0, 0, 0, 0.2) 0%,
rgba(0, 0, 0, 0.6) 100%
);
}
.full-bleed-content {
position: relative;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
padding: 4rem;
color: white;
z-index: 1;
}
.full-bleed-section[data-align="left"] .full-bleed-content {
align-items: flex-start;
text-align: left;
}
.full-bleed-section[data-align="right"] .full-bleed-content {
align-items: flex-end;
text-align: right;
}
.full-bleed-section[data-align="center"] .full-bleed-content {
align-items: center;
text-align: center;
}
.full-bleed-content h2 {
font-size: clamp(2.5rem, 6vw, 4rem);
font-weight: 700;
margin-bottom: 1rem;
max-width: 600px;
}
.full-bleed-content p {
font-size: clamp(1.1rem, 2vw, 1.5rem);
font-weight: 300;
max-width: 500px;
line-height: 1.6;
}
@media (max-width: 768px) {
.full-bleed-content {
padding: 2rem;
}
.full-bleed-section[data-align="right"] .full-bleed-content {
align-items: flex-start;
text-align: left;
}
}
</style>