restyle tabs as classic tab bar with connected active tab
This commit is contained in:
@@ -58,25 +58,25 @@
|
|||||||
<h2 class="font-bold mb-2">Add Wallet</h2>
|
<h2 class="font-bold mb-2">Add Wallet</h2>
|
||||||
|
|
||||||
<!-- Mode selector tabs -->
|
<!-- Mode selector tabs -->
|
||||||
<div
|
<div class="flex relative mb-3" id="add-wallet-tabs">
|
||||||
class="flex border-b border-border mb-3"
|
<div
|
||||||
id="add-wallet-tabs"
|
class="absolute bottom-0 left-0 right-0 border-b border-border"
|
||||||
>
|
></div>
|
||||||
<button
|
<button
|
||||||
id="tab-mnemonic"
|
id="tab-mnemonic"
|
||||||
class="px-2 py-1 cursor-pointer text-xs border-b-2 border-fg font-bold"
|
class="tab-active relative z-10 px-3 py-1.5 cursor-pointer text-xs font-bold border border-border border-b-bg bg-bg -mb-px"
|
||||||
>
|
>
|
||||||
From Recovery Phrase
|
From Recovery Phrase
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
id="tab-privkey"
|
id="tab-privkey"
|
||||||
class="px-2 py-1 cursor-pointer text-xs border-b-2 border-transparent text-muted hover:text-fg hover:border-fg"
|
class="tab-inactive relative z-10 px-3 py-1.5 cursor-pointer text-xs text-muted border border-transparent -mb-px hover:text-fg"
|
||||||
>
|
>
|
||||||
From Private Key
|
From Private Key
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
id="tab-xprv"
|
id="tab-xprv"
|
||||||
class="px-2 py-1 cursor-pointer text-xs border-b-2 border-transparent text-muted hover:text-fg hover:border-fg"
|
class="tab-inactive relative z-10 px-3 py-1.5 cursor-pointer text-xs text-muted border border-transparent -mb-px hover:text-fg"
|
||||||
>
|
>
|
||||||
From Extended Key
|
From Extended Key
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -28,10 +28,15 @@ function switchMode(mode) {
|
|||||||
for (const m of MODES) {
|
for (const m of MODES) {
|
||||||
$("add-wallet-section-" + m).classList.toggle("hidden", m !== mode);
|
$("add-wallet-section-" + m).classList.toggle("hidden", m !== mode);
|
||||||
const tab = $("tab-" + m);
|
const tab = $("tab-" + m);
|
||||||
tab.classList.toggle("border-fg", m === mode);
|
const isActive = m === mode;
|
||||||
tab.classList.toggle("font-bold", m === mode);
|
// Active tab: visible borders on top/left/right, bottom border matches bg to "connect" with content
|
||||||
tab.classList.toggle("border-transparent", m !== mode);
|
tab.classList.toggle("border-border", isActive);
|
||||||
tab.classList.toggle("text-muted", m !== mode);
|
tab.classList.toggle("border-b-bg", isActive);
|
||||||
|
tab.classList.toggle("bg-bg", isActive);
|
||||||
|
tab.classList.toggle("font-bold", isActive);
|
||||||
|
tab.classList.toggle("text-muted", !isActive);
|
||||||
|
// Inactive tab: transparent borders
|
||||||
|
tab.classList.toggle("border-transparent", !isActive);
|
||||||
}
|
}
|
||||||
$("add-wallet-password-hint").textContent = PASSWORD_HINTS[mode];
|
$("add-wallet-password-hint").textContent = PASSWORD_HINTS[mode];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user