修改轮播样式
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
yiqiu
2025-11-21 18:13:52 +08:00
parent beb14ac97b
commit fb830e03f4

View File

@@ -1,35 +1,94 @@
/* banner */ /* banner */
.banner-cont { .banner-cont {
position: relative;
width: 100%; width: 100%;
overflow: hidden;
} }
.banner-cont .swiper-slide { .banner-cont .swiper-slide {
position: relative;
height: 500px; height: 500px;
width: 100%; width: 100%;
background: linear-gradient(0, #f7f9fa, #f9fafb); background: #0b1020;
overflow: hidden;
} }
.banner-cont .swiper-slide .img { /* 背景图铺满,并增加左侧渐变遮罩,保证文字可读性 */
/* position: absolute; */ .banner-cont .swiper-slide::before {
z-index: -1; content: "";
max-height: 100%; position: absolute;
max-width: 100%; top: 0;
width: 100%; right: 0;
/* object-fit: fill; */ bottom: 0;
} left: 0;
background: linear-gradient(
90deg,
.banner-cont .banner-desc { rgba(9, 10, 15, 0.9) 0%,
font-size: 16px; rgba(9, 10, 15, 0.55) 40%,
margin-top: 30px; rgba(9, 10, 15, 0) 72%
margin-bottom: 80px; );
max-width: 550px; z-index: 1;
}
}
.banner-cont .swiper-slide .img {
.banner-cont .swiper-pagination-bullet { position: absolute;
width: 36px; top: 0;
height: 4px; left: 0;
width: 100%;
height: 100%;
object-fit: cover;
max-width: 100%;
max-height: 100%;
display: block;
z-index: 0;
}
/* 固定文案区域位置,避免不同轮播内容导致上下抖动 */
.banner-cont .banner-text {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
.banner-cont .banner-text .section-content {
position: absolute;
top: 120px;
left: 50%;
transform: translateX(-50%);
max-width: 1440px;
padding-top: 0;
padding-bottom: 0;
display: flex;
flex-direction: column;
align-items: flex-start;
z-index: 2;
}
.banner-cont .banner-text h1 {
font-size: 40px;
line-height: 1.2;
color: #ffffff;
}
.banner-cont .banner-desc {
font-size: 16px;
margin-top: 16px;
margin-bottom: 32px;
max-width: 550px;
color: rgba(255, 255, 255, 0.85);
}
/* 按钮保持可点击 */
.banner-cont .banner-text .btn {
pointer-events: auto;
}
.banner-cont .swiper-pagination-bullet {
width: 36px;
height: 4px;
background: #D7DCE4; background: #D7DCE4;
opacity: 1; opacity: 1;
border-radius: 3px; border-radius: 3px;
@@ -39,31 +98,14 @@
background: rgba(255, 103, 57, 1); background: rgba(255, 103, 57, 1);
} }
.banner-cont { /* 调整分页器位置,避免与文案重叠 */
position: relative; .banner-cont .swiper-pagination {
bottom: 40px !important;
} }
.banner-cont .banner-text { .banner .banner-s {
position: absolute; box-shadow: 0px 0px 16px rgba(52, 52, 52, 0.16);
left: 0; border-radius: 3px;
top: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
}
.banner-cont .banner-text .section-content {
z-index: 1;
}
.banner-cont .banner-text .btn {
pointer-events: auto;
}
.banner .banner-s {
box-shadow: 0px 0px 16px rgba(52, 52, 52, 0.16);
border-radius: 3px;
} }
.banner .banner-s .banner-list { .banner .banner-s .banner-list {