Testimonials Section
Preview
Edit
Download
Run
Download Options
HTML File
Download as .html file
CSS File
Download as .css file
JavaScript File
Download as .js file
Combined HTML
All code in one HTML file
Project ZIP
All files in a ZIP archive
Cancel
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Blue Animated Testimonials</title> <style> </style> </head> <body> <section class="testimonials-section"> <h2 class="section-title">What Our Clients Say</h2> <p class="section-subtitle">Don't just take our word for it - hear from some of our amazing clients who have experienced our services firsthand.</p> <div class="testimonials-container"> <div class="testimonial-card"> <p class="testimonial-content">I've been using this service for over a year now and it has completely transformed my workflow. The team is incredibly responsive and the results speak for themselves.</p> <div class="client-info"> <img src="https://randomuser.me/api/portraits/women/43.jpg" alt="Sarah Johnson" class="client-avatar"> <div class="client-details"> <h4>Sarah Johnson</h4> <p>Marketing Director</p> <div class="rating">★★★★★</div> </div> </div> </div> <div class="testimonial-card"> <p class="testimonial-content">The level of professionalism and attention to detail is unmatched. We saw a 40% increase in productivity within the first month of implementation.</p> <div class="client-info"> <img src="https://randomuser.me/api/portraits/men/32.jpg" alt="Michael Chen" class="client-avatar"> <div class="client-details"> <h4>Michael Chen</h4> <p>CEO, TechStart</p> <div class="rating">★★★★★</div> </div> </div> </div> <div class="testimonial-card"> <p class="testimonial-content">As a small business owner, I was skeptical at first, but this service has been worth every penny. The customer support team is available 24/7 and genuinely cares.</p> <div class="client-info"> <img src="https://randomuser.me/api/portraits/women/65.jpg" alt="Emily Rodriguez" class="client-avatar"> <div class="client-details"> <h4>Emily Rodriguez</h4> <p>Owner, Bloom Boutique</p> <div class="rating">★★★★☆</div> </div> </div> </div> </div> <div class="controls"> <button class="control-btn active"></button> <button class="control-btn"></button> <button class="control-btn"></button> </div> </section> <script> </script> </body> </html>
CSS
:root { --primary-blue: #1a73e8; --dark-blue: #0d47a1; --light-blue: #e8f0fe; --text-dark: #202124; --text-light: #f8f9fa; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } body { background-color: #f5f5f5; padding: 20px; } .testimonials-section { max-width: 1200px; margin: 0 auto; padding: 40px 20px; text-align: center; } .section-title { font-size: 2.5rem; color: var(--dark-blue); margin-bottom: 10px; position: relative; display: inline-block; } .section-title::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 80px; height: 4px; background-color: var(--primary-blue); border-radius: 2px; } .section-subtitle { color: #5f6368; font-size: 1.1rem; margin-bottom: 40px; max-width: 700px; margin-left: auto; margin-right: auto; } .testimonials-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; margin-top: 50px; } .testimonial-card { background-color: white; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); padding: 30px; max-width: 350px; transition: all 0.3s ease; position: relative; overflow: hidden; opacity: 0; transform: translateY(20px); animation: fadeInUp 0.8s forwards; } .testimonial-card:nth-child(1) { animation-delay: 0.2s; } .testimonial-card:nth-child(2) { animation-delay: 0.4s; } .testimonial-card:nth-child(3) { animation-delay: 0.6s; } @keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } } .testimonial-card:hover { transform: translateY(-10px); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15); } .testimonial-card::before { content: '"'; position: absolute; top: 10px; left: 20px; font-size: 80px; color: var(--light-blue); font-family: Georgia, serif; line-height: 1; z-index: 0; } .testimonial-content { position: relative; z-index: 1; text-align: left; margin-bottom: 20px; color: var(--text-dark); line-height: 1.6; font-size: 1rem; } .client-info { display: flex; align-items: center; } .client-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; margin-right: 15px; border: 3px solid var(--primary-blue); } .client-details h4 { color: var(--dark-blue); font-size: 1.1rem; margin-bottom: 5px; } .client-details p { color: #5f6368; font-size: 0.9rem; } .rating { color: #fbbc04; margin-top: 5px; font-size: 1rem; } .controls { margin-top: 40px; display: flex; justify-content: center; gap: 15px; } .control-btn { width: 12px; height: 12px; border-radius: 50%; background-color: #d2e3fc; border: none; cursor: pointer; transition: all 0.3s ease; } .control-btn.active { background-color: var(--primary-blue); transform: scale(1.2); } @media (max-width: 768px) { .section-title { font-size: 2rem; } .section-subtitle { font-size: 1rem; } .testimonial-card { max-width: 100%; } .testimonials-container { flex-direction: column; align-items: center; } } @media (max-width: 480px) { .section-title { font-size: 1.8rem; } .testimonial-card { padding: 25px 20px; } .client-avatar { width: 50px; height: 50px; } }
JavaScript
document.addEventListener('DOMContentLoaded', function() { // Auto-rotate testimonials const testimonials = document.querySelectorAll('.testimonial-card'); const controls = document.querySelectorAll('.control-btn'); let currentIndex = 0; function showTestimonial(index) { // Hide all testimonials testimonials.forEach(testimonial => { testimonial.style.display = 'none'; }); // Remove active class from all controls controls.forEach(control => { control.classList.remove('active'); }); // Show selected testimonial and set active control testimonials[index].style.display = 'block'; controls[index].classList.add('active'); currentIndex = index; } // Initialize - show first testimonial showTestimonial(0); // Set up control buttons controls.forEach((control, index) => { control.addEventListener('click', () => { showTestimonial(index); }); }); // Auto-rotate every 5 seconds setInterval(() => { currentIndex = (currentIndex + 1) % testimonials.length; showTestimonial(currentIndex); }, 5000); // Animation on scroll const observerOptions = { threshold: 0.1 }; const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.style.opacity = 1; entry.target.style.transform = 'translateY(0)'; } }); }, observerOptions); testimonials.forEach(testimonial => { observer.observe(testimonial); }); });
Output Preview
Desktop
Mobile
Fullscreen