AltoCode
Rimella

HTML
<!-- ============================================ -->
<!-- Hero -->
<!-- ============================================ -->
<section id="hero-997">
<div class="cs-container">
<div class="cs-content">
<span class="cs-topper">Colazioni da gustare</span>
<h1 class="cs-title"><span class="cs-color">Inizia</span> La Giornata Con Sapori Freschi</h1>
<p class="cs-text">
Profumo di caffè, prodotti appena sfornati e un’atmosfera accogliente. La colazione è un momento speciale, da vivere con calma e con il gusto di ciò che è preparato con cura.
</p>
<div class="cs-button-box">
<a href="" class="cs-button-solid">Esplora di più</a>
<a href="" class="cs-button-transparent">Scopri di più</a>
</div>
</div>
</div>
<picture class="cs-background">
<source media="(max-width: 600px)" srcset="https://csimg.nyc3.cdn.digitaloceanspaces.com/Images/People/landing-m.jpg">
<source media="(min-width: 601px)" srcset="https://csimg.nyc3.cdn.digitaloceanspaces.com/Images/People/landing.jpg">
<img loading="lazy" decoding="async" src="https://csimg.nyc3.cdn.digitaloceanspaces.com/Images/People/landing.jpg" alt="ristorante" width="1920" height="1200" aria-hidden="true">
</picture>
</section>
CSS
/*-- -------------------------- -->
<--- Hero -->
<--- -------------------------- -*/
/* Mobile - 360px */
@media only screen and (min-width: 0rem) {
#hero-997 {
padding: clamp(12.5rem, 25.95vw, 18.75rem) 1rem 0;
padding-bottom: clamp(6.25rem, 25.95vw, 15.625rem);
position: relative;
z-index: 1;
overflow: hidden;
}
#hero-997 .cs-container {
width: 100%;
max-width: 80rem;
margin: auto;
position: relative;
display: flex;
flex-direction: column;
align-items: flex-start;
gap: clamp(6.25rem, 25vw, 12.5rem);
}
#hero-997 .cs-content {
width: 100%;
max-width: 59.6875rem;
display: flex;
justify-content: flex-start;
flex-direction: column;
align-items: flex-start;
box-sizing: border-box;
}
#hero-997 .cs-topper {
font-size: clamp(0.8125rem, 1.6vw, 1rem);
line-height: 1.2em;
white-space: nowrap;
text-transform: uppercase;
text-align: left;
letter-spacing: 0.1rem;
font-weight: 700;
width: 100%;
color: var(--bodyTextColorWhite);
margin-bottom: 1.75rem;
display: flex;
align-items: center;
justify-content: flex-start;
gap: 1.25rem;
position: relative;
}
#hero-997 .cs-topper:after {
content: "";
width: 50%;
max-width: 7.5rem;
height: 1px;
background: currentColor;
opacity: 1;
position: relative;
display: block;
}
#hero-997 .cs-title {
font-size: clamp(2.4375rem, 6.4vw, 5rem);
font-weight: 900;
line-height: 1.2em;
text-align: left;
width: 100%;
max-width: 20ch;
margin: 0 0 2rem 0;
color: var(--bodyTextColorWhite);
position: relative;
}
#hero-997 .cs-color {
color: var(--primary);
}
#hero-997 .cs-text {
font-size: clamp(1rem, 1.95vw, 1.25rem);
line-height: 1.5em;
text-align: left;
width: 100%;
max-width: 39.375rem;
margin: 0 0 2rem 0;
color: var(--bodyTextColorWhite);
}
#hero-997 .cs-button-box {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-items: center;
gap: 1.25rem;
}
#hero-997 .cs-button-solid {
text-align: center;
font-size: 1rem;
line-height: clamp(2.875rem, 5.5vw, 3.5rem);
width: 11.25rem;
text-decoration: none;
font-weight: 700;
margin: 0;
color: #fff;
padding: 0;
background-color: var(--primary);
display: inline-block;
position: relative;
z-index: 1;
transition: color 0.3s;
}
#hero-997 .cs-button-solid:before {
content: "";
position: absolute;
display: block;
height: 100%;
width: 0%;
background: #fff;
opacity: 1;
top: 0;
left: 0;
z-index: -1;
transition: width 0.3s;
}
#hero-997 .cs-button-solid:hover {
color: #1a1a1a;
}
#hero-997 .cs-button-solid:hover:before {
width: 100%;
}
#hero-997 .cs-button-transparent {
font-size: 1rem;
line-height: clamp(2.875rem, 5.5vw, 3.5rem);
width: 11.25rem;
height: clamp(2.875rem, 5.5vw, 3.5rem);
text-decoration: none;
font-weight: 700;
margin: 0;
color: #fff;
padding: 0;
background-color: transparent;
border: 1px solid var(--bodyTextColorWhite);
box-sizing: border-box;
display: inline-flex;
justify-content: center;
align-items: center;
position: relative;
z-index: 1;
transition: color / 3s;
}
#hero-997 .cs-button-transparent:before {
content: "";
position: absolute;
display: block;
background: #fff;
opacity: 1;
top: -1px;
left: -1px;
right: -1px;
bottom: -1px;
z-index: -1;
transform-origin: left;
transform: scaleX(0);
transition: transform 0.3s;
}
#hero-997 .cs-button-transparent:hover {
color: #1a1a1a;
}
#hero-997 .cs-button-transparent:hover:before {
transform: scaleX(1);
}
#hero-997 .cs-background {
width: 100%;
height: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
z-index: -2;
}
#hero-997 .cs-background:before {
content: "";
width: 100%;
height: 100%;
background: linear-gradient(
41deg,
rgba(26, 26, 26, 0.9) 30%,
rgba(26, 26, 26, 0.3) 100%
);
opacity: 1;
position: absolute;
display: block;
top: 0;
left: 0;
z-index: 1;
pointer-events: none;
}
#hero-997 .cs-background img {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
object-fit: cover;
}
}
/* Parallax Effect - 1300px */
@media only screen and (min-width: 81.25rem) {
#hero-997 {
background: url("https://csimg.nyc3.cdn.digitaloceanspaces.com/Images/People/landing.jpg");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
}
#hero-997 .cs-background img {
display: none;
}
}