Update site animation rules

This commit is contained in:
Gabriel Arazas 2023-05-19 12:59:06 +08:00
parent 7cfc8878c3
commit 0a48343eb7
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
3 changed files with 8 additions and 17 deletions

View File

@ -1,6 +1,6 @@
@keyframes shake { @keyframes shake {
$distance: 1px; $distance: 1px;
from { transform: translate(-$distance); } from { transform: translate(-$distance, $distance); }
to { transform: translate($distance); } to { transform: translate($distance); }
} }
@ -41,18 +41,3 @@
} }
} }
} }
@media (prefers-reduced-motion) {
@keyframes bounce {
$baseSize: 1em;
$baseRotation: 10deg;
from {
transform: rotate($baseRotation) translateX($baseSize)
translateY(-#{$baseSize / 5});
}
to {
transform: rotate(-$baseRotation) translateX(-$baseSize)
translateY(-#{$baseSize / 5});
}
}
}

View File

@ -137,6 +137,6 @@ code[data-lang] {
// Prefer reduced animations. // Prefer reduced animations.
@media (prefers-reduced-motion) { @media (prefers-reduced-motion) {
#logo svg { #logo svg {
animation: bounce 0.6s ease-in-out alternate infinite; animation: none;
} }
} }

View File

@ -22,3 +22,9 @@
.extreme-shake { .extreme-shake {
animation: extreme-shake 0.1s alternate ease-in-out infinite; animation: extreme-shake 0.1s alternate ease-in-out infinite;
} }
@media (prefers-reduced-motion) {
.shake, .extreme-shake {
animation: none;
}
}