фиксы в фотогаллереи, слайдере, подгрузка кастомных страниц

This commit is contained in:
xomimishka committed 2025-06-04 15:48:08 +03:00
1 parent 35eb333475
commit 65bd5b9e83
7 files changed
+252 -285

No files matched your search

+111 -189
View File
@@ -3,7 +3,9 @@
margin: 0 auto;
position: relative;
padding: 10px 0;
user-select: none; // Запрещаем выделение всего содержимого слайдера
will-change: transform;
backface-visibility: hidden;
transform-style: preserve-3d;
&.has-pagination {
.swiper {
@@ -11,238 +13,158 @@
}
}
.slider-item {
.swiper-slide {
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;
.slide-image {
width: 100%;
height: auto;
height: 350px;
object-fit: cover;
object-position: center center;
object-position: center;
border-radius: 8px;
pointer-events: none;
user-select: none; // Дополнительная защита от выделения изображений
transform: translateZ(0);
backface-visibility: hidden;
}
}
.swiper-wrapper:has(.swiper-slide.single) {
justify-content: center;
.slider-item.single {
display: flex;
justify-content: center;
align-items: center;
.swiper-slide.single {
.slide-image {
width: auto;
height: 100%;
object-position: center center;
pointer-events: none;
user-select: none; // Запрещаем выделение и для одиночных изображений
border-radius: 0px;
border-radius: 0;
}
}
}
}
/* стрелки */
/* Кастомные стрелки */
.custom-navigation {
display: flex;
justify-content: space-between;
align-items: center;
position: absolute;
top: 50%;
width: 100%;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.7);
color: white;
border: none;
width: 40px;
height: 40px;
z-index: 10;
pointer-events: none;
&>* {
pointer-events: all;
}
}
.custom-prev,
.custom-next {
width: 60px;
height: 60px;
background-color: white;
border-radius: 50%;
cursor: pointer;
font-size: 18px;
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
transition: all 0.2s ease;
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 {
background: rgba(0, 0, 0, 0.9);
transform: translateY(-50%) scale(1.1);
transform: scale(1.05);
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
&[disabled] {
display: none;
&:active {
transform: scale(0.95);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
}
.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;
width: 45px;
height: 45px;
}
}
// Responsive стили
@media (max-width: 768px) {
.slider {
.alice-carousel__stage-item {
padding: 0 5px;
}
.custom-prev {
margin-left: -80px;
.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;
}
@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-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-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;
}
}
}