Skip to content

Commit

Permalink
Honor prefers-reduced-motion user preference #9894
Browse files Browse the repository at this point in the history
Makes it so that we disable all animations if the user prefers reduced
motion. Because there might be up to 7.4% of users who are impacted by
"motion sickness":

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4069154/#:~:text=The%20study%20found%20lifetime%20adult,preponderance%20%5B27%2C29%5D.
  • Loading branch information
PowerKiKi committed Oct 11, 2024
1 parent f2416d1 commit 0dce159
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion client/app/front-office/front-office.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
selector: 'app-front-office',
templateUrl: './front-office.component.html',
styleUrl: './front-office.component.scss',
animations: [],
standalone: true,
imports: [
CommonModule,
Expand Down
4 changes: 3 additions & 1 deletion client/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ const matTooltipCustomConfig: MatTooltipDefaultOptions = {
touchGestures: 'off',
};

const prefersReducedMotion = typeof matchMedia === 'function' ? matchMedia('(prefers-reduced-motion)').matches : false;

bootstrapApplication(AppComponent, {
providers: [
provideZoneChangeDetection({eventCoalescing: true}),
provideNativeDateAdapter(),
Apollo,
provideAnimationsAsync(),
provideAnimationsAsync(prefersReducedMotion ? 'noop' : 'animations'),
naturalProviders,
provideErrorHandler(localConfig.log.url, LoggerExtraService),
provideSeo({
Expand Down

0 comments on commit 0dce159

Please sign in to comment.