botascopia-webiste-static/assets/css/_slideshow.scss

155 lines
2.8 KiB
SCSS
Raw Normal View History

2026-01-12 21:13:05 +01:00
$slideshow-items: 3;
2026-01-12 20:06:16 +01:00
.slideshow {
height: 100%;
width: 100%;
margin-left: 0;
2026-01-12 21:13:05 +01:00
// overflow-y: hidden;
overflow: visible;
--arrow-space: 40px;
2026-01-12 20:06:16 +01:00
*{
position: relative;
}
}
.slideshow-container{
height: 100%;
width: 100%;
2026-01-12 21:13:05 +01:00
overflow: hidden;
2026-01-12 20:06:16 +01:00
}
.slideshow-inner {
width: calc(100% * var(--items));
height: 100%;
}
.slideshow-item {
width: calc(100%/var(--items));
height: 100%;
float: left;
2026-01-12 21:13:05 +01:00
display: flex;
flex-direction: column;
align-items: center;
2026-01-12 20:06:16 +01:00
figure{
2026-01-12 21:13:05 +01:00
width: calc(100% - var(--arrow-space)*2);
height: calc(100% - var(--unit));
2026-01-12 20:06:16 +01:00
img{
width: 100%;
height: 100%;
object-fit: cover;
}
}
2026-01-12 21:13:05 +01:00
figcaption{
width: calc(100% - var(--arrow-space)*2);
font-size: var(--fs-small);
height: calc(var(--unit)*2);
padding-top: calc(var(--padding-inner)*0.5);
}
2026-01-12 20:06:16 +01:00
}
/* Display slides (input checked)
--------------------------------------------------------
-------------------------------------------------------- */
.slideshow-inner {
transition: all 800ms cubic-bezier(0.77, 0, 0.175, 1);
transition-timing-function: cubic-bezier(0.77, 0, 0.175, 1);
}
.slideshow-item {
transition: all 0.5s ease-out;
}
/* Controls (arrows)
--------------------------------------------------------
-------------------------------------------------------- */
.slideshow-controls {
position: absolute;
top: 0;
width: 100%;
height: 100%;
}
.slide_controls {
width: 40px;
height: 100%;
position: absolute;
top: 0;
cursor: pointer;
will-change: z-index;
}
.slide_controls-previous {
left: 0;
}
.slide_controls-next {
right: 0;
}
span.controls {
height: 100%;
position: absolute;
width: 100%;
}
span.controls::before,
span.controls::after {
padding: 10px;
top: 50%;
transform: translateY(-50%);
position: absolute;
2026-01-12 21:13:05 +01:00
// background: white;
2026-01-12 20:06:16 +01:00
font-size: 20px;
z-index: 9;
}
.slide_controls-previous:hover ~ span.controls:before,
.slide_controls-next:hover ~ span.controls:after {
2026-01-12 21:13:05 +01:00
// background: #bfbfbf!important;
opacity: 0.7;
2026-01-12 20:06:16 +01:00
}
span.controls::before {
content: "";
left: -1px;
}
span.controls::after {
content: "";
right: -1px;
}
2026-01-12 21:13:05 +01:00
/* Position slide +Control arrows display -------------------------------------------- */
2026-01-12 20:06:16 +01:00
2026-01-12 21:13:05 +01:00
@for $i from 1 through $slideshow-items {
#slide-input-#{$i}:checked ~ .slideshow-inner {
left: #{($i - 1) * -100%};
}
2026-01-12 20:06:16 +01:00
}
2026-01-12 21:13:05 +01:00
@for $i from 1 through $slideshow-items {
#slide-input-#{$i}:checked ~ .slideshow-controls label {
z-index: -1;
}
#slide-input-#{$i}:checked ~ .slideshow-controls label:nth-of-type(#{$i * 2 - 1}),
#slide-input-#{$i}:checked ~ .slideshow-controls label:nth-of-type(#{$i * 2}) {
z-index: 11;
}
2026-01-12 20:06:16 +01:00
}