File: D:/HostingSpaces/SBogers10/conmeq.komma.pro/resources/sass/site/5-Components/_components.hero.scss
// Component settings: Hero
// ------------------------------------------
$c-hero: (
'hero-bgcolor-1': palette(primary),
'hero-bgcolor-2': palette(primary, 2),
'caption-bgcolor': palette(primary, 2),
'caption-color': palette(light),
'right-bgcolor-ratio': 63%,
);
// ------------------------------------------
.c-hero {
// Commented out because these break the alternative hero styling
//position: relative;
//z-index: 0;
@include mq(m) {
@include contain;
}
}
.c-hero__main {
position: relative;
background-color: palette(light);
}
.c-hero__slider {
overflow: hidden;
position: relative;
padding-bottom: 55.556%; // Ratio used for mobile image
@include mq(m, l) {
padding-bottom: 50%; // Ratio used for image
}
}
.c-hero__picture {
position: absolute;
top: 0;
left: 0;
opacity: 0;
transition-property: opacity, filter;
transition-duration: 500ms;
transition-timing-function: linear;
filter: blur(5px);
&.is-active {
opacity: 1;
transform: translateY(0) scale(1);
filter: none;
}
}
.c-hero__image {
width: 100%;
}
.c-hero__caption {
@include hyphenate;
@include font-size(xxxl);
position: relative;
padding: space(3);
line-height: 1.16;
text-align: center;
color: map-get($c-hero, 'caption-color');
background-color: map-get($c-hero, 'caption-bgcolor');
pointer-events: none;
// When viewport is very small scale font-size smaller too
@include mq($max: s) {
font-size: 13vw;
}
@include mq(m) {
position: absolute;
top: 50%;
max-width: column(8);
padding: space(4);
text-align: left;
}
// Font-lock to scale font-size proportionally
@include mq(m, l) {
max-width: column(6, 10);
padding: 2.6vw; // Magic value so text scales nicely
font-size: 4.2vw; // Magic value so text scales nicely
}
@include mq(l) {
@include font-size(xxxxl);
padding-left: column(0.5);
}
}
.c-hero__controls {
position: absolute;
bottom: 0;
right: 0;
width: 100%;
padding: space(1);
&::before {
content: '';
position: absolute;
bottom: 0;
left: 0;
height: space(6);
width: 100%;
background: linear-gradient(to top, black, transparent);
opacity: 0.3;
}
}
// Button with arrow that scrolls down
.c-hero__scroll {
@include mq($max: m) {
display: none;
}
@include flex(center center);
position: absolute;
bottom: 0;
left: 50%;
width: 40px;
height: 40px;
padding: 10px;
color: palette(light);
background-color: palette(secondary);
border-radius: 100%;
transform: translate(-50%, 50%) rotate(0.25turn);
transition: background-color 200ms;
& > svg {
transition: transform 200ms;
}
&:hover {
cursor: pointer;
background: mix(palette(secondary), black, 90%);
& > svg {
transform: translateX(3px);
}
}
&:focus {
outline: none;
background: mix(palette(secondary), black, 90%);
box-shadow: 0 0 0 3px palette(light);
}
}
/*
* Alternative version of the hero element
* Comment out when needed
*/
//.c-hero--alternative {
//
// // Top background color
// &::before {
// top: 0;
// bottom: 0;
// width: 50vw;
// background: linear-gradient(
// to bottom,
// map-get($c-hero, 'hero-bgcolor-1') 50%,
// map-get($c-hero, 'hero-bgcolor-2') 50%,
// map-get($c-hero, 'hero-bgcolor-2') 81.5%,
// transparent 81.5% );
// }
//
// // Bottom Right background color
// &::after {
// content: '';
// position: absolute;
// z-index: -1;
// top: 0;
// right: 0;
// bottom: 0;
// left: 50vw;
// background: linear-gradient(
// to bottom,
// map-get($c-hero, 'hero-bgcolor-1') map-get($c-hero, 'right-bgcolor-ratio'),
// map-get($c-hero, 'hero-bgcolor-2') map-get($c-hero, 'right-bgcolor-ratio'));
// }
//
// .c-hero__caption {
// // Bottom Left background color
// &::before {
// content: '';
// position: absolute;
// z-index: -1;
// top: 0;
// right: 0;
// bottom: 0;
// left: -50vw;
// background-color: map-get($c-hero, 'hero-bgcolor-2');
// }
// }
//}