You've already forked AstralRinth
forked from didirus/AstralRinth
Add Prefers Reduced Motion support for most components (#133)
This commit is contained in:
@@ -120,6 +120,10 @@ export default defineComponent({
|
|||||||
height: 1rem;
|
height: 1rem;
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
transition: transform 0.25s ease-in-out;
|
transition: transform 0.25s ease-in-out;
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion) {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.checked {
|
&.checked {
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ export default {
|
|||||||
transition: opacity 0.5s ease-in-out, filter 0.2s ease-in-out, transform 0.05s ease-in-out,
|
transition: opacity 0.5s ease-in-out, filter 0.2s ease-in-out, transform 0.05s ease-in-out,
|
||||||
outline 0.2s ease-in-out;
|
outline 0.2s ease-in-out;
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion) {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
max-width: 10rem;
|
max-width: 10rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|||||||
@@ -90,5 +90,9 @@ onMounted(() => {
|
|||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
border: 0.25rem dashed var(--color-button-bg);
|
border: 0.25rem dashed var(--color-button-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion) {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -129,6 +129,10 @@ function stopTimer(notif) {
|
|||||||
.notifs-leave-active,
|
.notifs-leave-active,
|
||||||
.notifs-move {
|
.notifs-move {
|
||||||
transition: all 0.5s;
|
transition: all 0.5s;
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion) {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.notifs-enter-from,
|
.notifs-enter-from,
|
||||||
.notifs-leave-to {
|
.notifs-leave-to {
|
||||||
|
|||||||
@@ -129,6 +129,10 @@ a {
|
|||||||
transition: opacity 0.5s ease-in-out, filter 0.2s ease-in-out, transform 0.05s ease-in-out,
|
transition: opacity 0.5s ease-in-out, filter 0.2s ease-in-out, transform 0.05s ease-in-out,
|
||||||
outline 0.2s ease-in-out;
|
outline 0.2s ease-in-out;
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion) {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|||||||
@@ -106,6 +106,10 @@ onBeforeUnmount(() => {
|
|||||||
transition: bottom 0.125s ease-in-out, top 0.125s ease-in-out, left 0.125s ease-in-out,
|
transition: bottom 0.125s ease-in-out, top 0.125s ease-in-out, left 0.125s ease-in-out,
|
||||||
right 0.125s ease-in-out, opacity 0.125s ease-in-out, scale 0.125s ease-in-out;
|
right 0.125s ease-in-out, opacity 0.125s ease-in-out, scale 0.125s ease-in-out;
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion) {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
&.position-bottom-left {
|
&.position-bottom-left {
|
||||||
top: calc(100% + var(--gap-sm) - 1rem);
|
top: calc(100% + var(--gap-sm) - 1rem);
|
||||||
right: -1rem;
|
right: -1rem;
|
||||||
|
|||||||
@@ -115,6 +115,12 @@ const onInput = (value: string) => {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.root-container {
|
.root-container {
|
||||||
|
--transition-speed: 0.2s;
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion) {
|
||||||
|
--transition-speed: 0s;
|
||||||
|
}
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -159,7 +165,7 @@ const onInput = (value: string) => {
|
|||||||
background: var(--color-brand);
|
background: var(--color-brand);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
transition: 0.2s;
|
transition: var(--transition-speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
.slider-component .slide-container .slider::-moz-range-thumb {
|
.slider-component .slide-container .slider::-moz-range-thumb {
|
||||||
@@ -169,19 +175,19 @@ const onInput = (value: string) => {
|
|||||||
background: var(--color-brand);
|
background: var(--color-brand);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
transition: 0.2s;
|
transition: var(--transition-speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
.slider-component .slide-container .slider:hover::-webkit-slider-thumb:not(.disabled) {
|
.slider-component .slide-container .slider:hover::-webkit-slider-thumb:not(.disabled) {
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
height: 1rem;
|
height: 1rem;
|
||||||
transition: 0.2s;
|
transition: var(--transition-speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
.slider-component .slide-container .slider:hover::-moz-range-thumb:not(.disabled) {
|
.slider-component .slide-container .slider:hover::-moz-range-thumb:not(.disabled) {
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
height: 1rem;
|
height: 1rem;
|
||||||
transition: 0.2s;
|
transition: var(--transition-speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
.slider-component .slide-container .snap-points-wrapper {
|
.slider-component .slide-container .snap-points-wrapper {
|
||||||
|
|||||||
@@ -99,6 +99,10 @@ defineExpose({
|
|||||||
z-index: 19;
|
z-index: 19;
|
||||||
transition: all 0.3s ease-in-out;
|
transition: all 0.3s ease-in-out;
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion) {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
&.shown {
|
&.shown {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
@@ -164,6 +168,10 @@ defineExpose({
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: all 0.25s ease-in-out;
|
transition: all 0.25s ease-in-out;
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion) {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 650px) {
|
@media screen and (max-width: 650px) {
|
||||||
width: calc(100% - 2 * var(--gap-lg));
|
width: calc(100% - 2 * var(--gap-lg));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,6 +251,10 @@ defineExpose({
|
|||||||
margin: var(--gap-sm);
|
margin: var(--gap-sm);
|
||||||
transition: all 0.2s ease-in-out;
|
transition: all 0.2s ease-in-out;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion) {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.resizable-textarea-wrapper {
|
.resizable-textarea-wrapper {
|
||||||
|
|||||||
Reference in New Issue
Block a user