Skip to content

Commit fb9f530

Browse files
Add smooth animations
Implement animations for UI elements.
1 parent b32e89f commit fb9f530

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

src/components/home/FeaturesSection.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const FeaturesSection = () => {
3838
return (
3939
<section className="py-16 md:py-24 bg-muted/30">
4040
<div className="container mx-auto px-4">
41-
<div className="text-center max-w-2xl mx-auto mb-16">
41+
<div className="text-center max-w-2xl mx-auto mb-16 animate-fade-in">
4242
<h2 className="text-3xl font-bold mb-4">Comprehensive Health Insights</h2>
4343
<p className="text-muted-foreground">
4444
Revon combines cutting-edge AI with medical knowledge to provide you with actionable health insights.
@@ -49,9 +49,9 @@ const FeaturesSection = () => {
4949
{features.map((feature, index) => (
5050
<div
5151
key={index}
52-
className="bg-white dark:bg-card rounded-xl p-6 shadow-sm hover:shadow-md transition-shadow duration-300"
52+
className={`gradient-card p-6 animate-fade-in animate-fade-in-delay-${Math.min(Math.floor(index / 3) + 1, 3)}`}
5353
>
54-
<div className="h-12 w-12 rounded-lg bg-revon-primary/10 flex items-center justify-center mb-4">
54+
<div className="h-12 w-12 rounded-lg bg-revon-primary/10 flex items-center justify-center mb-4 transition-transform duration-300 group-hover:scale-110">
5555
{feature.icon}
5656
</div>
5757
<h3 className="text-xl font-semibold mb-2">{feature.title}</h3>

src/components/home/HowItWorksSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const HowItWorksSection = () => {
3030
return (
3131
<section className="py-16 md:py-24">
3232
<div className="container mx-auto px-4">
33-
<div className="max-w-2xl mx-auto text-center mb-16">
33+
<div className="max-w-2xl mx-auto text-center mb-16 animate-fade-in">
3434
<h2 className="text-3xl font-bold mb-4">How Revon Works</h2>
3535
<p className="text-muted-foreground">
3636
Our intuitive process helps you understand your health concerns in just a few simple steps.
@@ -39,7 +39,7 @@ const HowItWorksSection = () => {
3939

4040
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
4141
{steps.map((step, index) => (
42-
<div key={index} className="relative">
42+
<div key={index} className={`relative animate-fade-in animate-fade-in-delay-${index + 1}`}>
4343
<div className="gradient-card rounded-xl p-6 h-full">
4444
<div className="text-4xl font-bold text-revon-primary/20 mb-4">{step.number}</div>
4545
<h3 className="text-xl font-semibold mb-2">{step.title}</h3>

src/index.css

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,39 @@
9494

9595
@layer components {
9696
.gradient-card {
97-
@apply bg-gradient-to-br from-white to-revon-light/50 dark:from-card dark:to-muted;
97+
@apply bg-gradient-to-br from-white to-revon-light/50 dark:from-card dark:to-muted transition-all duration-300 hover:shadow-lg hover:-translate-y-1;
9898
}
9999

100100
.gradient-btn {
101-
@apply bg-gradient-to-r from-revon-primary to-revon-accent hover:from-revon-primary/90 hover:to-revon-accent/90 transition-all duration-300;
101+
@apply bg-gradient-to-r from-revon-primary to-revon-accent hover:from-revon-primary/90 hover:to-revon-accent/90 transition-all duration-300 hover:-translate-y-0.5 hover:shadow-md active:translate-y-0;
102+
}
103+
104+
.animate-fade-in {
105+
@apply opacity-0 translate-y-4;
106+
animation: fadeIn 0.6s ease-out forwards;
107+
}
108+
109+
.animate-fade-in-delay-1 {
110+
animation-delay: 0.2s;
111+
}
112+
113+
.animate-fade-in-delay-2 {
114+
animation-delay: 0.4s;
115+
}
116+
117+
.animate-fade-in-delay-3 {
118+
animation-delay: 0.6s;
119+
}
120+
}
121+
122+
@keyframes fadeIn {
123+
from {
124+
opacity: 0;
125+
transform: translateY(16px);
126+
}
127+
to {
128+
opacity: 1;
129+
transform: translateY(0);
102130
}
103131
}
132+

0 commit comments

Comments
 (0)