fix: keep hero hover image size stable
This commit is contained in:
+11
-19
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user