feat(ui): redesign testimonial slider to manual snap carousel with equal card heights
This commit is contained in:
@@ -2,17 +2,59 @@
|
||||
padding: var(--section-padding) 20px;
|
||||
}
|
||||
|
||||
.testimonial-scroll-container {
|
||||
display: flex;
|
||||
overflow-x: auto;
|
||||
scroll-snap-type: x mandatory;
|
||||
scroll-behavior: smooth;
|
||||
gap: 24px;
|
||||
padding-bottom: 32px; /* Space for scrollbar and shadow */
|
||||
|
||||
/* Hide scrollbar for cleaner look, or keep it subtle */
|
||||
scrollbar-width: none; /* Firefox */
|
||||
-ms-overflow-style: none; /* IE/Edge */
|
||||
}
|
||||
.testimonial-scroll-container::-webkit-scrollbar {
|
||||
display: none; /* Chrome/Safari */
|
||||
}
|
||||
|
||||
.testimonial-card {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 60px 48px;
|
||||
/* On mobile, show ~85% width so the next card peeks in */
|
||||
flex: 0 0 calc(88% - 24px);
|
||||
scroll-snap-align: start;
|
||||
|
||||
/* Equal heights trick: cards stretch to the tallest sibling */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
margin: 0;
|
||||
padding: 40px 32px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.testimonial-card {
|
||||
/* On tablet, show ~60% width */
|
||||
flex: 0 0 calc(60% - 24px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.testimonial-card {
|
||||
/* On desktop, show ~45% width */
|
||||
flex: 0 0 calc(45% - 24px);
|
||||
}
|
||||
}
|
||||
|
||||
.testimonial-quote {
|
||||
position: relative;
|
||||
margin-bottom: 32px;
|
||||
/* Push author block to the bottom of the card */
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.quote-mark {
|
||||
@@ -27,11 +69,13 @@
|
||||
}
|
||||
|
||||
.testimonial-quote p {
|
||||
font-size: 1.2rem;
|
||||
line-height: 1.7;
|
||||
font-size: 1.1rem;
|
||||
line-height: 1.6;
|
||||
color: var(--text-primary);
|
||||
font-style: italic;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.testimonial-author {
|
||||
@@ -39,6 +83,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
margin-top: auto; /* Force to bottom */
|
||||
}
|
||||
|
||||
.author-photo {
|
||||
@@ -58,27 +103,3 @@
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.testimonial-dots {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: var(--glass-border);
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.dot.active {
|
||||
background: var(--accent-color);
|
||||
box-shadow: 0 0 8px var(--accent-color);
|
||||
transform: scale(1.3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user