nexo-solutions-review-carousel
Version:
A customizable review carousel component for React applications
295 lines (239 loc) • 5.08 kB
CSS
/* ReviewCarousel Component Styles */
/* Main container */
.review-carousel-component {
font-family: inherit;
position: relative;
}
/* Testimonials carousel for desktop */
.testimonials-carousel {
display: flex;
overflow-x: auto;
scroll-behavior: smooth;
-ms-overflow-style: none;
scrollbar-width: none;
padding: 1rem 0;
gap: 1.5rem;
animation: autoScroll 60s linear infinite;
}
.testimonials-carousel::-webkit-scrollbar {
display: none;
}
/* Animate the horizontal scroll */
@keyframes autoScroll {
0% {
transform: translateX(0);
}
100% {
transform: translateX(calc(-100% / 2));
}
}
/* Testimonial card */
.testimonial-card {
min-width: 320px;
max-width: 320px;
background-color: white;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
padding: 1.5rem;
cursor: pointer;
transition: transform 0.3s ease, box-shadow 0.3s ease;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.testimonial-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}
.testimonial-content {
display: flex;
flex-direction: column;
margin-bottom: 1.5rem;
}
.review-stars {
display: flex;
align-items: center;
justify-content: flex-start;
width: 100%;
position: relative;
margin-bottom: 0.5rem;
color: #ffc800;
/* Default, overridden by inline styles */
font-size: 0.9rem;
gap: 5px;
}
.review-stars i {
font-size: 0.9rem;
}
.testimonial-text-container {
position: relative;
}
.testimonial-text {
font-size: 0.9rem;
line-height: 1.5;
margin-bottom: 0.5rem;
position: relative;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
height: 4.5em;
}
.read-more-btn {
background: none;
border: none;
color: #666;
padding: 0;
font-size: 0.85rem;
cursor: pointer;
font-weight: 500;
text-decoration: underline;
margin-top: 0.25rem;
}
/* Author info */
.testimonial-author {
display: flex;
align-items: center;
gap: 0.75rem;
}
.author-image {
width: 40px;
height: 40px;
border-radius: 50%;
overflow: hidden;
position: relative;
background-color: #f0f0f0;
}
.author-image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.author-info {
display: flex;
flex-direction: column;
}
.author-name {
font-weight: 600;
font-size: 0.9rem;
margin: 0 0 0.25rem 0;
color: #333;
}
.author-location {
font-size: 0.8rem;
color: #777;
}
/* Source indicator */
.google-source-indicator {
position: absolute;
right: 0;
display: flex;
align-items: center;
justify-content: center;
}
.source-icon {
width: 16px;
height: 16px;
object-fit: contain;
}
/* Swiper (Mobile) */
.testimonials-swiper {
width: 100%;
position: relative;
}
.testimonials-pagination {
display: flex;
justify-content: center;
margin-top: 1rem;
gap: 0.5rem;
}
.swipe-hint {
text-align: center;
font-size: 0.8rem;
color: #777;
margin-top: 1rem;
}
/* Modal styles */
.review-modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.6);
z-index: 1000;
display: flex;
justify-content: center;
align-items: center;
padding: 1rem;
}
.review-modal {
background-color: white;
border-radius: 8px;
max-width: 500px;
width: 90%;
max-height: 90vh;
overflow-y: auto;
position: relative;
padding: 2rem;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.review-modal-close {
position: absolute;
top: 1rem;
right: 1rem;
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
color: #666;
}
.review-modal-content {
margin-top: 0.5rem;
}
.review-modal .review-stars {
margin-bottom: 1rem;
font-size: 1.2rem;
}
.review-modal-text {
margin-bottom: 1.5rem;
font-size: 1rem;
line-height: 1.6;
}
.review-modal-author {
display: flex;
align-items: center;
gap: 1rem;
}
.review-modal-author .author-image {
width: 50px;
height: 50px;
}
.review-modal-author .author-name {
font-size: 1.1rem;
margin-bottom: 0.25rem;
}
.review-modal-author .author-location {
font-size: 0.9rem;
}
/* Utility classes */
.text-center {
text-align: center;
}
.text-sm {
font-size: 0.875rem;
}
.text-gray-500 {
color: #6b7280;
}
.mt-4 {
margin-top: 1rem;
}
.mr-2 {
margin-right: 0.5rem;
}