Skip to content

Commit 0dc9d9a

Browse files
committed
fix workflow animation duration for small screens
1 parent d44fcd0 commit 0dc9d9a

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/lib/components/WorkflowAnimation.svelte

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
import CardanoLogo from "./icons/CardanoLogo.svelte";
1515
import { motion } from "$lib/actions/motion.svelte";
1616
17+
let innerWidth = $state(0);
18+
let innerHeight = $state(0);
19+
20+
let size = $derived.by(() => {
21+
if (innerWidth <= 640) return "xs";
22+
});
23+
1724
// Refs for all circles
1825
let containerRef = $state<HTMLElement | SVGElement>();
1926
// Collect stage
@@ -33,22 +40,15 @@
3340
let publish2Ref = $state<HTMLElement | SVGElement>();
3441
let publish3Ref = $state<HTMLElement | SVGElement>();
3542
36-
let collect1Duration = $state(4);
37-
let collect2Duration = $state(4);
38-
let collect3Duration = $state(4);
39-
let collectToProcessDuration = $state(4);
40-
let process1Duration = $state(4);
41-
let processToValidateDuration = $state(4);
42-
let validate1Duration = $state(4);
43-
let validateToPublishDuration = $state(4);
44-
let publish1Duration = $state(4);
45-
46-
let innerWidth = $state(0);
47-
let innerHeight = $state(0);
48-
49-
let size = $derived.by(() => {
50-
if (innerWidth <= 640) return "xs";
51-
});
43+
let collect1Duration = $derived(size === "xs" ? 8 : 4);
44+
let collect2Duration = $derived(size === "xs" ? 8 : 4);
45+
let collect3Duration = $derived(size === "xs" ? 8 : 4);
46+
let collectToProcessDuration = $derived(size === "xs" ? 8 : 4);
47+
let process1Duration = $derived(size === "xs" ? 8 : 4);
48+
let processToValidateDuration = $derived(size === "xs" ? 8 : 4);
49+
let validate1Duration = $derived(size === "xs" ? 8 : 4);
50+
let validateToPublishDuration = $derived(size === "xs" ? 8 : 4);
51+
let publish1Duration = $derived(size === "xs" ? 8 : 4);
5252
</script>
5353

5454
<svelte:window bind:innerWidth bind:innerHeight />

0 commit comments

Comments
 (0)