aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-03-19 10:23:34 -0700
committerAdam Soltys <[email protected]>2024-03-19 10:23:34 -0700
commita4685f61e656ed0e3cd343073931867955be3281 (patch)
treec28c446ef0f6d5cbc37a7c58f954c145bd18ef80 /src/components
parentc6c2ac113186ba304c46580320df91c119ab5314 (diff)
parente2bb9d704878070054fa8ef81da73b248e2c4f97 (diff)
downloadcoinos-ui-a4685f61e656ed0e3cd343073931867955be3281.tar.gz
coinos-ui-a4685f61e656ed0e3cd343073931867955be3281.zip
Merge remote-tracking branch 'muriwolf/swapee' into swapee
Diffstat (limited to 'src/components')
-rw-r--r--src/components/AppHeader.svelte50
-rw-r--r--src/components/Balance.svelte4
-rw-r--r--src/components/Code.svelte2
-rw-r--r--src/components/Footer.svelte102
-rw-r--r--src/components/LandingHeader.svelte40
-rw-r--r--src/components/Numpad.svelte12
-rw-r--r--src/components/Password.svelte14
-rw-r--r--src/components/Pin.svelte6
-rw-r--r--src/components/Pinpad.svelte12
-rw-r--r--src/components/Toggle.svelte6
-rw-r--r--src/components/buttons/ThemeToggle.svelte28
11 files changed, 153 insertions, 123 deletions
diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte
index 26982456..42536e62 100644
--- a/src/components/AppHeader.svelte
+++ b/src/components/AppHeader.svelte
@@ -41,36 +41,45 @@
{#if !$loading}
<header
- class="bg-gradient-to-r {$colorTheme} h-[175px] w-full relative bg-cover mb-20"
+ class="bg-gradient-to-r {$colorTheme} dark:!from-violet-600 dark:!to-swapee-purple h-[175px] w-full relative bg-cover mb-20"
style:background-image={bg}
>
- <nav class="flex justify-end items-center space-x-4 p-5">
+ <nav class="flex justify-end items-center gap-x-2 xs:gap-x-4 p-5">
{#if user}
<a href={`/${user.username}`}>
<button
- class="bg-white p-2 rounded-full w-12 h-12 md:w-16 md:h-16 drop-shadow-xl border border-black/10 {$page
+ class="bg-white dark:bg-black p-2 rounded-full w-12 h-12 md:w-16 md:h-16 drop-shadow-xl border border-black/10 {$page
.url.pathname === `/${user.username}`
? 'opacity-100'
: 'opacity-70 hover:opacity-80'}"
- ><Icon icon="home" style="mx-auto w-6 md:w-8" />
+ ><Icon icon="home" style="mx-auto w-6 md:w-8 dark:invert" />
+ </button>
+ </a>
+ <a href={`/${user.username}/buy`}>
+ <button
+ class="bg-white dark:bg-black p-2 rounded-full w-12 h-12 md:w-16 md:h-16 drop-shadow-xl border border-black/10 {$page
+ .url.pathname === `/${user.username}/buy`
+ ? 'opacity-100'
+ : 'opacity-70 hover:opacity-80'}"
+ ><Icon icon="shop" style="mx-auto w-6 md:w-8 dark:invert" />
</button>
</a>
<a href={`/${user.username}/receive`}>
<button
- class="bg-white p-2 rounded-full w-12 h-12 md:w-16 md:h-16 drop-shadow-xl border border-black/10 {$page
+ class="bg-white dark:bg-black p-2 rounded-full w-12 h-12 md:w-16 md:h-16 drop-shadow-xl border border-black/10 {$page
.url.pathname === `/${user.username}/receive`
? 'opacity-100'
: 'opacity-70 hover:opacity-80'}"
- ><Icon icon="numpad" style="mx-auto w-6 md:w-8" />
+ ><Icon icon="numpad" style="mx-auto w-6 md:w-8 dark:invert" />
</button>
</a>
<a href={`/${user.username}/payments`}>
<button
- class="bg-white p-2 rounded-full w-12 h-12 md:w-16 md:h-16 drop-shadow-xl border border-black/10 {$page
+ class="bg-white dark:bg-black p-2 rounded-full w-12 h-12 md:w-16 md:h-16 drop-shadow-xl border border-black/10 {$page
.url.pathname === `/${user.username}/payments`
? 'opacity-100'
: 'opacity-70 hover:opacity-80'} relative"
- ><Icon icon="clock" style="mx-auto w-6 md:w-8" />
+ ><Icon icon="clock" style="mx-auto w-6 md:w-8 dark:invert" />
{#if $newPayment}
<span class="absolute top-0 right-0">
<span class="flex h-3 w-3">
@@ -87,17 +96,17 @@
</a>
<a href={`/send`}>
<button
- class="bg-white p-2 rounded-full w-12 h-12 md:w-16 md:h-16 drop-shadow-xl border border-black/10 {$page
+ class="bg-white dark:bg-black p-2 rounded-full w-12 h-12 md:w-16 md:h-16 drop-shadow-xl border border-black/10 {$page
.url.pathname === `/send`
? 'opacity-100'
: 'opacity-70 hover:opacity-80'}"
- ><Icon icon="send" style="mx-auto w-6 md:w-8" />
+ ><Icon icon="send" style="mx-auto w-6 md:w-8 dark:invert" />
</button>
</a>
<div class="relative">
<OutClick on:outclick={() => (showMenu = false)}>
<button
- class="bg-white p-2 rounded-full w-12 h-12 md:w-16 md:h-16 drop-shadow-xl border border-black/10 {$page
+ class="bg-white dark:bg-black p-2 rounded-full w-12 h-12 md:w-16 md:h-16 drop-shadow-xl border border-black/10 {$page
.url.pathname === `/${user.username}` ||
$page.url.pathname === `/${user.username}/settings` ||
$page.url.pathname === `/support`
@@ -106,36 +115,37 @@
showMenu ? 'opacity-80' : ''
}`}"
on:click={() => (showMenu = !showMenu)}
- ><Icon icon="menu" style="mx-auto w-6 md:w-8" />
+ ><Icon icon="menu" style="mx-auto w-6 md:w-8 dark:invert" />
</button>
<div
class="{showMenu
? 'block'
- : 'hidden'} absolute top-14 right-0 bg-white rounded-3xl p-8 shadow-xl z-50"
+ : 'hidden'} absolute top-14 right-0 bg-white dark:bg-black dark:border-2 dark:border-gray-50 rounded-3xl p-8 shadow-xl z-50"
>
<ul class="space-y-5 w-48">
{#each menuButtons as { href, icon, key }}
<li>
<a {href} data-sveltekit-prefetch="off">
<button
- class="flex justify-center items-center font-semibold hover:opacity-80"
- ><Icon {icon} style="mr-2 w-6 md:w-8" /> {$t(key)}
+ class="flex justify-center items-center font-semibold hover:opacity-80 dark:hover:opacity-70"
+ ><Icon {icon} style="mr-2 w-6 md:w-8 dark:invert" /> {$t(key)}
</button>
</a>
</li>
{/each}
</ul>
- <hr class="my-4" />
- <a href="/"
- ><img src="/images/logo.svg" alt="Swapee" class="w-32" /></a
- >
+ <hr class="my-4 dark:border-white" />
+ <a href="/">
+ <img src="/images/logo.svg" alt="Swapee" class="w-32 dark:hidden" />
+ <img src="/images/logo-white.png" alt="Swapee" class="w-32 hidden dark:block" />
+ </a>
</div>
</OutClick>
</div>
{:else}
<a href={`/login?redirect=${$page.url.pathname}`}>
- <button class="bg-white px-5 py-2 rounded-xl font-semibold text-sm"
+ <button class="bg-white dark:bg-black px-5 py-2 rounded-xl font-semibold text-sm"
>{$t("nav.signIn")}</button
>
</a>
diff --git a/src/components/Balance.svelte b/src/components/Balance.svelte
index 98a04ef6..d72f10e6 100644
--- a/src/components/Balance.svelte
+++ b/src/components/Balance.svelte
@@ -21,13 +21,13 @@
{:else}
<div class="text-5xl font-bold tabular-nums">
{#if isNaN(rate)}
- <div class="text-gray-200">&mdash;</div>
+ <div class="text-gray-200 ">&mdash;</div>
{:else}
{f((user.balance * rate) / sats, user.currency)}
{/if}
</div>
- <div class="text-secondary text-2xl">
+ <div class="text-secondary dark:text-gray-300 text-2xl">
⚡️{s(user.balance)}
</div>
{/if}
diff --git a/src/components/Code.svelte b/src/components/Code.svelte
index c8c1058a..9d54cc7b 100644
--- a/src/components/Code.svelte
+++ b/src/components/Code.svelte
@@ -6,7 +6,7 @@
</script>
<div
- class="bg-black text-white rounded-lg p-4 flex gap-4 whitespace-pre-wrap font-mono"
+ class="bg-stone-900 dark:bg-stone-800 text-white rounded-lg p-4 px-5 flex gap-4 whitespace-pre-wrap font-mono shadow-inner shadow-stone-950 dark:shadow-stone-900"
>
<div class="overflow-x-scroll max-w-full scrollbar-hide">
<div class="break-all min-w-[800px]">{samples[sample]}</div>
diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte
index 92fb23c6..12977900 100644
--- a/src/components/Footer.svelte
+++ b/src/components/Footer.svelte
@@ -14,62 +14,50 @@
{ url: "/support", titleID: "support" },
];
</script>
+<footer class="pt-16 bg-black">
+ <div class="max-w-[1296px] mx-auto px-8">
+ <!-- footer_top -->
+ <div class="footer_top pb-4">
+ <div class="flex-col md:flex-row flex md:items-center justify-between">
+ <div class="flex-1 mb-12 sm:mb-5">
+ <a href="#" class="footer_logo"><img src="images/footer-logo.png" alt="" /></a>
+ <p class="text-gray-200 mt-10">Copyright © 2023. Swapee.me</p>
+ <p class="text-gray-200 mt-3">All rights reserved.</p>
+ <a href="#" class="btn_language inline-block mt-6 font-bold !text-white hover:!text-black">English</a>
+ </div>
+ <div
+ class="flex-1 footer_top_right flex items-center justify-start md:justify-center "
+ >
+ <div class="flex max-sm:flex-col md:justify-end gap-x-6">
+ <div class="flex-1 xl:mb-0 mb-4 md:pr-0 sm:pr-5">
+ <h6 class="!text-white/80 mb-0">Business enquiries</h6>
+ <a href="mailto:[email protected]">[email protected]</a>
+ </div>
+ <div class="flex-1 xs:pr-5 mb-4 md:pr-0 sm:pr-5">
+ <h6 class="!text-white/80 mb-0">Support enquiries</h6>
+ <a href="mailto:[email protected]">[email protected]</a>
+ </div>
+ </div>
+ </div>
+ </div>
-<footer
- class="space-y-10 md:space-y-0 text-xl block md:flex justify-around mb-20"
->
- <div class="space-y-5">
- <div class="text-center w-full">
- <a href="/"><Icon icon="logo" style="w-48 mx-auto md:mx-0" /></a>
- </div>
- <div class="flex gap-2 justify-center sm:hidden">
- <div>
- <a href="/register">
- <button
- class="bg-black text-white border rounded-full px-4 py-2 font-bold hover:opacity-80 text-lg"
- >
- {$t("nav.startInSeconds")}
- </button>
- </a>
- </div>
- </div>
- <div class="w-full flex">
- <div class="mx-auto">
- <LocaleSelector
- style="p-2 text-center hover:opacity-80 cursor-pointer border rounded-full"
- />
- </div>
- </div>
- </div>
-
- <div class="text-center md:text-left">
- <p class="font-semibold">{$t("footer.followUs")}</p>
- <ul class="mt-5 text-secondary space-y-3 font-medium">
- {#each followLinks as link}
- <li>
- <a
- href={link.url}
- target="_blank"
- rel="noreferrer"
- class="hover:opacity-80">{$t("footer." + link.titleID)}</a
- >
- </li>
- {/each}
- </ul>
- </div>
-
- <div class="text-center md:text-left">
- <p class="font-semibold">{$t("footer.company")}</p>
- <ul class="mt-5 text-secondary space-y-3">
- {#each companyLinks as link}
- <li>
- <a href={link.url} class="hover:opacity-80"
- >{$t("footer." + link.titleID)}</a
- >
- </li>
- {/each}
- </ul>
- </div>
-
- <Icon icon="shield" style="mx-auto md:mx-0" />
+ <!-- footer_bottom -->
+ <div class="footer_bottom pt-4 pb-2">
+ <ul class="list-unstyled mb-0 ps-0">
+ <li class="pb-3 ">
+ <a href="/docs" class="!text-white/80 opacity-100 hover:!text-swapee-purple/100 font-semibold">Documentation</a>
+ </li>
+ <li class="pb-3">
+ <a href="/privacy" class="!text-white/80 opacity-100 hover:!text-swapee-purple/100 font-semibold">Privacy Policy</a>
+ </li>
+ <li class="pb-3">
+ <a href="/support" class="!text-white/80 opacity-100 hover:!text-swapee-purple/100 font-semibold">Support</a>
+ </li>
+ <li class="pb-3">
+ <a href="/sitemap" class="!text-white/80 opacity-100 hover:!text-swapee-purple/100 font-semibold">Sitemap</a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
</footer>
diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte
index 009ab063..e0a2aad0 100644
--- a/src/components/LandingHeader.svelte
+++ b/src/components/LandingHeader.svelte
@@ -19,13 +19,14 @@
</script>
<header
- class="w-full lg:w-5/6 py-5 mx-auto fixed md:sticky z-10 top-0 bg-white/90"
+ class="w-full container px-10 lg:px-40 md:pb-5 pt-5 mx-auto fixed md:sticky z-10 top-0 bg-white/80 dark:bg-black/80 backdrop-blur-sm"
bind:this={header}
>
- <nav class="block xl:flex flex-wrap justify-between items-center">
+ <nav class="reltive flex flex-wrap justify-between items-center max-md:pb-4">
<div class="flex justify-start md:justify-center items-center md:space-x-10">
- <a href="/" on:click={() => scroll(header)}>
- <img src="images/logo.png" class="max-w-[140px]" />
+ <a href="/" on:click={() => scroll(header)} class="">
+ <img src="images/logo.png" class="max-w-[140px] dark:hidden" alt="swapee logo" />
+ <img src="images/logo-white.png" class="max-w-[140px] hidden dark:inline-block" alt="swapee logo" />
</a>
</div>
@@ -46,24 +47,24 @@
{/if}
{#if user}
<button
- class="border rounded-full px-6 py-2 font-bold"
+ class="dark:!bg-black dark:!text-white border-black dark:!border-white !border-2 !font-bold px-6 py-2 rounded-full"
on:click={() => goto(`/${user.username}`)}
- >Home
+ >Home
</button>
<button
- class="bg-black text-white border rounded-full px-6 py-2 font-bold"
+ class="bg-black dark:!bg-white dark:!text-black !text-white border-2 border-black rounded-full px-6 py-2 font-bold"
on:click={() => goto("/logout")}
>
{$t("nav.signOut")}
</button>
{:else}
<button
- class="border rounded-full px-6 py-2 font-bold hover:opacity-80"
+ class="dark:!bg-black dark:!text-white border-black dark:!border-white !border-2 !font-bold px-6 py-2 rounded-full hover:opacity-80"
on:click={() => goto("/register")}
>{$t("nav.startInSeconds")}
</button>
<button
- class="bg-black text-white border rounded-full px-6 py-2 font-bold hover:opacity-80"
+ class="bg-black dark:!bg-white dark:!text-black !text-white border-2 border-black rounded-full px-6 py-2 font-bold hover:opacity-80"
on:click={() => goto("/login")}
>
{$t("nav.signIn")}
@@ -73,46 +74,46 @@
<!-- mobile nav -->
<button
- class="block md:hidden absolute top-[34.5px] right-10 z"
+ class="scale-125 z-50 md:hidden"
on:click={() => (showMobileMenu = !showMobileMenu)}
- ><Icon icon={!showMobileMenu ? "menu" : "close"} />
+ ><Icon icon={!showMobileMenu ? "menu" : "close"} style="dark:invert" />
</button>
<div
class="container w-full px-10 md:hidden absolute top-0 {showMobileMenu
? 'right-0'
- : 'right-[-100%]'} transition-all ease-in-out duration-300 h-[100vh] w-full bg-white"
+ : 'right-[-100%]'} transition-all ease-in-out duration-300 h-[100vh] w-full bg-white dark:bg-black"
>
<div class="space-y-8 mt-24 font-bold text-xl">
- <button on:click={() => mobileMenuButtonClick(howItWorks)} class="block"
+ <button on:click={() => mobileMenuButtonClick(howItWorks)} class="block dark:!text-gray-200"
>{$t("howItWorks.header")}</button
>
- <button on:click={() => mobileMenuButtonClick(faq)} class="block"
+ <button on:click={() => mobileMenuButtonClick(faq)} class="block dark:!text-gray-200"
>{$t("faq.header")}</button
>
- <button on:click={() => mobileMenuButtonClick(about)} class="block"
+ <button on:click={() => mobileMenuButtonClick(about)} class="block dark:!text-gray-200"
>{$t("about.header")}</button
>
{#if !user}
<button
- class="border rounded-full px-6 py-2 font-bold block w-full"
+ class="dark:!bg-black dark:!text-white border-black dark:!border-white !border-2 !font-bold px-6 py-2 rounded-full w-full"
on:click={() => goto("/register")}
>{$t("nav.startInSeconds")}
</button>
<button
- class="bg-black text-white border rounded-full px-6 py-2 font-bold block w-full"
+ class="bg-black dark:!bg-white dark:!text-black !text-white border-2 border-black rounded-full px-6 py-2 font-bold w-full"
on:click={() => goto("/login")}
>
{$t("nav.signIn")}
</button>
{:else}
<button
- class="border rounded-full px-6 py-2 font-bold block"
+ class="dark:!bg-black dark:!text-white border-black dark:!border-white !border-2 !font-bold px-6 py-2 rounded-full"
on:click={() => goto(`/${user.username}`)}
>{$t("nav.account")}
</button>
<button
- class="bg-black text-white border rounded-full px-6 py-2 font-bold block"
+ class="bg-black dark:!bg-white dark:!text-black !text-white border-2 border-black rounded-full px-6 py-2 font-bold w-full"
on:click={() => goto("/logout")}
>
{$t("nav.signOut")}
@@ -124,6 +125,7 @@
</header>
<style>
+ @import '../../static/style.css';
.z {
z-index: 100;
}
diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte
index 901d11ba..aa109f7e 100644
--- a/src/components/Numpad.svelte
+++ b/src/components/Numpad.svelte
@@ -183,7 +183,7 @@
<div
class="text-5xl md:text-6xl font-semibold tracking-widest flex justify-center"
>
- <div class="my-auto" class:text-5xl={!fiat}>
+ <div class="my-auto font-bebasNeue tracking-[0.2rem]" class:text-5xl={!fiat}>
{fiat ? symbol : "⚡️"}
</div>
<div
@@ -194,11 +194,11 @@
on:blur={blur}
on:input={input}
on:keydown={keydown}
- class="outline-none my-auto"
+ class="outline-none my-auto font-bebasNeue tracking-[0.4rem] mt-2"
/>
</div>
<div class="mt-2">
- <span class="text-secondary mr-1"
+ <span class="text-secondary dark:text-gray-300 mr-1"
>{fiat ? sat(amount) : f(amountFiat, currency)}</span
>
<button
@@ -213,7 +213,7 @@
: 0;
}
fiat = !fiat;
- }}><Icon icon="swap" style="inline hover:opacity-80" /></button
+ }}><Icon icon="swap" style="inline hover:opacity-80 dark:invert" /></button
>
</div>
</div>
@@ -223,7 +223,7 @@
{#if value === arrow}
<button
type="button"
- class="bg-gray-100 rounded-xl py-4 px-8 font-semibold active:bg-black active:flex justify-center items-center hover:opacity-80"
+ class="bg-gray-100 dark:bg-stone-800 rounded-xl py-4 px-8 font-semibold active:bg-black dark:active:bg-stone-900 active:flex justify-center items-center hover:opacity-80"
on:click={() => handleInput(value)}
>
<Left />
@@ -231,7 +231,7 @@
{:else}
<button
type="button"
- class="bg-gray-100 rounded-xl py-4 px-8 font-semibold active:bg-black active:text-white hover:opacity-80"
+ class="bg-gray-100 dark:bg-stone-800 rounded-xl py-4 px-8 font-semibold active:bg-black dark:active:bg-stone-900 active:text-white hover:opacity-80"
on:click={() => handleInput(value)}>{value}</button
>
{/if}
diff --git a/src/components/Password.svelte b/src/components/Password.svelte
index da65d718..81714904 100644
--- a/src/components/Password.svelte
+++ b/src/components/Password.svelte
@@ -23,10 +23,10 @@
</script>
<div
- class="fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-20"
+ class="fixed inset-0 bg-gray-600 dark:bg-stone-950 dark:bg-opacity-90 bg-opacity-50 overflow-y-auto h-full w-full z-20"
>
<div
- class="relative top-1/3 mx-auto p-5 border w-96 shadow-lg rounded-md bg-white space-y-5"
+ class="relative top-1/3 mx-auto p-5 border w-96 shadow-lg rounded-md bg-white dark:bg-stone-800 dark:border-0 space-y-5"
>
<h1 class="text-center text-2xl font-semibold">
Please enter your password
@@ -38,7 +38,7 @@
name="password"
type="text"
required
- class="bg-primary"
+ class="bg-primary dark:bg-stone-700 dark:border-gray-50"
bind:value={password}
autocapitalize="none"
use:focus
@@ -48,7 +48,7 @@
name="password"
type="password"
required
- class="bg-primary"
+ class="bg-primary dark:bg-stone-700 dark:border-gray-50"
bind:value={password}
autocapitalize="none"
use:focus
@@ -57,7 +57,7 @@
<button
type="button"
on:click={() => (revealPassword = !revealPassword)}
- class="absolute right-5 top-6"
+ class="absolute right-5 dark:invert {revealPassword ? 'top-[18px]' : 'top-[16px]'}"
>
<Icon icon={revealPassword ? "eye" : "eye-off"} />
</button>
@@ -65,7 +65,7 @@
<div class="w-full flex">
<button
type="button"
- class="border-2 border-black rounded-xl font-semibold mx-auto py-3 w-40 hover:opacity-80 mx-auto"
+ class="border-2 border-black dark:border-gray-50 dark:text-gray-50 rounded-xl font-semibold py-3 w-40 hover:opacity-80 mx-auto"
on:click={cancel}
on:keydown={cancel}
>
@@ -73,7 +73,7 @@
</button>
<button
type="submit"
- class="border-2 border-black rounded-xl font-semibold mx-auto py-3 w-40 hover:opacity-80 mx-auto"
+ class="border-2 border-black dark:border-gray-50 bg-black text-white dark:bg-gray-50 dark:text-black rounded-xl font-semibold py-3 w-40 hover:opacity-80 mx-auto"
>
<div class="my-auto">Submit</div>
</button>
diff --git a/src/components/Pin.svelte b/src/components/Pin.svelte
index 9938f9a1..58a669e8 100644
--- a/src/components/Pin.svelte
+++ b/src/components/Pin.svelte
@@ -43,16 +43,16 @@
{#if loaded}
<div
- class="fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50"
+ class="fixed inset-0 bg-gray-600 dark:bg-stone-950 dark:bg-opacity-90 bg-opacity-50 overflow-y-auto h-full w-full z-50"
>
<div
- class="relative top-40 mx-auto p-5 border w-96 shadow-lg rounded-md bg-white space-y-5"
+ class="relative top-40 mx-auto p-5 border w-96 shadow-lg rounded-lg bg-white dark:bg-stone-800 dark:border-0 space-y-5"
>
<h1 class="text-center text-2xl font-semibold">{title}</h1>
<Pinpad bind:v={p} {cancel} />
<div class="w-full flex">
<button
- class="border-2 border-black rounded-xl font-semibold mx-auto py-3 w-40 hover:opacity-80 mx-auto"
+ class="border-2 border-black dark:border-gray-50 dark:text-gray-50 rounded-xl font-semibold mx-auto py-3 w-40 hover:opacity-80"
on:click|preventDefault={cancel}
>
<div class="my-auto">Cancel</div>
diff --git a/src/components/Pinpad.svelte b/src/components/Pinpad.svelte
index 641ddb2b..1dc20366 100644
--- a/src/components/Pinpad.svelte
+++ b/src/components/Pinpad.svelte
@@ -45,14 +45,14 @@
use:focus
bind:value={v}
type="password"
- class="outline-none border-0 text-center py-0"
+ class="outline-none border-0 text-center py-0 dark:bg-stone-800 dark:text-white"
pattern="[0-9]+"
/>
{:else}
<input
on:keydown={validate}
bind:value={v}
- class="outline-none border-0 text-center py-0"
+ class="outline-none border-0 text-center py-0 dark:bg-stone-800 dark:text-white"
type="text"
pattern="[0-9]+"
/>
@@ -60,18 +60,18 @@
<button
type="button"
on:click={() => (hide = !hide)}
- class="absolute -right-5 top-5"
+ class="absolute -right-5 dark:invert {hide ? 'top-5' : 'top-[22px]'}"
>
<Icon icon={hide ? "eye-off" : "eye"} style="w-8" />
</button>
</div>
- <div class="grid grid-cols-3 gap-2 w-[300px] mx-auto grayscale">
+ <div class="grid grid-cols-3 gap-2 w-[300px] mx-auto">
{#each numPad as value}
{#if value === arrow}
<button
type="button"
- class="bg-primary rounded-xl py-4 px-8 font-semibold active:bg-black active:text-white flex justify-center items-center hover:opacity-80"
+ class="bg-primary dark:bg-stone-700 rounded-xl py-4 px-8 font-semibold dark:text-gray-50 active:bg-black active:text-white flex justify-center items-center hover:opacity-80"
on:click={() => handleInput(value)}
>
<Left />
@@ -79,7 +79,7 @@
{:else}
<button
type="button"
- class="bg-primary rounded-xl py-4 px-8 font-semibold active:bg-black active:text-white hover:opacity-80"
+ class="bg-primary dark:bg-stone-700 rounded-xl py-4 px-8 font-semibold dark:text-gray-50 active:bg-black dark:active:bg-stone-900 active:text-white hover:opacity-80"
on:click={() => handleInput(value)}>{value}</button
>
{/if}
diff --git a/src/components/Toggle.svelte b/src/components/Toggle.svelte
index 2f92837d..1d34ccd6 100644
--- a/src/components/Toggle.svelte
+++ b/src/components/Toggle.svelte
@@ -3,7 +3,9 @@
export let value;
</script>
-<label for={id} class="inline-flex relative items-center mr-5 cursor-pointer">
+<!-- svelte-ignore a11y-click-events-have-key-events -->
+<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
+<label for={id} class="inline-flex relative items-center mr-5 cursor-pointer" on:click>
<input
type="checkbox"
bind:checked={value}
@@ -12,6 +14,6 @@
class="sr-only peer"
/>
<div
- class="w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-gray-300 dark:peer-focus:ring-gray-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-green-500"
+ class="w-11 h-6 bg-gray-200 rounded-full peer dark:bg-stone-800 peer-focus:ring-4 peer-focus:ring-gray-300 dark:peer-focus:ring-gray-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-green-500"
/>
</label>
diff --git a/src/components/buttons/ThemeToggle.svelte b/src/components/buttons/ThemeToggle.svelte
new file mode 100644
index 00000000..7b9a06e4
--- /dev/null
+++ b/src/components/buttons/ThemeToggle.svelte
@@ -0,0 +1,28 @@
+<!-- <button {...$$restProps}>toggle</button> -->
+<button
+ class="text-white dark:!text-black hover:bg-gray-100 dark:!hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 border-2 border-gray-600 bg-black dark:!bg-white dark:!border-gray-300 dark:!focus:ring-gray-700 rounded-full text-sm p-2.5 transition-all"
+ {...$$restProps}
+>
+ <svg
+ class="w-5 h-5 dark:hidden"
+ fill="currentColor"
+ viewBox="0 0 20 20"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"
+ ></path>
+ </svg>
+ <svg
+ class="w-5 h-5 hidden dark:!block"
+ fill="currentColor"
+ viewBox="0 0 20 20"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
+ fill-rule="evenodd"
+ clip-rule="evenodd"
+ ></path>
+ </svg>
+</button> \ No newline at end of file