yintai-company-home/src/components/layout/SwiperCardSection/index.module.css

160 lines
3.2 KiB
CSS

.swiperCardSection {
min-height: calc(100vh / var(--zoom-compensation, 1));
padding: 6.25rem 16.25rem;
background: #D8D8D8;
background-size: cover;
background-position: center;
background-repeat: repeat;
}
.carouselWrapper {
display: flex;
align-items: center;
gap: 1.25rem;
position: relative;
}
.navBtn {
flex-shrink: 0;
width: 3.125rem;
height: 3.125rem;
background: #FFFFFF;
box-shadow: 0rem 0 .75rem 0rem rgba(20, 53, 92, 0.2);
border: none;
border-radius: 50%;
cursor: pointer;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: -5.625rem;
z-index: 99;
}
.nextBtn {
left: auto;
right: -5.625rem;
}
.swiperCardList {
flex: 1;
overflow: hidden;
}
.swiperCardList .swiperCardItem {
overflow: hidden;
position: relative;
width: 100%;
aspect-ratio: 457 / 630;
img {
width: 100%;
aspect-ratio: 457 / 630;
object-fit: cover;
}
.swiperMask {
width: 100%;
aspect-ratio: 457 / 630;
position: absolute;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.2);
}
&:hover {
.swiperContent {
background: rgba(20, 53, 92, 0.8);
top: 0;
.swiperTitle {
padding: 0 1.875rem;
span {
left: 1.875rem;
transform: translateX(0);
border-color: #fff;
}
}
.swiperDesc {
opacity: 1;
}
}
}
.swiperContent {
color: #fff;
position: absolute;
top: 75%;
left: 0;
width: 100%;
height: 100%;
transition: top 0.3s ease-in-out;
.swiperTitle {
position: relative;
font-weight: 500;
font-size: 1.5rem;
color: #FFFFFF;
line-height: 5rem;
height: 5rem;
margin: 0 1.875rem;
border-bottom: .0625rem solid rgba(255, 255, 255, 0.3);
span {
display: inline-block;
position: absolute;
left: 50%;
line-height: 5rem;
height: 5rem;
border-bottom: .1875rem solid #14355C;
transform: translateX(-50%);
transition: left 0.3s ease-in-out, transform 0.3s ease-in-out;
white-space: nowrap;
}
}
.swiperDesc {
font-size: 1rem;
color: #FFFFFF;
line-height: 1.875rem;
margin: 2.5rem 3.75rem;
opacity: 0;
white-space: pre-line;
}
}
}
@media (max-width: 48rem) {
.swiperCardSection {
padding: 4rem 4rem;
min-height: auto;
}
.navBtn {
left: -3rem;
}
.nextBtn {
left: auto;
right: -3rem;
}
}
@media (max-width: 30rem) {
.swiperCardSection {
padding: 3rem 1.25rem;
}
.navBtn {
width: 2.5rem;
height: 2.5rem;
left: -0.5rem;
}
.nextBtn {
left: auto;
right: -0.5rem;
}
}