Files
skb-kit/src/widgets/Slider/Slider.styles.scss
T
2025-05-26 00:45:06 +03:00

249 lines
4.7 KiB
SCSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
.slider {
width: 100%;
margin: 0 auto;
position: relative;
padding: 10px 0;
user-select: none; // Запрещаем выделение всего содержимого слайдера
&.has-pagination {
.swiper {
padding-bottom: 40px;
}
}
.slider-item {
display: flex;
justify-content: center;
align-items: center;
.slide-image {
width: 100%;
height: auto;
height: 350px;
object-fit: cover;
object-position: center center;
border-radius: 8px;
pointer-events: none;
user-select: none; // Дополнительная защита от выделения изображений
}
}
.swiper-wrapper:has(.swiper-slide.single) {
justify-content: center;
.slider-item.single {
display: flex;
justify-content: center;
align-items: center;
.slide-image {
width: auto;
height: 100%;
object-position: center center;
pointer-events: none;
user-select: none; // Запрещаем выделение и для одиночных изображений
border-radius: 0px;
}
}
}
}
/* стрелки */
/* Кастомные стрелки */
.custom-navigation {
display: flex;
justify-content: space-between;
align-items: center;
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.7);
color: white;
border: none;
width: 40px;
height: 40px;
border-radius: 50%;
cursor: pointer;
font-size: 18px;
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
transition: all 0.2s ease;
&:hover {
background: rgba(0, 0, 0, 0.9);
transform: translateY(-50%) scale(1.1);
}
&[disabled] {
display: none;
}
}
.alice-carousel__wrapper {
width: 185%;
height: auto;
left: -240px;
user-select: none;
}
.alice-carousel__prev-btn {
left: 10px;
&::before {
content: "←";
}
}
.alice-carousel__next-btn {
right: 10px;
&::before {
content: "→";
}
}
// Стили для Alice Carousel (добавить в конец файла)
.slider {
// Ваши существующие стили остаются без изменений
// Стили для Alice Carousel
.alice-carousel {
&__wrapper {
position: relative;
}
&__stage {
padding: 0;
}
&__stage-item {
padding: 0 10px;
}
// Используем ваши оригинальные стили для кнопок навигации
&__prev-btn,
&__next-btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 60px;
height: 60px;
background-color: white;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
cursor: pointer;
font-size: 24px;
border: none;
z-index: 10;
}
&__prev-btn {
left: -70px;
&::before {
content: "‹";
}
@media (max-width: 768px) {
left: 0px;
}
}
&__next-btn {
right: -70px;
&::before {
content: "›";
}
@media (max-width: 768px) {
right: 0px;
}
}
// Стили для точек навигации
&__dots {
display: flex;
justify-content: center;
gap: 8px;
margin-top: 15px;
&-item {
width: 10px;
height: 10px;
border-radius: 50%;
background: rgba(0, 0, 0, 0.3);
cursor: pointer;
transition: all 0.2s ease;
border: none;
&.__active {
background: #007bff;
transform: scale(1.2);
}
&:hover {
background: rgba(0, 0, 0, 0.6);
}
}
}
// Скрываем точки когда они отключены
&.__disabled-dots .alice-carousel__dots {
display: none;
}
// Скрываем кнопки когда они отключены
&.__disabled-buttons {
.alice-carousel__prev-btn,
.alice-carousel__next-btn {
display: none;
}
}
}
}
.slider-item {
display: flex;
justify-content: center;
align-items: center;
}
.slide-image {
width: 100%;
height: 300px;
object-fit: cover;
border-radius: 4px;
@media (max-width: 768px) {
height: 250px;
}
}
// Responsive стили
@media (max-width: 768px) {
.slider {
.alice-carousel__stage-item {
padding: 0 5px;
}
.alice-carousel__prev-btn,
.alice-carousel__next-btn {
width: 35px;
height: 35px;
font-size: 16px;
}
.alice-carousel__prev-btn {
left: 5px;
}
.alice-carousel__next-btn {
right: 5px;
}
}
}