aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/Calendar.svelte3
-rw-r--r--src/components/Card.svelte3
-rw-r--r--src/components/Footer.svelte3
-rw-r--r--src/components/Heart.svelte3
-rw-r--r--src/components/Invoice.svelte3
-rw-r--r--src/components/LandingHeader.svelte22
-rw-r--r--src/components/LandingHero.svelte3
-rw-r--r--src/components/Left.svelte3
-rw-r--r--src/components/Lnurlp.svelte3
-rw-r--r--src/components/Lnurlw.svelte3
-rw-r--r--src/components/LocationsMap.svelte6
-rw-r--r--src/components/Lock.svelte3
-rw-r--r--src/components/Numpad.svelte3
-rw-r--r--src/components/Password.svelte9
-rw-r--r--src/components/Pin.svelte3
-rw-r--r--src/components/Pinpad.svelte6
-rw-r--r--src/components/RegisterOrLogin.svelte193
-rw-r--r--src/components/Request.svelte3
-rw-r--r--src/components/Spinner.svelte3
-rw-r--r--src/components/index.js0
-rw-r--r--src/locales/en.json3
-rw-r--r--src/routes/(app)/+error.svelte3
-rw-r--r--src/routes/(app)/[username]/(profile)/+layout.svelte15
-rw-r--r--src/routes/(app)/[username]/(profile)/request/+page.svelte3
-rw-r--r--src/routes/(app)/[username]/card/[serial]/+page.svelte6
-rw-r--r--src/routes/(app)/[username]/funds/+page.svelte3
-rw-r--r--src/routes/(app)/[username]/invoice/[id]/+page.svelte24
-rw-r--r--src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte12
-rw-r--r--src/routes/(app)/[username]/receive/[...param]/+page.svelte3
-rw-r--r--src/routes/(app)/[username]/settings/[...tab]/+page.svelte4
-rw-r--r--src/routes/(app)/[username]/settings/[...tab]/_pos.svelte6
-rw-r--r--src/routes/(app)/[username]/settings/[...tab]/_security.svelte6
-rw-r--r--src/routes/(app)/[username]/settings/[...tab]/_shopify.svelte4
-rw-r--r--src/routes/(app)/buy/+page.svelte11
-rw-r--r--src/routes/(app)/forgot/+page.server.js16
-rw-r--r--src/routes/(app)/forgot/+page.svelte58
-rw-r--r--src/routes/(app)/fund/[id]/+page.svelte12
-rw-r--r--src/routes/(app)/fund/[id]/withdraw/+page.svelte3
-rw-r--r--src/routes/(app)/launch/+page.svelte7
-rw-r--r--src/routes/(app)/launch/purchase/+page.svelte17
-rw-r--r--src/routes/(app)/launch/purchase/card/+page.svelte8
-rw-r--r--src/routes/(app)/launch/thanks/[asset]/+page.svelte7
-rw-r--r--src/routes/(app)/launch/ticket/+page.svelte7
-rw-r--r--src/routes/(app)/login/+page.svelte175
-rw-r--r--src/routes/(app)/payment/[id]/+page.svelte8
-rw-r--r--src/routes/(app)/register/+page.server.js11
-rw-r--r--src/routes/(app)/register/+page.svelte24
-rw-r--r--src/routes/(app)/scan/+page.svelte5
-rw-r--r--src/routes/(app)/send/[...text]/+page.svelte12
-rw-r--r--src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.server.js12
-rw-r--r--src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte3
-rw-r--r--src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte3
-rw-r--r--src/routes/(app)/send/invoice/[id]/+page.svelte6
-rw-r--r--src/routes/(app)/send/lightning/[payreq]/+page.svelte10
-rw-r--r--src/routes/(app)/send/user/[username]/[...amount]/+page.svelte8
-rw-r--r--src/routes/(app)/support/+page.svelte9
-rw-r--r--src/routes/(static)/docs/+page.svelte3
57 files changed, 398 insertions, 407 deletions
diff --git a/src/components/Calendar.svelte b/src/components/Calendar.svelte
index b07c136c..7d7fa570 100644
--- a/src/components/Calendar.svelte
+++ b/src/components/Calendar.svelte
@@ -3,8 +3,7 @@
class="absolute bottom-0 left-0 -mb-0.5 transform translate-x-1/2 -translate-y-1/2 text-black peer-placeholder-shown:text-gray-300 h-6 w-6"
fill="none"
viewBox="0 0 24 24"
- stroke="currentColor"
->
+ stroke="currentColor">
<path
stroke-linecap="round"
stroke-linejoin="round"
diff --git a/src/components/Card.svelte b/src/components/Card.svelte
index 864465c0..60b7c818 100644
--- a/src/components/Card.svelte
+++ b/src/components/Card.svelte
@@ -3,8 +3,7 @@
class="absolute bottom-0 left-0 -mb-0.5 transform translate-x-1/2 -translate-y-1/2 text-black peer-placeholder-shown:text-gray-300 h-6 w-6"
fill="none"
viewBox="0 0 24 24"
- stroke="currentColor"
->
+ stroke="currentColor">
<path
stroke-linecap="round"
stroke-linejoin="round"
diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte
index d70c013c..378dce6d 100644
--- a/src/components/Footer.svelte
+++ b/src/components/Footer.svelte
@@ -26,8 +26,7 @@
<div>
<a href="/register">
<button
- class="bg-black text-white border rounded-full px-4 py-2 font-bold hover:opacity-80 text-lg"
- >
+ class="bg-black text-white border rounded-full px-4 py-2 font-bold hover:opacity-80 text-lg">
{$t("nav.startInSeconds")}
</button>
</a>
diff --git a/src/components/Heart.svelte b/src/components/Heart.svelte
index 9bae6500..4304545f 100644
--- a/src/components/Heart.svelte
+++ b/src/components/Heart.svelte
@@ -4,8 +4,7 @@
class="mr-1"
viewBox="0 0 24 24"
fill="none"
- xmlns="http://www.w3.org/2000/svg"
->
+ xmlns="http://www.w3.org/2000/svg">
<path
d="M4.31802 6.31802C2.56066 8.07538 2.56066 10.9246 4.31802 12.682L12.0001 20.364L19.682 12.682C21.4393 10.9246 21.4393 8.07538 19.682 6.31802C17.9246 4.56066 15.0754 4.56066 13.318 6.31802L12.0001 7.63609L10.682 6.31802C8.92462 4.56066 6.07538 4.56066 4.31802 6.31802Z"
stroke="currentColor"
diff --git a/src/components/Invoice.svelte b/src/components/Invoice.svelte
index ba436649..ad537b7b 100644
--- a/src/components/Invoice.svelte
+++ b/src/components/Invoice.svelte
@@ -29,8 +29,7 @@
<div class="mx-auto my-auto flex gap-2">
<a href={`/${invoice.user.username}/invoice/${$invoice.id}/tip`}>
<button
- class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-32"
- >
+ class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-32">
{$t("payments.pay")}
</button>
</a>
diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte
index d1094a1d..72dd8c71 100644
--- a/src/components/LandingHeader.svelte
+++ b/src/components/LandingHeader.svelte
@@ -52,11 +52,12 @@
class="border rounded-full px-6 py-2 font-bold"
on:click={() => goto(`/${user.username}`)}
>Home
+
+
</button>
<button
class="bg-black text-white border rounded-full px-6 py-2 font-bold"
- on:click={() => goto("/logout")}
- >
+ on:click={() => goto("/logout")}>
{$t("nav.signOut")}
</button>
{:else}
@@ -64,11 +65,12 @@
class="border rounded-full px-6 py-2 font-bold 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"
- on:click={() => goto("/login")}
- >
+ on:click={() => goto("/login")}>
{$t("nav.signIn")}
</button>
{/if}
@@ -79,6 +81,8 @@
class="block md:hidden absolute top-[34.5px] right-10 z"
on:click={() => (showMobileMenu = !showMobileMenu)}
><Icon icon={!showMobileMenu ? "menu" : "close"} />
+
+
</button>
<div
@@ -101,11 +105,12 @@
class="border rounded-full px-6 py-2 font-bold block 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"
- on:click={() => goto("/login")}
- >
+ on:click={() => goto("/login")}>
{$t("nav.signIn")}
</button>
{:else}
@@ -113,11 +118,12 @@
class="border rounded-full px-6 py-2 font-bold block"
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"
- on:click={() => goto("/logout")}
- >
+ on:click={() => goto("/logout")}>
{$t("nav.signOut")}
</button>
{/if}
diff --git a/src/components/LandingHero.svelte b/src/components/LandingHero.svelte
index 43223499..14488cdd 100644
--- a/src/components/LandingHero.svelte
+++ b/src/components/LandingHero.svelte
@@ -29,8 +29,7 @@
<div class="flex justify-center">
<a href="/register">
<button
- class="bg-black text-white border rounded-full px-6 py-2 font-bold hover:opacity-80"
- >
+ class="bg-black text-white border rounded-full px-6 py-2 font-bold hover:opacity-80">
{$t("nav.startInSeconds")}
</button>
</a>
diff --git a/src/components/Left.svelte b/src/components/Left.svelte
index 1e236969..dd27a698 100644
--- a/src/components/Left.svelte
+++ b/src/components/Left.svelte
@@ -4,8 +4,7 @@
height="24"
viewBox="0 0 24 24"
fill="none"
- xmlns="http://www.w3.org/2000/svg"
->
+ xmlns="http://www.w3.org/2000/svg">
<path
d="M15 19L8 12L15 5"
stroke="currentColor"
diff --git a/src/components/Lnurlp.svelte b/src/components/Lnurlp.svelte
index 6db7e7d7..d76d11c4 100644
--- a/src/components/Lnurlp.svelte
+++ b/src/components/Lnurlp.svelte
@@ -48,8 +48,7 @@
<div class="flex w-full">
<button
type="submit"
- class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- >
+ class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24">
{#if loading}
<Spinner />
{:else}
diff --git a/src/components/Lnurlw.svelte b/src/components/Lnurlw.svelte
index b83e648f..c0898c7c 100644
--- a/src/components/Lnurlw.svelte
+++ b/src/components/Lnurlw.svelte
@@ -53,8 +53,7 @@
<div class="flex w-full">
<button
type="submit"
- class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- >
+ class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24">
{#if loading}
<Spinner />
{:else}
diff --git a/src/components/LocationsMap.svelte b/src/components/LocationsMap.svelte
index b41b1a73..1f44ae34 100644
--- a/src/components/LocationsMap.svelte
+++ b/src/components/LocationsMap.svelte
@@ -225,8 +225,7 @@
<div class="flex absolute flex top-2 right-2 gap-2">
<button
class="rounded-full border-2 border-black bg-white w-10 h-10"
- on:click={toggle}
- >
+ on:click={toggle}>
{#if timeout}
<Icon icon="pause" style="w-4 m-auto" />
{:else}
@@ -235,8 +234,7 @@
</button>
<button
class="rounded-full border-2 border-black bg-white w-10 h-10"
- on:click={full}
- >
+ on:click={full}>
<Icon icon="full" style="w-4 m-auto" />
</button>
</div>
diff --git a/src/components/Lock.svelte b/src/components/Lock.svelte
index fce994a2..23ab0699 100644
--- a/src/components/Lock.svelte
+++ b/src/components/Lock.svelte
@@ -3,8 +3,7 @@
class="absolute bottom-0 left-0 -mb-0.5 transform translate-x-1/2 -translate-y-1/2 text-black peer-placeholder-shown:text-gray-300 h-6 w-6"
fill="none"
viewBox="0 0 24 24"
- stroke="currentColor"
->
+ stroke="currentColor">
<path
stroke-linecap="round"
stroke-linejoin="round"
diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte
index c758bf77..4dd73f6d 100644
--- a/src/components/Numpad.svelte
+++ b/src/components/Numpad.svelte
@@ -220,8 +220,7 @@
<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"
- on:click={() => handleInput(value)}
- >
+ on:click={() => handleInput(value)}>
<Left />
</button>
{:else}
diff --git a/src/components/Password.svelte b/src/components/Password.svelte
index da65d718..ab8b9449 100644
--- a/src/components/Password.svelte
+++ b/src/components/Password.svelte
@@ -57,8 +57,7 @@
<button
type="button"
on:click={() => (revealPassword = !revealPassword)}
- class="absolute right-5 top-6"
- >
+ class="absolute right-5 top-6">
<Icon icon={revealPassword ? "eye" : "eye-off"} />
</button>
</div>
@@ -67,14 +66,12 @@
type="button"
class="border-2 border-black rounded-xl font-semibold mx-auto py-3 w-40 hover:opacity-80 mx-auto"
on:click={cancel}
- on:keydown={cancel}
- >
+ on:keydown={cancel}>
<div class="my-auto">Cancel</div>
</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 rounded-xl font-semibold mx-auto py-3 w-40 hover:opacity-80 mx-auto">
<div class="my-auto">Submit</div>
</button>
</div>
diff --git a/src/components/Pin.svelte b/src/components/Pin.svelte
index 9938f9a1..50b0e463 100644
--- a/src/components/Pin.svelte
+++ b/src/components/Pin.svelte
@@ -53,8 +53,7 @@
<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"
- on:click|preventDefault={cancel}
- >
+ on:click|preventDefault={cancel}>
<div class="my-auto">Cancel</div>
</button>
</div>
diff --git a/src/components/Pinpad.svelte b/src/components/Pinpad.svelte
index 641ddb2b..1a549654 100644
--- a/src/components/Pinpad.svelte
+++ b/src/components/Pinpad.svelte
@@ -60,8 +60,7 @@
<button
type="button"
on:click={() => (hide = !hide)}
- class="absolute -right-5 top-5"
- >
+ class="absolute -right-5 top-5">
<Icon icon={hide ? "eye-off" : "eye"} style="w-8" />
</button>
</div>
@@ -72,8 +71,7 @@
<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"
- on:click={() => handleInput(value)}
- >
+ on:click={() => handleInput(value)}>
<Left />
</button>
{:else}
diff --git a/src/components/RegisterOrLogin.svelte b/src/components/RegisterOrLogin.svelte
deleted file mode 100644
index be7d4142..00000000
--- a/src/components/RegisterOrLogin.svelte
+++ /dev/null
@@ -1,193 +0,0 @@
-<script>
- import { applyAction, deserialize } from "$app/forms";
- import { tick } from "svelte";
- import { fly } from "svelte/transition";
- import { enhance } from "$app/forms";
- import Pin from "$comp/Pin.svelte";
- import Icon from "$comp/Icon.svelte";
- import Spinner from "$comp/Spinner.svelte";
- import { focus, fail } from "$lib/utils";
- import { password, loginRedirect } from "$lib/store";
- import { t } from "$lib/translations";
- import { page } from "$app/stores";
- import { generate } from "$lib/nostr";
- import { invalidateAll } from "$app/navigation";
-
- export let form;
- export let pageID;
-
- let token, formElement;
- let code = [];
- let redirect;
-
- $password = undefined;
-
- $: need2fa = form?.message === "2fa";
- let cancel = () => (need2fa = false);
- $: if (form?.message === "2fa" && form.token === token) token = "";
-
- let username, email, btn;
-
- $: update(form);
- let update = (form) => form && ({ username, password: $password } = form);
-
- $: token && token?.length === 6 && tick().then(() => btn.click());
-
- let revealPassword = false;
-
- let action = {
- register: "/register",
- signIn: "/login",
- }[pageID];
-
- let loading;
- async function handleSubmit(e) {
- loading = true;
-
- let data = new FormData(this);
- let user = Object.fromEntries(data);
- await generate(user);
-
- for (let k in user) {
- data.set(k, user[k]);
- }
-
- const response = await fetch(action, {
- method: "POST",
- body: data,
- });
-
- const result = deserialize(await response.text());
-
- if (result.type === "success") {
- await invalidateAll();
- }
-
- applyAction(result);
- loading = false;
- }
-</script>
-
-{#if need2fa}
- <Pin bind:value={token} title="Enter 2FA Code" {cancel} notify={false} />
-{/if}
-
-<div class="pt-10">
- <div class="w-[243px] mx-auto mb-10">
- <a href="/">
- <Icon icon="logo" />
- </a>
- </div>
-
- <div class="flex justify-center items-center">
- <div
- class="shadow-xl rounded-3xl p-10 pb-12 space-y-5 w-full mx-5 md:mx-0 md:w-[400px]"
- >
- <h1 class="text-2xl font-bold text-center">{$t("login." + pageID)}</h1>
-
- {#if form?.error}
- <div class="text-red-600 text-center" in:fly>
- {form.error}
- </div>
- {/if}
-
- <form
- class="space-y-5"
- on:submit|preventDefault={handleSubmit}
- method="POST"
- >
- <input
- type="hidden"
- name="loginRedirect"
- value={$loginRedirect || $page.url.searchParams.get("redirect")}
- />
- <input type="hidden" name="token" value={token} />
-
- <div>
- <label for="username" class="font-semibold"
- >{$t("login.username")}</label
- >
- <input
- name="username"
- type="text"
- required
- class="bg-primary"
- bind:value={username}
- use:focus
- autocapitalize="none"
- />
- </div>
-
- <div class="relative">
- <label for="password" class="block font-semibold"
- >{$t("login.password")}</label
- >
- {#if revealPassword}
- <input
- name="password"
- type="text"
- required
- class="bg-primary"
- bind:value={$password}
- autocapitalize="none"
- />
- {:else}
- <input
- name="password"
- type="password"
- required
- class="bg-primary"
- bind:value={$password}
- autocapitalize="none"
- />
- {/if}
- <button
- type="button"
- on:click={() => (revealPassword = !revealPassword)}
- class="absolute right-5 top-10"
- >
- <Icon icon={revealPassword ? "eye" : "eye-off"} />
- </button>
- </div>
-
- {#if pageID === "register"}
- <p class="text-secondary text-sm">
- {$t("login.passwordRecommendation")}
- </p>
- {:else}
- <!-- TODO -->
- <!-- <div class="flex justify-end items-center"> -->
- <!-- <a href="/forgot" class="underline underline-offset-4 text-black text-sm" -->
- <!-- >{$t('login.forgotUserOrPassword')}</a -->
- <!-- > -->
- <!-- </div> -->
- {/if}
-
- <button
- type="submit"
- class="bg-black text-white w-full rounded-2xl p-4 font-semibold hover:opacity-80"
- disabled={loading}
- bind:this={btn}
- >
- {#if loading}
- <Spinner />
- {:else}
- {$t("login." + pageID)}
- {/if}
- </button>
- </form>
-
- <p class="text-secondary text-center font-medium">
- {pageID === "register"
- ? $t("login.haveAccount")
- : $t("login.noAccount")}
- <a
- href={pageID === "register" ? "/login" : "/register"}
- class="block md:inline text-black underline underline-offset-4 hover:opacity-80"
- >
- {pageID === "register" ? $t("login.signIn") : $t("login.register")}
- </a>
- </p>
- </div>
- </div>
-</div>
diff --git a/src/components/Request.svelte b/src/components/Request.svelte
index c085f9e2..03364052 100644
--- a/src/components/Request.svelte
+++ b/src/components/Request.svelte
@@ -28,8 +28,7 @@
<div class="mx-auto my-auto flex gap-2">
<a href={`/${user.username}/receive/${$request.id}`}>
<button
- class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-32"
- >
+ class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-32">
{$t("payments.invoice")}
</button>
</a>
diff --git a/src/components/Spinner.svelte b/src/components/Spinner.svelte
index e9c3348f..2e9243b9 100644
--- a/src/components/Spinner.svelte
+++ b/src/components/Spinner.svelte
@@ -2,8 +2,7 @@
class="mx-auto h-6 w-6 animate-spin text-white"
xmlns="http://www.w3.org/2000/svg"
fill="none"
- viewBox="0 0 24 24"
->
+ viewBox="0 0 24 24">
<circle
class="opacity-25"
cx="12"
diff --git a/src/components/index.js b/src/components/index.js
deleted file mode 100644
index e69de29b..00000000
--- a/src/components/index.js
+++ /dev/null
diff --git a/src/locales/en.json b/src/locales/en.json
index db25b3fb..0dda9362 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -116,7 +116,10 @@
}
},
"login": {
+ "forgot": "Forgot password?",
+ "reset": "Password reset",
"optional": "Optional",
+ "submit": "Submit",
"token": "2FA Token",
"username": "Username",
"password": "Password",
diff --git a/src/routes/(app)/+error.svelte b/src/routes/(app)/+error.svelte
index 6ce7979c..b5a5e139 100644
--- a/src/routes/(app)/+error.svelte
+++ b/src/routes/(app)/+error.svelte
@@ -27,8 +27,7 @@
<div class="flex justify-center py-24">
<a href={link}>
<button
- class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-xl"
- >
+ class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-xl">
Back
</button>
</a>
diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte
index 71c282c4..e33c4b23 100644
--- a/src/routes/(app)/[username]/(profile)/+layout.svelte
+++ b/src/routes/(app)/[username]/(profile)/+layout.svelte
@@ -157,8 +157,7 @@
<div class="w-full flex">
<button
class="mx-auto rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60 bg-black text-white"
- on:click={unfollow}
- >
+ on:click={unfollow}>
<div class="mx-auto flex">
<Icon icon={"profile"} style="my-auto h-6 mr-2 invert" />
<div class="my-auto">{$t("user.following")}</div>
@@ -169,8 +168,7 @@
<div class="w-full flex">
<button
class="mx-auto rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60"
- on:click={follow}
- >
+ on:click={follow}>
<div class="mx-auto flex">
<Icon icon={"profile"} style="my-auto h-6 mr-2" />
<div class="my-auto">{$t("user.follow")}</div>
@@ -184,8 +182,7 @@
<div class="w-full flex">
<a href={`/${subject.username}/messages`} class="mx-auto">
<button
- class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60"
- >
+ class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60">
<div class="mx-auto flex">
<Icon icon="message" style="mr-2 my-auto" />
<div class="mt-1 my-auto">{$t("user.message")}</div>
@@ -201,11 +198,9 @@
href={user
? `/send/${subject.username}`
: `/${subject.username}/receive`}
- class="mx-auto"
- >
+ class="mx-auto">
<button
- class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60"
- >
+ class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60">
<div class="mx-auto flex">
<Icon icon="send" style="mr-2" />
<div class="mt-1">{$t("user.pay")}</div>
diff --git a/src/routes/(app)/[username]/(profile)/request/+page.svelte b/src/routes/(app)/[username]/(profile)/request/+page.svelte
index a07ee914..373a1302 100644
--- a/src/routes/(app)/[username]/(profile)/request/+page.svelte
+++ b/src/routes/(app)/[username]/(profile)/request/+page.svelte
@@ -26,8 +26,7 @@
<div class="w-full flex">
<button
type="submit"
- class="bg-black text-white border rounded-full px-6 py-2 font-bold mx-auto"
- >
+ class="bg-black text-white border rounded-full px-6 py-2 font-bold mx-auto">
{$t("payments.submit")}
</button>
</div>
diff --git a/src/routes/(app)/[username]/card/[serial]/+page.svelte b/src/routes/(app)/[username]/card/[serial]/+page.svelte
index 1d11ebee..1792b443 100644
--- a/src/routes/(app)/[username]/card/[serial]/+page.svelte
+++ b/src/routes/(app)/[username]/card/[serial]/+page.svelte
@@ -13,15 +13,13 @@
<div class="flex justify-center">
<a href={`/send/pot/${serial}`}>
<button
- class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60 bg-black text-white justify-center gap-2"
- >
+ class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60 bg-black text-white justify-center gap-2">
<svg
xmlns="http://www.w3.org/2000/svg"
class="invert text-black peer-placeholder-shown:text-gray-300 h-6 w-6 my-auto"
fill="none"
viewBox="0 0 24 24"
- stroke="currentColor"
- >
+ stroke="currentColor">
<path
stroke-linecap="round"
stroke-linejoin="round"
diff --git a/src/routes/(app)/[username]/funds/+page.svelte b/src/routes/(app)/[username]/funds/+page.svelte
index 25686e86..edbe22a5 100644
--- a/src/routes/(app)/[username]/funds/+page.svelte
+++ b/src/routes/(app)/[username]/funds/+page.svelte
@@ -37,8 +37,7 @@
</div>
<button
- class="ml-auto rounded-full border py-2 px-4 w-36 hover:opacity-80 flex mx-auto"
- >
+ class="ml-auto rounded-full border py-2 px-4 w-36 hover:opacity-80 flex mx-auto">
<Icon icon="plus" style="opacity-50 mr-2 my-auto" />
<div class="my-auto">{$t("payments.create")}</div>
</button>
diff --git a/src/routes/(app)/[username]/invoice/[id]/+page.svelte b/src/routes/(app)/[username]/invoice/[id]/+page.svelte
index 0ff1c21c..13c75fca 100644
--- a/src/routes/(app)/[username]/invoice/[id]/+page.svelte
+++ b/src/routes/(app)/[username]/invoice/[id]/+page.svelte
@@ -130,17 +130,13 @@
class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-full"
class:bg-black={type === types.lightning}
class:text-white={type === types.lightning}
- on:click={toggleType}
- >
- ⚡️ Lightning
- </button>
+ on:click={toggleType}> ⚡️ Lightning </button>
<button
class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-full flex justify-center"
class:bg-black={type === types.bitcoin}
class:text-white={type === types.bitcoin}
- on:click={toggleType}
- >
+ on:click={toggleType}>
<img
src="/images/bitcoin.svg"
class="my-auto w-8 border-4 border-transparent"
@@ -155,8 +151,7 @@
<a
href={invoice.type === "bitcoin"
? invoice.text
- : "lightning:" + invoice.text}
- >
+ : "lightning:" + invoice.text}>
<div class="relative flex">
<div class="flex mx-auto w-[360px] h-[360px]">
<img
@@ -208,8 +203,7 @@
<div class="w-full flex justify-center gap-2 flex-wrap">
<a href={link} class="w-full md:w-auto">
<button
- class="w-full md:w-auto flex justify-center rounded-full border py-3 px-5 hover:opacity-80"
- >
+ class="w-full md:w-auto flex justify-center rounded-full border py-3 px-5 hover:opacity-80">
<Icon icon="mobile" style="mr-1 w-6" />
<div class="text-secondary">{$t("payments.openLink")}</div>
</button>
@@ -217,16 +211,18 @@
<button
class="flex rounded-full justify-center border py-3 px-5 hover:opacity-80 w-full md:w-auto"
- on:click={() => copy(txt)}
- >
+ on:click={() => copy(txt)}>
+
+
<Icon icon="copy" style="mr-1" />
<div class="text-secondary">{$t("payments.copyText")}</div></button
>
<button
class="w-full md:w-auto flex justify-center rounded-full border py-3 px-5 hover:opacity-80"
- on:click={() => (showQr = !showQr)}
- >
+ on:click={() => (showQr = !showQr)}>
+
+
<Icon icon="qr" style="mr-1 invert" />
<div class="text-secondary">
{showQr ? $t("payments.hide") : $t("payments.show")}
diff --git a/src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte b/src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte
index 9740dc92..bc974b9a 100644
--- a/src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte
+++ b/src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte
@@ -9,8 +9,16 @@
export let data;
let amount, currency, rate, received, pending, tip, user, id;
$: data &&
- ({ amount, currency, rate, received, pending, tip, user, id } =
- data.invoice);
+ ({
+ amount,
+ currency,
+ rate,
+ received,
+ pending,
+ tip,
+ user,
+ id,
+ } = data.invoice);
toast.pop(0);
</script>
diff --git a/src/routes/(app)/[username]/receive/[...param]/+page.svelte b/src/routes/(app)/[username]/receive/[...param]/+page.svelte
index 49e279b9..840f0277 100644
--- a/src/routes/(app)/[username]/receive/[...param]/+page.svelte
+++ b/src/routes/(app)/[username]/receive/[...param]/+page.svelte
@@ -48,8 +48,7 @@
bind:this={submit}
type="submit"
class="bg-black text-white rounded-xl w-full h-[48px] flex justify-center items-center font-semibold
- opacity-100 hover:opacity-80"
- >
+ opacity-100 hover:opacity-80">
{$t("payments.next")}
</button>
</div>
diff --git a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte
index e77213c2..b4283e72 100644
--- a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte
+++ b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte
@@ -220,8 +220,7 @@
bind:this={submit}
type="submit"
class="border-2 border-black rounded-xl font-semibold mx-auto py-3 w-40 hover:opacity-80"
- class:bg-black={loading}
- >
+ class:bg-black={loading}>
{#if loading}
<Spinner />
{:else}
@@ -236,4 +235,3 @@
view-transition-name: settings;
}
</style>
-
diff --git a/src/routes/(app)/[username]/settings/[...tab]/_pos.svelte b/src/routes/(app)/[username]/settings/[...tab]/_pos.svelte
index 8193bc9c..e211b013 100644
--- a/src/routes/(app)/[username]/settings/[...tab]/_pos.svelte
+++ b/src/routes/(app)/[username]/settings/[...tab]/_pos.svelte
@@ -25,8 +25,7 @@
<select
name="currency"
class="select-styles block py-3 w-full"
- value={user.currency}
- >
+ value={user.currency}>
{#each fiats as fiat}
<option value={fiat}>{fiat}</option>
{/each}
@@ -74,8 +73,7 @@
<a href="./shopify">
<button
type="button"
- class="flex rounded-full border py-2 px-4 font-bold hover:opacity-80 w-full gap-2 my-5 justify-center"
- >
+ class="flex rounded-full border py-2 px-4 font-bold hover:opacity-80 w-full gap-2 my-5 justify-center">
<img src="/icons/shopify.svg" class="w-8" />
<div class="my-auto">Shopify Integration</div>
</button>
diff --git a/src/routes/(app)/[username]/settings/[...tab]/_security.svelte b/src/routes/(app)/[username]/settings/[...tab]/_security.svelte
index 38bf726c..3aa7012e 100644
--- a/src/routes/(app)/[username]/settings/[...tab]/_security.svelte
+++ b/src/routes/(app)/[username]/settings/[...tab]/_security.svelte
@@ -167,8 +167,7 @@
type="button"
on:click={togglePassword}
on:keydown={togglePassword}
- class="absolute right-5 top-11"
- >
+ class="absolute right-5 top-11">
<Icon icon={revealPassword ? "eye" : "eye-off"} />
</button>
</div>
@@ -212,8 +211,7 @@
<select
name="locktime"
class="select-styles block py-3 w-full"
- value={parseInt(user.locktime)}
- >
+ value={parseInt(user.locktime)}>
<option value={5 * 60}>5 {$t("user.settings.minutes")}</option>
<option value={10 * 60}>10 {$t("user.settings.minutes")}</option>
<option value={30 * 60}>30 {$t("user.settings.minutes")}</option>
diff --git a/src/routes/(app)/[username]/settings/[...tab]/_shopify.svelte b/src/routes/(app)/[username]/settings/[...tab]/_shopify.svelte
index 0266fa9c..870803fb 100644
--- a/src/routes/(app)/[username]/settings/[...tab]/_shopify.svelte
+++ b/src/routes/(app)/[username]/settings/[...tab]/_shopify.svelte
@@ -28,9 +28,7 @@
<div class="flex mb-2">
<div
class="text-gray-600 p-4 my-auto bg-gray-100 border rounded-l-2xl border-r-0 pr-1"
- >
- admin.shopify.com/store/
- </div>
+ >admin.shopify.com/store/</div>
<input
type="text"
name="shopifyStore"
diff --git a/src/routes/(app)/buy/+page.svelte b/src/routes/(app)/buy/+page.svelte
index 2b81b7a8..affb77ee 100644
--- a/src/routes/(app)/buy/+page.svelte
+++ b/src/routes/(app)/buy/+page.svelte
@@ -60,7 +60,8 @@
/>
<span
class="absolute bottom-[9px] left-0 translate-x-1/2 w-6 text-black peer-placeholder-shown:text-gray-300
- ">$</span
+ "
+ >$</span
>
</label>
@@ -93,8 +94,9 @@
CVC/CVV
<span class="relative group">
<span
- class="hidden group-hover:flex justify-center items-center px-2 py-1 text-xs absolute -right-2 transform translate-x-full -translate-y-1/2 w-max top-1/2 bg-black text-white"
- >
+ class="hidden group-hover:flex justify-center items-center px-2 py-1 text-xs absolute -right-2 transform translate-x-full -translate-y-1/2 w-max top-1/2 bg-black text-white">
+
+
3-digit number on the back of your card</span
>
</span>
@@ -113,8 +115,7 @@
<button
class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-xl"
type="submit"
- disabled={loading}
- >
+ disabled={loading}>
{#if loading}
<Spinner />
{:else}
diff --git a/src/routes/(app)/forgot/+page.server.js b/src/routes/(app)/forgot/+page.server.js
new file mode 100644
index 00000000..db2005e7
--- /dev/null
+++ b/src/routes/(app)/forgot/+page.server.js
@@ -0,0 +1,16 @@
+import { fail, redirect } from "@sveltejs/kit";
+import { fd, post, login } from "$lib/utils";
+
+export const actions = {
+ default: async ({ request }) => {
+ let { email } = await fd(request);
+
+ try {
+ await post("/forgot", { email });
+ return { success: true };
+ } catch (e) {
+ console.log(e.message);
+ return fail(400, { error: e.message });
+ }
+ },
+};
diff --git a/src/routes/(app)/forgot/+page.svelte b/src/routes/(app)/forgot/+page.svelte
new file mode 100644
index 00000000..91c4290a
--- /dev/null
+++ b/src/routes/(app)/forgot/+page.svelte
@@ -0,0 +1,58 @@
+<script>
+ import { t } from "$lib/translations";
+ import Icon from "$comp/Icon.svelte";
+ import Spinner from "$comp/Spinner.svelte";
+ import { fly } from "svelte/transition";
+
+ export let form;
+ let email;
+ let loading;
+</script>
+
+<div class="pt-10">
+ <div class="w-[243px] mx-auto mb-10">
+ <a href="/">
+ <Icon icon="logo" />
+ </a>
+ </div>
+
+ <div class="flex justify-center items-center">
+ <div
+ class="shadow-xl rounded-3xl p-10 pb-12 space-y-5 w-full mx-5 md:mx-0 md:w-[400px]"
+ >
+ <h1 class="text-2xl font-bold text-center">{$t("login.reset")}</h1>
+
+ {#if form?.error}
+ <div class="text-red-600 text-center" in:fly>
+ {form.error}
+ </div>
+ {/if}
+
+ <form class="space-y-5" method="POST">
+ <div>
+ <label for="email" class="font-semibold">{$t("login.email")}</label>
+ <input
+ name="email"
+ type="text"
+ required
+ class="bg-primary"
+ bind:value={email}
+ use:focus
+ autocapitalize="none"
+ />
+ </div>
+
+ <button
+ type="submit"
+ class="bg-black text-white w-full rounded-2xl p-4 font-semibold hover:opacity-80"
+ disabled={loading}>
+ {#if loading}
+ <Spinner />
+ {:else}
+ {$t("login.submit")}
+ {/if}
+ </button>
+ </form>
+ </div>
+ </div>
+</div>
diff --git a/src/routes/(app)/fund/[id]/+page.svelte b/src/routes/(app)/fund/[id]/+page.svelte
index b81e2917..ebb1a517 100644
--- a/src/routes/(app)/fund/[id]/+page.svelte
+++ b/src/routes/(app)/fund/[id]/+page.svelte
@@ -62,8 +62,7 @@
<div class="grow">
<a href={`/send/fund/${id}`}>
<button
- class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center"
- >
+ class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center">
<Icon icon="plus" />
{$t("payments.addFunds")}
</button>
@@ -72,8 +71,7 @@
<div class="grow">
<a href={`/fund/${id}/withdraw`}>
<button
- class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center"
- >
+ class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center">
<Icon icon="minus" style="rotate-180" />
{$t("payments.takeFunds")}
</button>
@@ -83,15 +81,13 @@
<div class="flex gap-2" data-sveltekit-prefetch="off">
<button
class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center"
- on:click={toggle}
- >
+ on:click={toggle}>
<Icon icon="qr" style="invert" />
{show ? $t("payments.hide") : $t("payments.show")} QR
</button>
<button
class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center"
- on:click={() => copy($page.url.host + $page.url.pathname)}
- >
+ on:click={() => copy($page.url.host + $page.url.pathname)}>
<Icon icon="copy" style="w-6" />
{$t("payments.copyLink")}
</button>
diff --git a/src/routes/(app)/fund/[id]/withdraw/+page.svelte b/src/routes/(app)/fund/[id]/withdraw/+page.svelte
index 7af07e38..e7c1d852 100644
--- a/src/routes/(app)/fund/[id]/withdraw/+page.svelte
+++ b/src/routes/(app)/fund/[id]/withdraw/+page.svelte
@@ -47,8 +47,7 @@
<div class="flex w-full">
<button
type="submit"
- class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- >
+ class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24">
{#if loading}
<Spinner />
{:else}
diff --git a/src/routes/(app)/launch/+page.svelte b/src/routes/(app)/launch/+page.svelte
index ef02ae0f..cb43e63e 100644
--- a/src/routes/(app)/launch/+page.svelte
+++ b/src/routes/(app)/launch/+page.svelte
@@ -58,9 +58,7 @@
<div class="p-4 font-normal text-gray-800 md:w-3/4 space-y-5">
<h1
class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800"
- >
- Launch Party!
- </h1>
+ >Launch Party!</h1>
<p class="leading-normal mb-2">
Come join us at our launch party celebrating our new design and 10
@@ -106,8 +104,7 @@
<div class="flex w-full my-8">
<a href={link} class="mx-auto">
<button
- class="bg-white text-black border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl"
- >
+ class="bg-white text-black border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl">
{text}
</button>
</a>
diff --git a/src/routes/(app)/launch/purchase/+page.svelte b/src/routes/(app)/launch/purchase/+page.svelte
index 49a51973..3af3b186 100644
--- a/src/routes/(app)/launch/purchase/+page.svelte
+++ b/src/routes/(app)/launch/purchase/+page.svelte
@@ -21,9 +21,7 @@
<div class="font-normal text-gray-800 mx-auto mb-8 space-y-8">
<h1
class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"
- >
- Purchase Ticket
- </h1>
+ >Purchase Ticket</h1>
<img
src={`/tickets/${(ticket + 1).toString().padStart(2, "0")}.png`}
@@ -37,8 +35,7 @@
<div class="w-full flex">
<button
- class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl"
- >
+ class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl">
Count me in
</button>
</div>
@@ -46,25 +43,21 @@
{:else}
<h1
class="mb-4 text-xl font-bold leading-none tracking-tight text-gray-800 text-center"
- >
- Payment Options
- </h1>
+ >Payment Options</h1>
<div class="flex justify-center gap-4">
<form action="?/lightning" method="POST">
<input type="hidden" name="currency" value={currency} />
<input type="hidden" name="username" value={username} />
<button
- class="border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl"
- >
+ class="border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl">
Lightning
</button>
</form>
<a href={`purchase/card`}>
<button
- class="border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl"
- >
+ class="border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl">
Credit Card
</button>
</a>
diff --git a/src/routes/(app)/launch/purchase/card/+page.svelte b/src/routes/(app)/launch/purchase/card/+page.svelte
index 6d33c87f..d7ef830d 100644
--- a/src/routes/(app)/launch/purchase/card/+page.svelte
+++ b/src/routes/(app)/launch/purchase/card/+page.svelte
@@ -48,8 +48,9 @@
CVC/CVV
<span class="relative group">
<span
- class="hidden group-hover:flex justify-center items-center px-2 py-1 text-xs absolute -right-2 transform translate-x-full -translate-y-1/2 w-max top-1/2 bg-black text-white"
- >
+ class="hidden group-hover:flex justify-center items-center px-2 py-1 text-xs absolute -right-2 transform translate-x-full -translate-y-1/2 w-max top-1/2 bg-black text-white">
+
+
3-digit number on the back of your card</span
>
</span>
@@ -67,8 +68,7 @@
<button
class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-xl"
type="submit"
- disabled={loading}
- >
+ disabled={loading}>
{#if loading}
<Spinner />
{:else}
diff --git a/src/routes/(app)/launch/thanks/[asset]/+page.svelte b/src/routes/(app)/launch/thanks/[asset]/+page.svelte
index 9b37002b..3d8fb844 100644
--- a/src/routes/(app)/launch/thanks/[asset]/+page.svelte
+++ b/src/routes/(app)/launch/thanks/[asset]/+page.svelte
@@ -12,9 +12,7 @@
<div class="font-normal text-gray-800 mx-auto mb-8 space-y-8">
<h1
class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"
- >
- Thanks!
- </h1>
+ >Thanks!</h1>
<p>We look forward to seeing you!</p>
</div>
@@ -22,8 +20,7 @@
<div class="w-full flex">
<a href="/launch/ticket" class="mx-auto">
<button
- class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl"
- >
+ class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl">
Done
</button>
</a>
diff --git a/src/routes/(app)/launch/ticket/+page.svelte b/src/routes/(app)/launch/ticket/+page.svelte
index 6b16e804..a4888727 100644
--- a/src/routes/(app)/launch/ticket/+page.svelte
+++ b/src/routes/(app)/launch/ticket/+page.svelte
@@ -7,9 +7,7 @@
<div class="font-normal text-gray-800 mx-auto mb-8 space-y-8">
<h1
class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"
- >
- Your Ticket
- </h1>
+ >Your Ticket</h1>
<p>
We've minted your ticket as an <a
@@ -27,8 +25,7 @@
<div class="w-full flex">
<a href="/" class="mx-auto">
<button
- class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl"
- >
+ class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl">
Done
</button>
</a>
diff --git a/src/routes/(app)/login/+page.svelte b/src/routes/(app)/login/+page.svelte
index 647ef03c..61eea586 100644
--- a/src/routes/(app)/login/+page.svelte
+++ b/src/routes/(app)/login/+page.svelte
@@ -1,7 +1,18 @@
<script>
- import RegisterOrLogin from "$comp/RegisterOrLogin.svelte";
import { onMount } from "svelte";
- import { pin } from "$lib/store";
+ import { applyAction, deserialize } from "$app/forms";
+ import { tick } from "svelte";
+ import { fly } from "svelte/transition";
+ import { enhance } from "$app/forms";
+ import Pin from "$comp/Pin.svelte";
+ import Icon from "$comp/Icon.svelte";
+ import Spinner from "$comp/Spinner.svelte";
+ import { focus, fail } from "$lib/utils";
+ import { password, pin, loginRedirect } from "$lib/store";
+ import { t } from "$lib/translations";
+ import { page } from "$app/stores";
+ import { generate } from "$lib/nostr";
+ import { invalidateAll } from "$app/navigation";
onMount(() => {
$pin = undefined;
@@ -10,6 +21,164 @@
});
export let form;
+
+ let token, formElement;
+ let code = [];
+ let redirect;
+
+ $password = undefined;
+
+ $: need2fa = form?.message === "2fa";
+ let cancel = () => (need2fa = false);
+ $: if (form?.message === "2fa" && form.token === token) token = "";
+
+ let username, email, btn;
+
+ $: update(form);
+ let update = (form) => form && ({ username, password: $password } = form);
+
+ $: token && token?.length === 6 && tick().then(() => btn.click());
+
+ let revealPassword = false;
+
+ let loading;
+ async function handleSubmit(e) {
+ loading = true;
+
+ let data = new FormData(this);
+ let user = Object.fromEntries(data);
+ await generate(user);
+
+ for (let k in user) {
+ data.set(k, user[k]);
+ }
+
+ const response = await fetch("/login", {
+ method: "POST",
+ body: data,
+ });
+
+ const result = deserialize(await response.text());
+
+ if (result.type === "success") {
+ await invalidateAll();
+ }
+
+ applyAction(result);
+ loading = false;
+ }
</script>
-<RegisterOrLogin pageID="signIn" bind:form />
+{#if need2fa}
+ <Pin bind:value={token} title="Enter 2FA Code" {cancel} notify={false} />
+{/if}
+
+<div class="pt-10">
+ <div class="w-[243px] mx-auto mb-10">
+ <a href="/">
+ <Icon icon="logo" />
+ </a>
+ </div>
+
+ <div class="flex justify-center items-center">
+ <div
+ class="shadow-xl rounded-3xl p-10 pb-12 space-y-5 w-full mx-5 md:mx-0 md:w-[400px]"
+ >
+ <h1 class="text-2xl font-bold text-center">{$t("login.signIn")}</h1>
+
+ {#if form?.error}
+ <div class="text-red-600 text-center" in:fly>
+ {form.error}
+ </div>
+ {/if}
+
+ <form
+ class="space-y-5"
+ on:submit|preventDefault={handleSubmit}
+ method="POST"
+ >
+ <input
+ type="hidden"
+ name="loginRedirect"
+ value={$loginRedirect || $page.url.searchParams.get("redirect")}
+ />
+ <input type="hidden" name="token" value={token} />
+
+ <div>
+ <label for="username" class="font-semibold"
+ >{$t("login.username")}</label
+ >
+ <input
+ name="username"
+ type="text"
+ required
+ class="bg-primary"
+ bind:value={username}
+ use:focus
+ autocapitalize="none"
+ />
+ </div>
+
+ <div class="relative">
+ <label for="password" class="block font-semibold"
+ >{$t("login.password")}</label
+ >
+ {#if revealPassword}
+ <input
+ name="password"
+ type="text"
+ required
+ class="bg-primary"
+ bind:value={$password}
+ autocapitalize="none"
+ />
+ {:else}
+ <input
+ name="password"
+ type="password"
+ required
+ class="bg-primary"
+ bind:value={$password}
+ autocapitalize="none"
+ />
+ {/if}
+ <button
+ type="button"
+ on:click={() => (revealPassword = !revealPassword)}
+ class="absolute right-5 top-10">
+ <Icon icon={revealPassword ? "eye" : "eye-off"} />
+ </button>
+ </div>
+
+ <div class="flex justify-end items-center">
+ <a
+ href="/forgot"
+ class="underline underline-offset-4 text-black text-sm"
+ >{$t("login.forgotUserOrPassword")}</a
+ >
+ </div>
+
+ <button
+ type="submit"
+ class="bg-black text-white w-full rounded-2xl p-4 font-semibold hover:opacity-80"
+ disabled={loading}
+ bind:this={btn}>
+ {#if loading}
+ <Spinner />
+ {:else}
+ {$t("login.signIn")}
+ {/if}
+ </button>
+ </form>
+
+ <p class="text-secondary text-center font-medium">
+ {$t("login.haveAccount")}
+ <a
+ href={"/register"}
+ class="block md:inline text-black underline underline-offset-4 hover:opacity-80">
+ {$t("login.register")}
+ </a>
+ </p>
+ </div>
+ </div>
+</div>
diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte
index fd5bbae0..a1c7bbed 100644
--- a/src/routes/(app)/payment/[id]/+page.svelte
+++ b/src/routes/(app)/payment/[id]/+page.svelte
@@ -140,6 +140,8 @@
class="flex font-bold hover:opacity-80 mb-auto my-auto"
on:click={() => copy(id)}
><Icon icon="copy" style="ml-2 w-20 my-auto" />
+
+
</button>
</div>
</div>
@@ -149,8 +151,7 @@
<div>
<button
class="rounded-full border py-3 px-6 hover:opacity-80 flex w-full md:w-60"
- on:click={print}
- >
+ on:click={print}>
<div class="mx-auto flex">
<Icon icon="printer" style="my-auto h-6 mr-2" />
<div class="my-auto mt-1 text-base">{$t("payments.print")}</div>
@@ -161,8 +162,7 @@
<div>
<a href={`/payment/${id}/plain`}>
<button
- class="rounded-full border py-3 px-6 hover:opacity-80 flex w-full md:w-60"
- >
+ class="rounded-full border py-3 px-6 hover:opacity-80 flex w-full md:w-60">
<div class="mx-auto flex">
<Icon icon="printer" style="my-auto h-6 mr-2" />
<div class="my-auto mt-1 text-base">{$t("payments.print")}</div>
diff --git a/src/routes/(app)/register/+page.server.js b/src/routes/(app)/register/+page.server.js
index e986c73d..babeeb03 100644
--- a/src/routes/(app)/register/+page.server.js
+++ b/src/routes/(app)/register/+page.server.js
@@ -15,8 +15,15 @@ export const actions = {
let ip = request.headers.get("cf-connecting-ip");
let form = await fd(request);
- let { profile, username, password, cipher, salt, pubkey, loginRedirect } =
- form;
+ let {
+ profile,
+ username,
+ password,
+ cipher,
+ salt,
+ pubkey,
+ loginRedirect,
+ } = form;
let user = { profile, username, password, cipher, salt, pubkey };
let error;
diff --git a/src/routes/(app)/register/+page.svelte b/src/routes/(app)/register/+page.svelte
index 5783059a..ef057fcf 100644
--- a/src/routes/(app)/register/+page.svelte
+++ b/src/routes/(app)/register/+page.svelte
@@ -175,14 +175,12 @@
<div class="relative">
<button
class="absolute w-8 h-12 left-12 bg-white rounded top-12"
- on:click={decr}
- >
+ on:click={decr}>
<Icon icon="chevron-left" style="w-8 " />
</button>
<div class="relative w-32 mx-auto" on:click={selectAvatar}>
<button
- class="w-32 h-32 rounded-full border-4 border-white overflow-hidden flex mx-auto relative"
- >
+ class="w-32 h-32 rounded-full border-4 border-white overflow-hidden flex mx-auto relative">
<img
{src}
class="w-full h-full object-cover object-center overflow-hidden"
@@ -190,15 +188,13 @@
/>
</button>
<button
- class="absolute bg-white rounded-full p-2 mx-auto right-0 bottom-0 z-10 bg-opacity-80"
- >
+ class="absolute bg-white rounded-full p-2 mx-auto right-0 bottom-0 z-10 bg-opacity-80">
<Icon icon="upload" style="w-8" />
</button>
</div>
<button
class="absolute w-8 h-12 right-12 bg-white rounded top-12"
- on:click={incr}
- >
+ on:click={incr}>
<Icon icon="chevron-left" style="w-8 rotate-180" />
</button>
</div>
@@ -240,8 +236,7 @@
type="button"
on:click={refresh}
class="absolute right-0 top-4"
- tabindex="5"
- >
+ tabindex="5">
<Icon icon="random" style="w-10 m-4" />
</button>
</div>
@@ -276,8 +271,7 @@
type="button"
tabindex="4"
on:click={() => (revealPassword = !revealPassword)}
- class="absolute right-0 top-4"
- >
+ class="absolute right-0 top-4">
<Icon icon={revealPassword ? "eye" : "eye-off"} style="m-6" />
</button>
</div>
@@ -291,8 +285,7 @@
type="submit"
class="bg-black text-white w-full rounded-2xl p-4 font-semibold hover:opacity-80"
disabled={loading}
- bind:this={btn}
- >
+ bind:this={btn}>
{#if loading}
<Spinner />
{:else}
@@ -305,8 +298,7 @@
{$t("login.haveAccount")}
<a
href={"/login"}
- class="block md:inline text-black underline underline-offset-4 hover:opacity-80"
- >
+ class="block md:inline text-black underline underline-offset-4 hover:opacity-80">
{$t("login.signIn")}
</a>
</p>
diff --git a/src/routes/(app)/scan/+page.svelte b/src/routes/(app)/scan/+page.svelte
index e23b9bb8..c02fc1c2 100644
--- a/src/routes/(app)/scan/+page.svelte
+++ b/src/routes/(app)/scan/+page.svelte
@@ -37,10 +37,7 @@
<div class="flex w-full mb-4">
<button
class="mx-auto border rounded-full px-6 py-2 font-bold hover:opacity-80"
- on:click={back}
- >
- Cancel
- </button>
+ on:click={back}> Cancel </button>
</div>
<style>
diff --git a/src/routes/(app)/send/[...text]/+page.svelte b/src/routes/(app)/send/[...text]/+page.svelte
index 8548964c..b76e067e 100644
--- a/src/routes/(app)/send/[...text]/+page.svelte
+++ b/src/routes/(app)/send/[...text]/+page.svelte
@@ -63,8 +63,7 @@
<a href={`/qr/${encodeURIComponent(text)}`}>
<button
type="button"
- class="flex border rounded-full px-6 py-2 font-bold hover:opacity-80 mr-1"
- >
+ class="flex border rounded-full px-6 py-2 font-bold hover:opacity-80 mr-1">
<Icon icon="qr" style="mr-2 w-6 my-auto invert" />
<div class="my-auto">{$t("user.send.makeQR")}</div>
</button>
@@ -74,8 +73,7 @@
<a href="/scan">
<button
type="button"
- class="flex border rounded-full px-6 py-2 font-bold hover:opacity-80 mr-1"
- >
+ class="flex border rounded-full px-6 py-2 font-bold hover:opacity-80 mr-1">
<Icon icon="camera" style="mr-2 w-6 my-auto" />
<div class="my-auto">{$t("user.send.scan")}</div>
</button>
@@ -84,8 +82,7 @@
<button
type="button"
class="flex border rounded-full px-6 py-2 font-bold hover:opacity-80 mr-1"
- on:click={paste}
- >
+ on:click={paste}>
<Icon icon="paste" style="mr-2 w-6 my-auto" />
<div class="my-auto">{$t("user.send.paste")}</div>
</button>
@@ -95,8 +92,7 @@
type="submit"
class="{!text
? 'opacity-50'
- : 'opacity-100 hover:opacity-80'} bg-black text-white border rounded-full px-6 py-2 font-bold"
- >
+ : 'opacity-100 hover:opacity-80'} bg-black text-white border rounded-full px-6 py-2 font-bold">
{$t("user.send.next")}
</button>
</div>
diff --git a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.server.js b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.server.js
index 5cb86aec..aaccf762 100644
--- a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.server.js
+++ b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.server.js
@@ -5,8 +5,16 @@ let seen = {};
export const actions = {
default: async ({ cookies, request }) => {
try {
- let { address, amount, confirmed, feeRate, subtract, pin, stale, ts } =
- await await fd(request);
+ let {
+ address,
+ amount,
+ confirmed,
+ feeRate,
+ subtract,
+ pin,
+ stale,
+ ts,
+ } = await await fd(request);
if (seen[ts]) return fail(400, { message: "Duplicate form submission" });
let estimate = await post(
diff --git a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte
index 133eab91..a8b86718 100644
--- a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte
+++ b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte
@@ -150,8 +150,7 @@
bind:this={submit}
type="submit"
class="opacity-100 hover:opacity-80 rounded-2xl border py-3 font-bold mt-2 bg-black text-white px-4 w-24"
- disabled={loading}
- >
+ disabled={loading}>
{#if confirmed}
{$t("payments.send")}
{:else}
diff --git a/src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte b/src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte
index b6a4aa0c..240abc32 100644
--- a/src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte
+++ b/src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte
@@ -47,8 +47,7 @@
<div class="flex w-full">
<button
type="submit"
- class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- >
+ class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24">
{#if loading}
<Spinner />
{:else}
diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte
index 79367534..5a9dbe9a 100644
--- a/src/routes/(app)/send/invoice/[id]/+page.svelte
+++ b/src/routes/(app)/send/invoice/[id]/+page.svelte
@@ -144,8 +144,7 @@
{#if amount}
<button
type="submit"
- class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- >
+ class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24">
{#if loading}
<Spinner />
{:else}
@@ -156,8 +155,7 @@
<button
type="button"
class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- on:click={setAmount}
- >
+ on:click={setAmount}>
{$t("payments.next")}
</button>
{/if}
diff --git a/src/routes/(app)/send/lightning/[payreq]/+page.svelte b/src/routes/(app)/send/lightning/[payreq]/+page.svelte
index ce9649fa..0b9b19d1 100644
--- a/src/routes/(app)/send/lightning/[payreq]/+page.svelte
+++ b/src/routes/(app)/send/lightning/[payreq]/+page.svelte
@@ -74,8 +74,7 @@
<button
type="submit"
class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- disabled={loading}
- >
+ disabled={loading}>
{#if loading}
<Spinner />
{:else}
@@ -92,9 +91,7 @@
<div
class="absolute right-[2px] top-[25px] text-gray-600 rounded-r-2xl p-4 h-[54px] my-auto border-l"
- >
- ⚡️
- </div>
+ >⚡️</div>
</div>
{:else}
<div class="flex w-full mt-5">
@@ -113,8 +110,7 @@
<button
type="submit"
class="bg-black text-white rounded-xl h-[48px] flex w-full justify-center items-center font-semibold
- opacity-100 hover:opacity-80"
- >
+ opacity-100 hover:opacity-80">
Next
</button>
</form>
diff --git a/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte b/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte
index 1ad2c458..c97d0377 100644
--- a/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte
+++ b/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte
@@ -83,8 +83,7 @@
{#if amount}
<button
type="submit"
- class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- >
+ class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24">
{#if loading}
<Spinner />
{:else}
@@ -97,10 +96,7 @@
bind:this={next}
class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
on:click={setAmount}
- on:keydown={setAmount}
- >
- Next
- </button>
+ on:keydown={setAmount}> Next </button>
{/if}
</div>
</form>
diff --git a/src/routes/(app)/support/+page.svelte b/src/routes/(app)/support/+page.svelte
index 8d8bee1a..17a6063e 100644
--- a/src/routes/(app)/support/+page.svelte
+++ b/src/routes/(app)/support/+page.svelte
@@ -46,11 +46,10 @@
});
</script>
-<svelte:head>
- <script
- src="https://www.google.com/recaptcha/api.js?render=6LfCd8YkAAAAANmVJgzN3SQY3n3fv1RhiS5PgMYM"
- ></script>
-</svelte:head>
+<svelte:head
+ ><script
+ src="https://www.google.com/recaptcha/api.js?render=6LfCd8YkAAAAANmVJgzN3SQY3n3fv1RhiS5PgMYM"></script></svelte:head
+>
{#if user}
<AppHeader {data} />
diff --git a/src/routes/(static)/docs/+page.svelte b/src/routes/(static)/docs/+page.svelte
index 5c7876aa..68791d7a 100644
--- a/src/routes/(static)/docs/+page.svelte
+++ b/src/routes/(static)/docs/+page.svelte
@@ -20,7 +20,8 @@
<p class="text-secondary">
Coinos is free and open source software. You can run it on your own server
and connect it to your own Bitcoin and Lightning nodes. The code is
- available for download at <a href="https://github.com/coinos"
+ available for download at <a
+ href="https://github.com/coinos"
class="text-black">https://github.com/coinos</a
>
</p>