mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 18:54:59 +00:00
feat: Add 3D card flip animation to testimonials
This commit is contained in:
parent
41c3b59755
commit
d973be8fea
1 changed files with 14 additions and 8 deletions
|
@ -225,7 +225,10 @@
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
|
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
|
||||||
transition: opacity 0.3s ease;
|
transition: transform 0.6s;
|
||||||
|
transform-style: preserve-3d;
|
||||||
|
perspective: 1000px;
|
||||||
|
backface-visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.testimonial-text {
|
.testimonial-text {
|
||||||
|
@ -683,15 +686,18 @@ aider --model gpt-4o --api-key openai=your-key-goes-here</pre>
|
||||||
// Update the displayed testimonial
|
// Update the displayed testimonial
|
||||||
const testimonialElement = document.getElementById(`testimonial-${index}`);
|
const testimonialElement = document.getElementById(`testimonial-${index}`);
|
||||||
if (testimonialElement) {
|
if (testimonialElement) {
|
||||||
testimonialElement.innerHTML = `
|
// Start the flip animation
|
||||||
<p class="testimonial-text">"${newTestimonial.text}"</p>
|
testimonialElement.style.transform = "rotateY(90deg)";
|
||||||
<p class="testimonial-author">— <a href="${newTestimonial.link}" target="_blank">${newTestimonial.author}</a></p>
|
|
||||||
`;
|
|
||||||
|
|
||||||
// Add a brief animation effect
|
// Update content when card is perpendicular to view (hidden)
|
||||||
testimonialElement.style.opacity = 0;
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
testimonialElement.style.opacity = 1;
|
testimonialElement.innerHTML = `
|
||||||
|
<p class="testimonial-text">"${newTestimonial.text}"</p>
|
||||||
|
<p class="testimonial-author">— <a href="${newTestimonial.link}" target="_blank">${newTestimonial.author}</a></p>
|
||||||
|
`;
|
||||||
|
|
||||||
|
// Complete the flip
|
||||||
|
testimonialElement.style.transform = "rotateY(0deg)";
|
||||||
}, 300);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue