Skip to content

Commit

Permalink
feat(ui): Speed up all animations by 2x
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Mar 8, 2024
1 parent 86a2232 commit 8f26ae7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import "@fontsource/jetbrains-mono/200.css";
import {LocalizationProvider} from "@mui/x-date-pickers";
import {AdapterDateFns} from "@mui/x-date-pickers/AdapterDateFns";

const ANIMATION_SPEED = 2;
const queryClient = new QueryClient();

const App = (): React.ReactElement => {
Expand All @@ -22,9 +23,18 @@ const App = (): React.ReactElement => {

const theme = React.useMemo(
() => {
const defaultTheme = createTheme();
const transitionDurations: any = {};
Object.entries(defaultTheme.transitions.duration).forEach(([key, value]) => {
transitionDurations[key] = Math.round(value / ANIMATION_SPEED);
});

return createTheme({
palette: {
mode: paletteMode,
},
transitions: {
duration: transitionDurations
}
});
},
Expand Down

0 comments on commit 8f26ae7

Please sign in to comment.