Files
skb-kit/src/widgets/Slider/Slider.styles.scss
T

243 lines
4.4 KiB
SCSS

.slider {
width: 100%;
margin: 0 auto;
position: relative;
padding: 10px 0;
will-change: transform;
backface-visibility: hidden;
transform-style: preserve-3d;
&.has-pagination {
.swiper {
padding-bottom: 40px;
}
}
.swiper {
width: 100%;
height: 100%;
overflow: hidden;
}
.swiper-wrapper {
display: flex;
align-items: stretch;
}
.swiper-slide {
flex-shrink: 0;
width: 100%;
position: relative;
padding-top: 10px;
padding-bottom: 10px;
display: flex;
justify-content: center;
align-items: center;
will-change: transform;
transform: translateZ(0);
backface-visibility: hidden;
perspective: 1000px;
box-sizing: border-box;
.slide-container {
position: relative;
width: 100%;
padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
overflow: hidden;
border-radius: 8px;
background-color: #f5f5f5;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
transition: box-shadow 0.3s ease;
&:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
}
.slide-background {
position: absolute;
top: -10%;
left: -10%;
right: -10%;
bottom: -10%;
background-size: cover;
background-position: center;
filter: blur(12px) brightness(0.9);
transform: scale(1.05);
z-index: 1;
opacity: 0.8;
}
.slide-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain;
object-position: center;
z-index: 2;
pointer-events: none;
transform: translateZ(0);
backface-visibility: hidden;
transition: transform 0.3s ease;
}
&.ratio-16-9 {
.slide-background {
display: none;
}
.slide-image {
object-fit: cover;
}
}
&.single {
.slide-container {
max-width: 80%;
margin: 0 auto;
}
}
}
.swiper-wrapper:has(.swiper-slide.single) {
justify-content: center;
.swiper-slide.single {
.slide-container {
padding-bottom: 0;
height: 60vh;
max-height: 600px;
}
}
}
}
.custom-navigation {
display: flex;
justify-content: space-between;
align-items: center;
position: absolute;
top: 50%;
width: 100%;
transform: translateY(-50%);
z-index: 10;
pointer-events: none;
&>* {
pointer-events: all;
}
}
.custom-prev,
.custom-next {
width: 60px;
height: 60px;
background-color: white;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
cursor: pointer;
font-size: 24px;
border: none;
transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
transform: translateZ(0);
backface-visibility: hidden;
&:hover {
transform: scale(1.05);
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
&:active {
transform: scale(0.95);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
@media (max-width: 768px) {
width: 45px;
height: 45px;
}
}
.custom-prev {
margin-left: -80px;
@media (max-width: 768px) {
margin-left: 5px;
}
}
.custom-next {
margin-right: -80px;
@media (max-width: 768px) {
margin-right: 5px;
}
}
.slider.news {
.swiper-slide {
opacity: 0.5;
transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
height: 65vh;
min-height: 300px;
transform-origin: center center;
.slide-container {
height: 500px;
}
.slide-image {
height: 500px;
transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@media (max-width: 768px) {
opacity: 1;
transition: none;
height: 48vh;
min-height: 250px;
.slide-container {
height: 350px;
}
.slide-image {
height: 350px;
}
}
}
.swiper-slide-active {
opacity: 1;
.slide-image {
transform: scale(1.02);
}
}
&.no-animation .swiper-slide {
transition: none !important;
.slide-image {
transform: none !important;
}
}
.swiper-slide-prev,
.swiper-slide-next {
opacity: 0.7;
transform: scale(0.95);
@media (max-width: 768px) {
opacity: 1;
transform: none;
}
}
}