Skip to content

Commit 769bcec

Browse files
committed
fix: Page transition speed on non-webkitgtk
1 parent da54c6a commit 769bcec

File tree

3 files changed

+950
-826
lines changed

3 files changed

+950
-826
lines changed

apps/frontend/src/ui/components/AnimatedRoutes.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import { getProgramInfo } from '@onelauncher/client';
12
import useSettings from '~ui/hooks/useSettings';
2-
import { type ParentProps, Show } from 'solid-js';
3+
import { createMemo, type ParentProps, Show } from 'solid-js';
34
import { Transition, type TransitionProps } from 'solid-transition-group';
45

56
type AnimationTypes = 'default' | 'fade';
@@ -33,6 +34,14 @@ function AnimatedRoutes(props: AnimatedProps & TransitionProps & ParentProps) {
3334

3435
const animation = () => animations[props.animation ?? 'default'];
3536

37+
const durationMultiplier = createMemo(() => {
38+
// I LOVE WEBKITGTK I LOVE WEBKTIGTKI LOVE WEBKITGTK I LOVE WEBKTIGTKI LOVE WEBKITGTK I LOVE WEBKTIGTK
39+
if (getProgramInfo().platform === 'linux')
40+
return 0.36;
41+
42+
return 1;
43+
});
44+
3645
return (
3746
<Show
3847
children={(
@@ -48,7 +57,7 @@ function AnimatedRoutes(props: AnimatedProps & TransitionProps & ParentProps) {
4857
animation().before,
4958
animation().after,
5059
], {
51-
duration: 90,
60+
duration: 250 * durationMultiplier(),
5261
easing: 'cubic-bezier(0.16, 1, 0.3, 1)',
5362
}).onfinish = () => {
5463
done();
@@ -64,7 +73,7 @@ function AnimatedRoutes(props: AnimatedProps & TransitionProps & ParentProps) {
6473
animation().after,
6574
animation().before,
6675
], {
67-
duration: 95,
76+
duration: 255 * durationMultiplier(),
6877
easing: 'cubic-bezier(0.16, 1, 0.3, 1)',
6978
}).onfinish = () => {
7079
done();

0 commit comments

Comments
 (0)