ldc-volena/resources/sass/fo/base/_common.scss
2024-06-21 16:13:53 +02:00

182 lines
5.5 KiB
SCSS

@use "sass:color";
@use 'sass:map';
$color-primary-light: color.adjust($color-primary, $lightness: 65%);
$color-secondary-light: color.adjust($color-secondary, $lightness: 45%);
$color-tertiary-light: color.adjust($color-tertiary, $lightness: 50%);
$color-quad-light: color.adjust($color-quad, $lightness: 20%);
$color-quint-light: color.adjust($color-quint, $lightness: 40%);
$color-sixt-light: color.adjust($color-sixt, $lightness: 30%);
$light-colors: (
"primary-light": $color-primary-light,
"secondary-light": $color-secondary-light,
"tertiary-light": $color-tertiary-light,
"quad-light": $color-quad-light,
"quint-light": $color-quint-light,
"sixt-light": $color-sixt-light,
);
$theme-colors: map.merge($theme-colors, $light-colors);
.text-inherit {
text-transform: inherit;
}
.anchor-padding {
scroll-margin: calc(#{$header-height} + 1rem);
}
.video-frame {
.video-thumbnail {
height: 100%;
object-fit: cover;
}
.video-play-button {
height: 3rem;
border-radius: 100%;
box-shadow: inset 0 0 0 2px #{$color-tertiary};
}
}
// Rotate arrow svg (base is to the right)
.arrow-left {
transform: rotate(180deg);
}
.arrow-bottom {
transform: rotate(90deg);
}
.arrow-top {
transform: rotate(-90deg);
}
.key-number {
width: 12rem;
height: 12rem;
p {
margin-bottom: 0;
}
}
// Map on all colors
@each $idx, $color in $theme-colors {
// Tilde svg
.tilde-#{$idx} {
@include tilde($color);
height: 2rem;
background-size: 100% 100%;
}
// Text bubbles with the spike at the bottom side
.text-bubble-top-#{$idx}::before,
.text-bubble-left-#{$idx}::before,
.text-bubble-right-#{$idx}::before {
@include text-bubble-top($color);
position: absolute;
z-index: 0;
left: 50%;
width: 12rem;
height: 12rem;
background-size: 100% 100%;
content: " ";
transform: translateX(-50%);
}
.text-bubble-left-#{$idx}::before {
@include media-breakpoint-up(md) {
@include text-bubble-left($color);
}
}
.text-bubble-right-#{$idx}::before {
@include media-breakpoint-up(md) {
@include text-bubble-right($color);
}
}
.plus-corner-#{$idx} {
right: -0.4rem;
bottom: -0.8rem;
width: 5rem;
height: 5rem;
border-radius: 0.5rem;
background-color: $color;
/* stylelint-disable-next-line property-no-vendor-prefix, declaration-property-value-no-unknown */
-webkit-clip-path: xywh(0 -5% 65% 75% round 15% 0);
clip-path: ellipse(50% 50% at 100% 100%);
color: #fff;
font-size: 2.5rem;
&::before {
position: absolute;
right: .4rem;
bottom: 0;
content: "+";
}
}
// * Top curves
.border-top-curved-#{$idx} {
border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 99' fill='none'%3E%3Cpath d='M0.5 98.5L0.499996 0.678555C124.136 38.9283 266.621 33.2224 389.5 0.650116L389.5 98.5L0.5 298.5Z' fill='#{urlencodecolor($color)}' stroke='#{urlencodecolor($color)}'/%3E%3C/svg%3E");
@include border-image-base;
}
.border-top-curved-upper-#{$idx} {
border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 99' fill='#{urlencodecolor($color)}'%3E%3Crect width='100%25' height='100%25'/%3E%3Cpath d='M0.5 98.5L0.499996 0.678555C124.136 38.9283 266.621 33.2224 389.5 0.650116L389.5 98.5L0.5 298.5Z' fill='#{urlencodecolor($color-white)}' stroke='#{urlencodecolor($color-white)}'/%3E%3C/svg%3E");
@include border-image-base;
}
.border-top-concave-#{$idx} {
padding-top: 2rem !important;
border-image: url("data:image/svg+xml,%3Csvg width='1512' height='92' viewBox='0 0 1512 92' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1512 92C1031 -24.28 478.5 -36.8914 0 92L0 0L1512 0V92Z' fill='%234C764B'/%3E%3C/svg%3E%0A");
@include border-image-base;
border-image-slice: 85 120 !important;
border-image-width: 3rem 0 0 0 !important;
}
// * Bottom curves
.border-bottom-curved-#{$idx} {
padding-top: 0 !important;
padding-bottom: 6rem;
border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 99' fill='#{urlencodecolor($color)}'%3E%3Crect width='100%25' height='100%25'/%3E%3Cpath d='M0.5 98.5L0.499996 0.678555C124.136 38.9283 266.621 33.2224 389.5 0.650116L389.5 98.5L0.5 298.5Z' fill='#{urlencodecolor($color-tertiary-light)}' stroke='#{urlencodecolor($color-tertiary-light)}'/%3E%3C/svg%3E");
@include border-image-base;
}
}
// * BACKGROUNDS
// Background color which are not exactly the defined colors in _variables.scss
@each $idx, $color in $light-colors {
// * Top curves
.bg-#{$idx} {
background-color: $color;
}
}
@include media-breakpoint-up(lg) {
// Mask to add a transparent effect on the right side.
.mask-white {
mask: linear-gradient(-90deg,#fff0 0%,#fff 20%,#fff 80%,#fff0 100%);
}
.mask-white-right {
mask: linear-gradient(-90deg,#fff0 0%,#fff 20%);
}
@each $idx, $color in $theme-colors {
// * Top curves
.border-top-curved-#{$idx},
.border-top-curved-upper-#{$idx},
.border-top-concave-#{$idx} {
border-image-slice: 100% 0;
}
}
}