<div class="banner ">
<picture>
<source media="(max-width: 600px)" srcset="/assets/example-content/womens-hero-600.png">
<source media="(min-width: 600px)" srcset="/assets/example-content/womens-hero.png">
<img src="/assets/example-content/womens-hero.png" alt="">
</picture>
<div class="hero-overlay left-align">
<div class="hero-overlay--gradient"></div>
<div class="hero-overlay__content">
<div class="hero-overlay__tag">Tag for content</div>
<h1 class="hero-overlay__title">
Lorem ipsum dolor sit amet, consectetur adipiscing elit
</h1>
<div class="hero-overlay__subtitle">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
</div>
<div class="hero-overlay__cta-btn">
<a class="cta cta--tertiary cta--inline" href="/">Button cta</a>
</div>
</div>
</div>
</div>
Both the hero image banner and the image on the hero video banner have the same logic:
{
"smallimage": "/assets/example-content/womens-hero-600.png",
"bigimage": "/assets/example-content/womens-hero.png",
"overlay": {
"xlstyle": true,
"left-align": true
},
"with-overlay": true
}
.banner {
position: relative;
img {
// used for smaller devices
height: 640px;
object-fit: cover;
object-position: center;
max-height: 700px;
width: 100%;
}
@media screen and (min-width: 1200px) {
img {
height: 100%;
}
}
&--gradient {
position: relative;
&::after {
background: linear-gradient(
180deg,
rgba(var(--brand-primary-rgb), 0) 0%,
rgba(var(--brand-primary-rgb), 0.14) 54.17%,
var(--brand-primary) 94.79%
);
bottom: 0;
content: '';
display: block;
height: 100%;
position: absolute;
top: 0;
width: 100%;
}
}
}
<div class="banner {{#if stylemodifier}}banner--{{stylemodifier}}{{/if}} {{#if modifier}}banner--{{modifier}}{{/if}}">
<picture>
<source media="(max-width: 600px)" srcset="{{smallimage}}">
<source media="(min-width: 600px)" srcset="{{bigimage}}">
<img src="{{bigimage}}" alt="">
</picture>
{{#if with-overlay}}
{{render '@hero-overlay' overlay merge="true"}}
{{/if}}
</div>