You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

251 lines
4.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* Simple Carousel CSS - Swiper替代方案样式
* 轻量级轮播插件样式
*/
/* 轮播容器基础样式 */
.simple-carousel {
position: relative;
width: 100%;
overflow: hidden;
background: #fff;
border-radius: 15px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
/* 轮播包装器 */
.carousel-wrapper {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
display: flex;
transition: transform 0.5s ease;
}
/* 幻灯片样式 */
.carousel-slide {
width: 100%;
height: 100%;
display: flex;
align-items: center;
padding: 40px;
gap: 40px;
flex-shrink: 0;
transition: all 0.3s ease;
}
/* 导航按钮样式 */
.carousel-button-next,
.carousel-button-prev {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 44px;
height: 44px;
background: rgba(255, 255, 255, 0.9);
border: none;
border-radius: 50%;
color: #007bff;
font-size: 18px;
cursor: pointer;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
}
.carousel-button-next:hover,
.carousel-button-prev:hover {
background: #007bff;
color: white;
transform: translateY(-50%) scale(1.1);
}
.carousel-button-next {
right: 20px;
}
.carousel-button-prev {
left: 20px;
}
.carousel-button-next::after {
content: '';
font-weight: bold;
}
.carousel-button-prev::after {
content: '';
font-weight: bold;
}
/* 分页器样式 */
.carousel-pagination {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 8px;
z-index: 10;
}
.carousel-pagination-bullet {
width: 12px;
height: 12px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.5);
cursor: pointer;
transition: all 0.3s ease;
border: 2px solid transparent;
}
.carousel-pagination-bullet:hover {
background: rgba(255, 255, 255, 0.8);
transform: scale(1.2);
}
.carousel-pagination-bullet.active {
background: #007bff;
border-color: rgba(255, 255, 255, 0.8);
transform: scale(1.3);
}
/* 图片区域样式 */
.slide-image {
flex: 1;
max-width: 45%;
}
.slide-image img {
width: 100%;
height: 300px;
object-fit: cover;
border-radius: 10px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
/* 文字区域样式 */
.slide-content {
flex: 1;
max-width: 55%;
padding-left: 20px;
}
.slide-title {
font-size: 28px;
font-weight: bold;
color: #333;
margin-bottom: 20px;
border-left: 4px solid #007bff;
padding-left: 15px;
}
.slide-description {
font-size: 16px;
line-height: 1.8;
color: #666;
text-align: justify;
}
/* 响应式设计 */
@media (max-width: 768px) {
.carousel-slide {
flex-direction: column;
padding: 20px;
gap: 20px;
}
.slide-image,
.slide-content {
max-width: 100%;
}
.slide-content {
padding-left: 0;
}
.carousel-wrapper {
height: 400px;
}
.slide-title {
font-size: 24px;
}
.slide-description {
font-size: 14px;
}
.carousel-button-next,
.carousel-button-prev {
width: 36px;
height: 36px;
font-size: 16px;
}
.carousel-button-next {
right: 10px;
}
.carousel-button-prev {
left: 10px;
}
.carousel-pagination {
bottom: 10px;
}
.carousel-pagination-bullet {
width: 10px;
height: 10px;
}
}
/* 禁用选择和拖拽 */
.simple-carousel * {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-user-drag: none;
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
}
/* 触摸优化 */
.carousel-wrapper {
touch-action: pan-y pinch-zoom;
-webkit-overflow-scrolling: touch;
}
/* 加载状态 */
.simple-carousel.loading {
opacity: 0.7;
pointer-events: none;
}
.simple-carousel.loading::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 40px;
height: 40px;
border: 3px solid #f3f3f3;
border-top: 3px solid #007bff;
border-radius: 50%;
animation: spin 1s linear infinite;
z-index: 100;
}
@keyframes spin {
0% { transform: translate(-50%, -50%) rotate(0deg); }
100% { transform: translate(-50%, -50%) rotate(360deg); }
}