|
1 | 1 | <script lang="ts"> |
2 | | - import { Database01FreeIcons, PauseFreeIcons, PlayFreeIcons } from "@hugeicons/core-free-icons"; |
3 | | - import { HugeiconsIcon } from "@hugeicons/svelte"; |
| 2 | + import { Database01FreeIcons, PauseFreeIcons, PlayFreeIcons } from '@hugeicons/core-free-icons'; |
| 3 | + import { HugeiconsIcon } from '@hugeicons/svelte'; |
4 | 4 |
|
5 | | - interface IEvent { |
6 | | - id: string, |
7 | | - from: string, |
8 | | - to: string, |
9 | | - imageSrc?: string, |
10 | | - vaultName?: string |
11 | | - } |
| 5 | + interface IEvent { |
| 6 | + id: string; |
| 7 | + from: string; |
| 8 | + to: string; |
| 9 | + imageSrc?: string; |
| 10 | + vaultName?: string; |
| 11 | + } |
12 | 12 |
|
13 | | - interface IDataFlowProps { |
14 | | - events: IEvent[]; |
15 | | - } |
| 13 | + interface IDataFlowProps { |
| 14 | + events: IEvent[]; |
| 15 | + } |
16 | 16 |
|
17 | | - let {events}: IDataFlowProps = $props(); |
| 17 | + let { events }: IDataFlowProps = $props(); |
18 | 18 | let isPaused = $state(false); |
19 | 19 | </script> |
20 | 20 |
|
21 | | -<style> |
22 | | - .dot{ |
23 | | - offset-path: rect(0px 100% 175px 0px round 0%); |
24 | | - offset-distance: 0%; |
25 | | - offset-rotate: auto; |
26 | | - animation: move 10s linear infinite; |
27 | | - animation-play-state: var(--dot-animation-state, running); |
28 | | - } |
29 | | -
|
30 | | - @keyframes move { |
31 | | - 0% { |
32 | | - offset-distance: 100%; |
33 | | - opacity: 1; |
34 | | - } |
35 | | - 50% { |
36 | | - opacity: 1; |
37 | | - } |
38 | | - 55% { |
39 | | - opacity: 0.4; |
40 | | - } |
41 | | - 60% { |
42 | | - opacity: 0; |
43 | | - } |
44 | | - 100% { |
45 | | - offset-distance: 0%; |
46 | | - opacity: 0; |
47 | | - } |
48 | | - } |
| 21 | +<article class="bg-gray flex h-[80vh] w-full flex-col items-center rounded-md px-16 py-6"> |
| 22 | + <div class="mb-20.5 flex w-full items-center justify-between"> |
| 23 | + <h4 class="text-xl">Live Monitoring</h4> |
| 24 | + <button |
| 25 | + onclick={() => (isPaused = !isPaused)} |
| 26 | + class="font-geist text-black-700 flex items-center gap-2 rounded-4xl border border-[#e5e5e5] bg-white px-4 py-3 text-base font-medium" |
| 27 | + > |
| 28 | + {#if isPaused} |
| 29 | + <HugeiconsIcon icon={PlayFreeIcons} size="24px" /> |
| 30 | + {:else} |
| 31 | + <HugeiconsIcon icon={PauseFreeIcons} size="24px" /> |
| 32 | + {/if} |
| 33 | + {isPaused ? 'Resume Live Feed' : 'Pause Live Feed'} |
| 34 | + </button> |
| 35 | + </div> |
| 36 | + <div class="relative z-10 flex w-full items-center justify-between"> |
| 37 | + <!-- svelte-ignore element_invalid_self_closing_tag --> |
| 38 | + <div |
| 39 | + class="border-s-green border-b-green border-e-green absolute start-[50%] top-[55%] z-[-1] h-[175px] w-[88%] translate-x-[-50%] rounded-md border border-t-transparent bg-transparent" |
| 40 | + > |
| 41 | + <div |
| 42 | + class="dot bg-green absolute start-[-1px] top-0 h-2.5 w-2.5 rounded-full" |
| 43 | + style="--dot-animation-state: {isPaused ? 'paused' : 'running'}" |
| 44 | + /> |
| 45 | + </div> |
49 | 46 |
|
50 | | -</style> |
| 47 | + <div |
| 48 | + class="flex flex-col items-center justify-center gap-2 rounded-md border border-black/10 bg-white p-3" |
| 49 | + > |
| 50 | + <HugeiconsIcon icon={Database01FreeIcons} /> |
| 51 | + <div class="text-sm font-semibold">{events[0].from}</div> |
| 52 | + <div class="text-xs text-gray-500">{events[0].vaultName}</div> |
| 53 | + </div> |
51 | 54 |
|
52 | | -<article class="w-full h-[80vh] px-16 py-6 flex flex-col items-center bg-gray rounded-md"> |
53 | | - <div class="w-full flex justify-between items-center mb-20.5"> |
54 | | - <h4 class="text-xl">Live Monitoring</h4> |
55 | | - <button onclick={() => isPaused = !isPaused} class="px-4 py-3 flex items-center gap-2 text-base font-geist font-medium text-black-700 bg-white border border-[#e5e5e5] rounded-4xl"> |
56 | | - {#if isPaused} |
57 | | - <HugeiconsIcon icon={PlayFreeIcons} size="24px"/> |
58 | | - {:else} |
59 | | - <HugeiconsIcon icon={PauseFreeIcons} size="24px"/> |
60 | | - {/if} |
61 | | - {isPaused ? 'Resume Live Feed' : 'Pause Live Feed'} |
62 | | - </button> |
63 | | - </div> |
64 | | - <div class="relative w-full flex justify-between items-center z-10"> |
65 | | - <!-- svelte-ignore element_invalid_self_closing_tag --> |
66 | | - <div class="w-[88%] h-[175px] absolute top-[55%] start-[50%] z-[-1] translate-x-[-50%] bg-transparent border border-t-transparent border-s-green border-b-green border-e-green rounded-md"> |
67 | | - <div class="dot absolute h-2.5 w-2.5 top-0 start-[-1px] bg-green rounded-full" style="--dot-animation-state: {isPaused ? 'paused' : 'running'}"/> |
68 | | - </div> |
| 55 | + <div |
| 56 | + class="absolute start-[50%] top-[200px] translate-x-[-50%] rounded-md bg-white p-3 text-center shadow" |
| 57 | + > |
| 58 | + <img src="/" alt="Icon" /> |
| 59 | + <div class="text-xs text-gray-700">{events[1].from}</div> |
| 60 | + </div> |
69 | 61 |
|
70 | | - <div class="flex flex-col items-center justify-center rounded-md gap-2 bg-white p-3 border border-black/10"> |
71 | | - <HugeiconsIcon icon={Database01FreeIcons}/> |
72 | | - <div class="font-semibold text-sm">{events[0].from}</div> |
73 | | - <div class="text-xs text-gray-500">{events[0].vaultName}</div> |
74 | | - </div> |
| 62 | + <div |
| 63 | + class="border-green flex flex-col items-center justify-center gap-2 rounded-md border bg-white p-3" |
| 64 | + > |
| 65 | + <HugeiconsIcon icon={Database01FreeIcons} /> |
| 66 | + <div class="text-sm font-semibold">{events[2].from}</div> |
| 67 | + <div class="text-xs text-gray-500">{events[2].vaultName}</div> |
| 68 | + </div> |
| 69 | + </div> |
| 70 | +</article> |
75 | 71 |
|
76 | | - <div class="bg-white p-3 rounded-md shadow absolute top-[200px] start-[50%] translate-x-[-50%] text-center"> |
77 | | - <img src="/" alt="Icon"> |
78 | | - <div class="text-xs text-gray-700">{events[1].from}</div> |
79 | | - </div> |
| 72 | +<style> |
| 73 | + .dot { |
| 74 | + offset-path: rect(0px 100% 175px 0px round 0%); |
| 75 | + offset-distance: 0%; |
| 76 | + offset-rotate: auto; |
| 77 | + animation: move 10s linear infinite; |
| 78 | + animation-play-state: var(--dot-animation-state, running); |
| 79 | + } |
80 | 80 |
|
81 | | - <div class="flex flex-col items-center justify-center rounded-md gap-2 bg-white p-3 border border-green"> |
82 | | - <HugeiconsIcon icon={Database01FreeIcons}/> |
83 | | - <div class="font-semibold text-sm">{events[2].from}</div> |
84 | | - <div class="text-xs text-gray-500">{events[2].vaultName}</div> |
85 | | - </div> |
86 | | - </div> |
87 | | -</article> |
| 81 | + @keyframes move { |
| 82 | + 0% { |
| 83 | + offset-distance: 100%; |
| 84 | + opacity: 1; |
| 85 | + } |
| 86 | + 50% { |
| 87 | + opacity: 1; |
| 88 | + } |
| 89 | + 55% { |
| 90 | + opacity: 0.4; |
| 91 | + } |
| 92 | + 60% { |
| 93 | + opacity: 0; |
| 94 | + } |
| 95 | + 100% { |
| 96 | + offset-distance: 0%; |
| 97 | + opacity: 0; |
| 98 | + } |
| 99 | + } |
| 100 | +</style> |
0 commit comments