Spaces:
Running
Running
axeronis commited on
Commit ·
db54885
1
Parent(s): 179e1ef
perf: smoother feature card animations - use CSS transforms instead of Framer Motion hover
Browse files- frontend/app/globals.css +16 -0
- frontend/app/page.tsx +3 -4
frontend/app/globals.css
CHANGED
|
@@ -553,4 +553,20 @@ input:-webkit-autofill:focus {
|
|
| 553 |
.animate-marquee:hover,
|
| 554 |
.animate-marquee-infinite:hover {
|
| 555 |
animation-play-state: paused;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 556 |
}
|
|
|
|
| 553 |
.animate-marquee:hover,
|
| 554 |
.animate-marquee-infinite:hover {
|
| 555 |
animation-play-state: paused;
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
/* GPU acceleration for smooth animations */
|
| 559 |
+
.gpu-accelerated {
|
| 560 |
+
will-change: transform;
|
| 561 |
+
transform: translateZ(0);
|
| 562 |
+
backface-visibility: hidden;
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
/* Reduce motion for accessibility */
|
| 566 |
+
@media (prefers-reduced-motion: reduce) {
|
| 567 |
+
|
| 568 |
+
.animate-marquee,
|
| 569 |
+
.animate-marquee-infinite {
|
| 570 |
+
animation: none;
|
| 571 |
+
}
|
| 572 |
}
|
frontend/app/page.tsx
CHANGED
|
@@ -547,10 +547,9 @@ export default function HomePage() {
|
|
| 547 |
key={i}
|
| 548 |
initial={{ opacity: 0, y: 20 }}
|
| 549 |
whileInView={{ opacity: 1, y: 0 }}
|
| 550 |
-
viewport={{ once: true }}
|
| 551 |
-
transition={{ delay: i * 0.
|
| 552 |
-
|
| 553 |
-
className={`relative p-6 rounded-2xl border border-white/5 bg-[#0B0C15] transition-all duration-300 cursor-default ${colors.border} hover:shadow-2xl ${colors.shadow} ${feat.size === 'lg' ? 'lg:col-span-2' : ''}`}
|
| 554 |
>
|
| 555 |
{feat.badgeKey && (
|
| 556 |
<span className="absolute top-4 right-4 text-xs font-bold px-2 py-1 rounded-full bg-pink-500/20 text-pink-400 border border-pink-500/30">
|
|
|
|
| 547 |
key={i}
|
| 548 |
initial={{ opacity: 0, y: 20 }}
|
| 549 |
whileInView={{ opacity: 1, y: 0 }}
|
| 550 |
+
viewport={{ once: true, margin: "-50px" }}
|
| 551 |
+
transition={{ duration: 0.4, delay: i * 0.03, ease: "easeOut" }}
|
| 552 |
+
className={`relative p-6 rounded-2xl border border-white/5 bg-[#0B0C15] cursor-default transition-transform duration-200 ease-out hover:scale-[1.02] hover:-translate-y-1 ${colors.border} hover:shadow-2xl ${colors.shadow} ${feat.size === 'lg' ? 'lg:col-span-2' : ''}`}
|
|
|
|
| 553 |
>
|
| 554 |
{feat.badgeKey && (
|
| 555 |
<span className="absolute top-4 right-4 text-xs font-bold px-2 py-1 rounded-full bg-pink-500/20 text-pink-400 border border-pink-500/30">
|