fix: keep hero hover image size stable

This commit is contained in:
poyrazavsever
2026-07-29 20:31:32 +03:00
parent 4802c4764a
commit b82a5af8d8
2 changed files with 14 additions and 22 deletions
+11 -19
View File
@@ -27,47 +27,39 @@
animation-play-state: paused;
}
@keyframes hero-wave-primary {
@keyframes hero-image-cycle-primary {
0%, 49.99% { opacity: 1; }
50%, 100% { opacity: 0; }
}
@keyframes hero-wave-secondary {
@keyframes hero-image-cycle-secondary {
0%, 49.99% { opacity: 0; }
50%, 100% { opacity: 1; }
}
@keyframes hero-wave-sway {
0%, 100% { transform: rotate(0deg) translateY(0); }
25% { transform: rotate(-2deg) translateY(-1px); }
50% { transform: rotate(2.5deg) translateY(0); }
75% { transform: rotate(-1deg) translateY(-1px); }
.hero-image-cycle-frame {
will-change: opacity;
}
.hero-wave-frame {
transform-origin: 70% 88%;
will-change: opacity, transform;
}
.hero-wave-frame-secondary {
.hero-image-cycle-secondary {
opacity: 0;
}
.hero-wave:hover .hero-wave-frame-primary {
animation: hero-wave-primary 520ms steps(1, end) infinite, hero-wave-sway 720ms ease-in-out infinite;
.hero-image-cycle:hover .hero-image-cycle-primary {
animation: hero-image-cycle-primary 650ms steps(1, end) infinite;
}
.hero-wave:hover .hero-wave-frame-secondary {
animation: hero-wave-secondary 520ms steps(1, end) infinite, hero-wave-sway 720ms ease-in-out infinite;
.hero-image-cycle:hover .hero-image-cycle-secondary {
animation: hero-image-cycle-secondary 650ms steps(1, end) infinite;
}
@media (prefers-reduced-motion: reduce) {
.hero-wave:hover .hero-wave-frame-primary {
.hero-image-cycle:hover .hero-image-cycle-primary {
animation: none;
opacity: 0;
}
.hero-wave:hover .hero-wave-frame-secondary {
.hero-image-cycle:hover .hero-image-cycle-secondary {
animation: none;
opacity: 1;
}