Only disable specific animations/transitions/shadows

If I've missed any, follow-up PRs would be most appreciated.

Closes #2557
This commit is contained in:
Damien Elmes 2023-07-02 19:44:53 +10:00
parent 51efcabf4a
commit 7d2ec8ed65
6 changed files with 12 additions and 26 deletions

View file

@ -35,7 +35,10 @@
.toolbar { .toolbar {
justify-self: center; justify-self: center;
white-space: nowrap; white-space: nowrap;
transition: all var(--transition) ease-in-out;
.fancy & {
transition: all var(--transition) ease-in-out;
}
} }
.hitem { .hitem {
@ -57,7 +60,6 @@ body {
&:not(.fancy).hidden { &:not(.fancy).hidden {
opacity: 0; opacity: 0;
} }
transition: opacity var(--transition) ease-in-out;
&.fancy { &.fancy {
margin-bottom: 5px; margin-bottom: 5px;

View file

@ -15,26 +15,18 @@
body { body {
color: var(--fg); color: var(--fg);
background: var(--canvas); background: var(--canvas);
transition: opacity var(--transition-medium) ease-out; &.fancy {
transition: opacity var(--transition-medium) ease-out;
}
margin: 2em; margin: 2em;
overscroll-behavior: none; overscroll-behavior: none;
&:not(.isMac), &:not(.isMac),
&:not(.isMac) * { &:not(.isMac) * {
@include scrollbar.custom; @include scrollbar.custom;
} }
&.reduce-motion,
&.reduce-motion *:not(.no-reduce-motion) {
transition: none !important;
animation: none !important;
}
&.no-blur * { &.no-blur * {
backdrop-filter: none !important; backdrop-filter: none !important;
} }
&:not(.fancy),
&:not(.fancy) * {
box-shadow: none !important;
backdrop-filter: none !important;
}
} }
a { a {

View file

@ -388,7 +388,7 @@ class Toolbar:
return f""" return f"""
<a class=hitem tabindex="-1" aria-label="{name}" title="{title}" id="{label}" href=# onclick="return pycmd('{label}')" <a class=hitem tabindex="-1" aria-label="{name}" title="{title}" id="{label}" href=# onclick="return pycmd('{label}')"
>{name}<img id=sync-spinner class="no-reduce-motion" src='/_anki/imgs/refresh.svg'> >{name}<img id=sync-spinner src='/_anki/imgs/refresh.svg'>
</a>""" </a>"""
def set_sync_active(self, active: bool) -> None: def set_sync_active(self, active: bool) -> None:

View file

@ -49,19 +49,9 @@ body {
&:not(.isMac) * { &:not(.isMac) * {
@include scrollbar.custom; @include scrollbar.custom;
} }
&.reduce-motion,
&.reduce-motion *:not(.no-reduce-motion) {
transition: none !important;
animation: none !important;
}
&.no-blur * { &.no-blur * {
backdrop-filter: none !important; backdrop-filter: none !important;
} }
&:not(.fancy),
&:not(.fancy) * {
box-shadow: none !important;
backdrop-filter: none !important;
}
} }
button:not(.btn,.btn-close) { button:not(.btn,.btn-close) {

View file

@ -11,7 +11,9 @@ body {
color: var(--fg); color: var(--fg);
background: var(--canvas); background: var(--canvas);
margin: 1em; margin: 1em;
transition: opacity var(--transition-medium) ease-out; &.fancy {
transition: opacity var(--transition-medium) ease-out;
}
overscroll-behavior: none; overscroll-behavior: none;
} }

View file

@ -67,7 +67,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</script> </script>
<div class="range-box"> <div class="range-box">
<div class="spin no-reduce-motion" class:loading></div> <div class="spin" class:loading></div>
<InputBox> <InputBox>
<label> <label>