|
14 | 14 | import CardanoLogo from "./icons/CardanoLogo.svelte"; |
15 | 15 | import { motion } from "$lib/actions/motion.svelte"; |
16 | 16 |
|
| 17 | + let innerWidth = $state(0); |
| 18 | + let innerHeight = $state(0); |
| 19 | +
|
| 20 | + let size = $derived.by(() => { |
| 21 | + if (innerWidth <= 640) return "xs"; |
| 22 | + }); |
| 23 | +
|
17 | 24 | // Refs for all circles |
18 | 25 | let containerRef = $state<HTMLElement | SVGElement>(); |
19 | 26 | // Collect stage |
|
33 | 40 | let publish2Ref = $state<HTMLElement | SVGElement>(); |
34 | 41 | let publish3Ref = $state<HTMLElement | SVGElement>(); |
35 | 42 |
|
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); |
52 | 52 | </script> |
53 | 53 |
|
54 | 54 | <svelte:window bind:innerWidth bind:innerHeight /> |
|
0 commit comments