-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Expand file tree
/
Copy pathConnectWalletButton.svelte
More file actions
60 lines (57 loc) · 1.76 KB
/
ConnectWalletButton.svelte
File metadata and controls
60 lines (57 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<script lang="ts">
import SharpWalletIcon from "$lib/components/icons/SharpWalletIcon.svelte"
import { uiStore } from "$lib/stores/ui.svelte"
import { wallets } from "$lib/stores/wallets.svelte"
import { Option } from "effect"
import Button from "./Button.svelte"
</script>
<!-- Mobile: Icon variant -->
<Button
variant="icon"
class="md:hidden"
onclick={() => uiStore.openWalletModal()}
title="My wallets"
>
<SharpWalletIcon class="size-5" />
</Button>
<!-- Desktop: Secondary variant with full content -->
<Button
variant="secondary"
class="hidden md:flex items-center justify-center gap-2 w-full text-sm"
onclick={() => uiStore.openWalletModal()}
title="My wallets"
>
<SharpWalletIcon class="size-5 flex-shrink-0" />
<span class="truncate">My wallets</span>
<div class="flex items-center gap-1 -mr-1 flex-shrink-0">
<div
class="{Option.isSome(wallets.evmAddress) ? 'pulse-1 bg-green-500 shadow-[0_0_2px_1px_rgba(34,197,94,0.6)]' : 'bg-zinc-800'} w-2 h-2 rounded-full transition-colors duration-200"
title="EVM"
>
</div>
<div
class="{Option.isSome(wallets.cosmosAddress) ? 'pulse-2 bg-green-500 shadow-[0_0_2px_1px_rgba(34,197,94,0.6)]' : 'bg-zinc-800'} w-2 h-2 rounded-full transition-colors duration-200"
title="Cosmos"
>
</div>
<div
class="{Option.isSome(wallets.suiAddress) ? 'pulse-3 bg-green-500 shadow-[0_0_2px_1px_rgba(34,197,94,0.6)]' : 'bg-zinc-800'} w-2 h-2 rounded-full transition-colors duration-200"
title="Sui"
>
</div>
</div>
</Button>
<style>
@keyframes pulse {
0% { opacity: 1; }
50% { opacity: 0.7; }
100% { opacity: 1; }
}
.pulse-1 {
animation: pulse 2s ease-in-out infinite;
}
.pulse-2 {
animation: pulse 2s ease-in-out infinite;
animation-delay: 0.3s;
}
</style>