From 0a48343eb73573e23e06e58ecb52604dc1a53525 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 19 May 2023 12:59:06 +0800 Subject: [PATCH] Update site animation rules --- assets/scss/animations.scss | 17 +---------------- assets/scss/extend.scss | 2 +- assets/scss/roles.scss | 6 ++++++ 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/assets/scss/animations.scss b/assets/scss/animations.scss index fecd62b..93b6a7a 100644 --- a/assets/scss/animations.scss +++ b/assets/scss/animations.scss @@ -1,6 +1,6 @@ @keyframes shake { $distance: 1px; - from { transform: translate(-$distance); } + from { transform: translate(-$distance, $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}); - } - } -} diff --git a/assets/scss/extend.scss b/assets/scss/extend.scss index 64220f3..ec4e8fd 100644 --- a/assets/scss/extend.scss +++ b/assets/scss/extend.scss @@ -137,6 +137,6 @@ code[data-lang] { // Prefer reduced animations. @media (prefers-reduced-motion) { #logo svg { - animation: bounce 0.6s ease-in-out alternate infinite; + animation: none; } } diff --git a/assets/scss/roles.scss b/assets/scss/roles.scss index 6469bfa..a65b989 100644 --- a/assets/scss/roles.scss +++ b/assets/scss/roles.scss @@ -22,3 +22,9 @@ .extreme-shake { animation: extreme-shake 0.1s alternate ease-in-out infinite; } + +@media (prefers-reduced-motion) { + .shake, .extreme-shake { + animation: none; + } +}