From efdbc67c17fab67bf3cdce448a30aa82f62c5212 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 9 Nov 2023 16:49:10 -0800 Subject: funds --- src/components/AppHeader.svelte | 1 + 1 file changed, 1 insertion(+) (limited to 'src/components/AppHeader.svelte') diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index 798073fb..4ee0c4a7 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -17,6 +17,7 @@ menuButtons = [ { key: 'nav.settings', icon: 'settings', href: `/${user.username}/settings` }, { key: 'nav.support', icon: 'support', href: `/support` }, + { key: 'nav.funds', icon: 'fund', href: `/${user.username}/funds` }, { key: 'nav.map', icon: 'map', href: `/${user.username}/map` }, { key: 'nav.merch', icon: 'shirt', href: `https://coinosmerch.com` }, { key: 'nav.signOut', icon: 'logout', href: `/logout` } -- cgit v1.2.3 From ae87f1d43c6d2cf34bd2ea6fd7b4d28af6d2aa91 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 10 Nov 2023 21:33:49 -0800 Subject: nav update --- src/components/AppHeader.svelte | 9 +- src/locales/en.json | 30 ++--- .../(app)/[username]/(profile)/+layout.svelte | 32 ++--- src/routes/(app)/[username]/(profile)/+page.svelte | 20 ++- src/routes/(app)/[username]/funds/+page.server.js | 0 src/routes/(app)/[username]/funds/+page.svelte | 56 +++++++++ src/routes/(app)/fund/[id]/+page.server.js | 23 ++++ src/routes/(app)/fund/[id]/+page.svelte | 138 +++++++++++++++++++++ src/routes/(app)/fund/[id]/sweep/+page.server.js | 14 +++ src/routes/(app)/fund/[id]/sweep/+page.svelte | 37 ++++++ .../(app)/fund/[id]/withdraw/+page.server.js | 20 +++ src/routes/(app)/fund/[id]/withdraw/+page.svelte | 58 +++++++++ src/routes/(app)/fund/[id]/withdraw/+server.js | 6 + src/routes/(app)/funds/[id]/+page.server.js | 23 ---- src/routes/(app)/funds/[id]/+page.svelte | 138 --------------------- src/routes/(app)/funds/[id]/sweep/+page.server.js | 14 --- src/routes/(app)/funds/[id]/sweep/+page.svelte | 37 ------ .../(app)/funds/[id]/withdraw/+page.server.js | 20 --- src/routes/(app)/funds/[id]/withdraw/+page.svelte | 58 --------- src/routes/(app)/funds/[id]/withdraw/+server.js | 6 - src/routes/(app)/send/[...text]/+page.svelte | 2 +- src/routes/+page.svelte | 2 +- static/icons/about.svg | 12 ++ static/icons/book.svg | 4 + static/icons/camera.svg | 54 +------- static/icons/fund.svg | 65 +--------- static/icons/funds.svg | 52 ++++++++ static/icons/home.svg | 46 +------ static/icons/message.svg | 3 + static/icons/receive.svg | 16 +++ static/icons/shop.svg | 2 + static/icons/support.svg | 5 +- 32 files changed, 491 insertions(+), 511 deletions(-) create mode 100644 src/routes/(app)/[username]/funds/+page.server.js create mode 100644 src/routes/(app)/[username]/funds/+page.svelte create mode 100644 src/routes/(app)/fund/[id]/+page.server.js create mode 100644 src/routes/(app)/fund/[id]/+page.svelte create mode 100644 src/routes/(app)/fund/[id]/sweep/+page.server.js create mode 100644 src/routes/(app)/fund/[id]/sweep/+page.svelte create mode 100644 src/routes/(app)/fund/[id]/withdraw/+page.server.js create mode 100644 src/routes/(app)/fund/[id]/withdraw/+page.svelte create mode 100644 src/routes/(app)/fund/[id]/withdraw/+server.js delete mode 100644 src/routes/(app)/funds/[id]/+page.server.js delete mode 100644 src/routes/(app)/funds/[id]/+page.svelte delete mode 100644 src/routes/(app)/funds/[id]/sweep/+page.server.js delete mode 100644 src/routes/(app)/funds/[id]/sweep/+page.svelte delete mode 100644 src/routes/(app)/funds/[id]/withdraw/+page.server.js delete mode 100644 src/routes/(app)/funds/[id]/withdraw/+page.svelte delete mode 100644 src/routes/(app)/funds/[id]/withdraw/+server.js create mode 100644 static/icons/about.svg create mode 100644 static/icons/book.svg create mode 100644 static/icons/funds.svg create mode 100644 static/icons/message.svg create mode 100644 static/icons/receive.svg create mode 100644 static/icons/shop.svg (limited to 'src/components/AppHeader.svelte') diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index 4ee0c4a7..4ccd2d03 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -17,10 +17,7 @@ menuButtons = [ { key: 'nav.settings', icon: 'settings', href: `/${user.username}/settings` }, { key: 'nav.support', icon: 'support', href: `/support` }, - { key: 'nav.funds', icon: 'fund', href: `/${user.username}/funds` }, - { key: 'nav.map', icon: 'map', href: `/${user.username}/map` }, - { key: 'nav.merch', icon: 'shirt', href: `https://coinosmerch.com` }, - { key: 'nav.signOut', icon: 'logout', href: `/logout` } + { key: 'nav.signOut', icon: 'logout', href: `/logout` }, ]; let showMenu = false; @@ -56,7 +53,7 @@ .url.pathname === `/${user.username}/receive` ? 'opacity-100' : 'opacity-70 hover:opacity-80'}" - > + > @@ -116,8 +113,6 @@ {/each} -
-
Coinos diff --git a/src/locales/en.json b/src/locales/en.json index 7aa157d1..9ecd3702 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -31,21 +31,13 @@ }, "faq": { "header": "FAQ", - "why": { - "question": "Why accept Bitcoin?", - "answer": "With Bitcoin, merchants save on fees, consumers gain privacy and savers gain purchasing power. We'll promote your business to an enthusiastic community that prefers to shop at places that take Bitcoin." - }, "cost": { "question": "What does it cost?", - "answer": "Receiving payments into your account is free. Withdrawals to external wallets incur a small fee that varies depending on network conditions. We charge 0.1% to convert between lightning and on-chain Bitcoin. Sending to other Coinos accounts is free." - }, - "individuals": { - "question": "Who can use it?", - "answer": "Anyone, anywhere in the world. Coinos is suitable for individuals and businesses." + "answer": "Receiving payments into your account is free. Withdrawals to external wallets incur a small fee that varies depending on network conditions." }, "compatibility": { "question": "Do I need any special device or software?", - "answer": "No, Coinos is a web app that works anywhere that has Internet. Merchants might use it on a tablet or put up a QR code for customers to scan with their phone." + "answer": "No, Coinos works anywhere that has Internet. Merchants might use it on a tablet or put up a QR code for customers to scan with their phone." }, "safety": { "question": "When do my funds settle?", @@ -55,14 +47,6 @@ "question": "Can Coinos integrate with my existing PoS?", "answer": "We recommend entering sales into your existing PoS as cash transactions." }, - "accounting": { - "question": "What about accounting?", - "answer": "We display all payments in terms of your local currency and let you filter by date so you can report your income as normal. You can export your account history to a csv file. If you sell Bitcoin for a profit you may wish to report capital gains." - }, - "offramp": { - "question": "Can I convert the Bitcoin I receive to my local currency?", - "answer": "You can withdraw your funds at any time to an exchange or brokerage to sell your Bitcoin and receive a bank transfer. We may be willing to provide direct settlement via e-transfer to select Canadian merchants." - }, "bitcoin": { "question": "What can I do with Bitcoin?", "answer": "Spend it at other merchants or pay your expenses with it by getting your staff, suppliers and landlord to take it." @@ -146,14 +130,17 @@ "failed": "Login failed" }, "nav": { + "about": "About", + "docs": "Docs", + "messages": "Messages", "funds": "Funds", "map": "Map", - "merch": "Merch", + "merch": "Shop", "profile": "Profile", "startInSeconds": "Start in Seconds", "account": "Account", "signIn": "Sign In", - "signOut": "Sign Out", + "signOut": "Sign out", "dashboard": "Dashboard", "settings": "Settings", "support": "Support" @@ -203,7 +190,7 @@ }, "send": { "contacts": "Contacts", - "scan": "Scan QR", + "scan": "Scan", "paste": "Paste", "next": "Next", "placeholder": "Paste a bitcoin address, lightning invoice or coinos username" @@ -265,6 +252,7 @@ } }, "payments": { + "create": "Create", "fund": "Fund", "addFunds": "Add Funds", "takeFunds": "Take Funds", diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index 35c316bb..8790aaf2 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -17,7 +17,7 @@ $: ({ currency, username: n, display } = subject); $: username = n.length > 60 ? n.substr(0, 6) : display || n; - $: npub = bech32m.encode('npub', toWords(hexToUint8Array(user.pubkey)), 180); + $: npub = bech32m.encode('npub', toWords(hexToUint8Array(subject.pubkey)), 180); $: lnaddr = `${n}@${$page.url.host}`; $: profile = `${$page.url.host}/${n}`; @@ -147,7 +147,7 @@ {#if following}
{/if} - {#if user && user.username !== subject.username && subject.pubkey} + {#if !subject.anon && subject.username !== user?.username}
-
+
diff --git a/src/routes/(app)/[username]/(profile)/+page.svelte b/src/routes/(app)/[username]/(profile)/+page.svelte index 84aa4425..180b12bd 100644 --- a/src/routes/(app)/[username]/(profile)/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/+page.svelte @@ -96,21 +96,21 @@ {/if}
- - diff --git a/src/routes/(app)/[username]/funds/+page.server.js b/src/routes/(app)/[username]/funds/+page.server.js new file mode 100644 index 00000000..e69de29b diff --git a/src/routes/(app)/[username]/funds/+page.svelte b/src/routes/(app)/[username]/funds/+page.svelte new file mode 100644 index 00000000..6479fb8b --- /dev/null +++ b/src/routes/(app)/[username]/funds/+page.svelte @@ -0,0 +1,56 @@ + + +
+

+ Funds +

+ +
+
+
+
+ +
+ +
+
+ +
+
+
+ Pot +
+ +
Pot
+
+
+ +
+
+ +
+
+
+
+ + +
+
+ + diff --git a/src/routes/(app)/fund/[id]/+page.server.js b/src/routes/(app)/fund/[id]/+page.server.js new file mode 100644 index 00000000..4194deed --- /dev/null +++ b/src/routes/(app)/fund/[id]/+page.server.js @@ -0,0 +1,23 @@ +import { error, redirect } from '@sveltejs/kit'; +import { auth, get, post } from '$lib/utils'; +import Qr from 'qrcode-base64'; + +export let load = async ({ params: { id }, url }) => { + let { amount, payments } = await get(`/fund/${id}`); + + let src = Qr.drawImg(url.href, { size: 300 }); + return { amount, payments, src }; +}; + +export const actions = { + default: async ({ cookies, locals, params, request }) => { + let { user } = locals; + + if (user) { + await post('/redeem', params, auth(cookies)); + throw redirect(307, `/${user.username}/payments`); + } + + throw redirect(307, '/register'); + } +}; diff --git a/src/routes/(app)/fund/[id]/+page.svelte b/src/routes/(app)/fund/[id]/+page.svelte new file mode 100644 index 00000000..d2d3079c --- /dev/null +++ b/src/routes/(app)/fund/[id]/+page.svelte @@ -0,0 +1,138 @@ + + +
+
+
+
+ + {#if id.split('-').length === 4} +

Card {id}

+ {:else} + Fund +
+

{$t('payments.fund')}

+

{id}

+
+ {/if} +
+ {#if show} + {id} + {/if} +
+
+

+ {f(amountFiat, currency)} +

+

+ {sat(amount)} +

+
+
+ +
+ + +
+ +
+
+
diff --git a/src/routes/(app)/fund/[id]/sweep/+page.server.js b/src/routes/(app)/fund/[id]/sweep/+page.server.js new file mode 100644 index 00000000..9fd244a3 --- /dev/null +++ b/src/routes/(app)/fund/[id]/sweep/+page.server.js @@ -0,0 +1,14 @@ +import { get, auth, post } from '$lib/utils'; +import { redirect } from '@sveltejs/kit'; + +export async function load({ cookies, params, parent }) { + let { user } = await parent(); + let { id } = params; + let { amount } = await get(`/fund/${id}`); + + + if (!amount) throw redirect(307, `/fund/${id}`); + if (!user) throw redirect(307, `/register?redirect=/fund/${id}/sweep`); + await post('/take', { amount, id }, auth(cookies)); + return { amount, id }; +} diff --git a/src/routes/(app)/fund/[id]/sweep/+page.svelte b/src/routes/(app)/fund/[id]/sweep/+page.svelte new file mode 100644 index 00000000..64bed4dd --- /dev/null +++ b/src/routes/(app)/fund/[id]/sweep/+page.svelte @@ -0,0 +1,37 @@ + + +
+
+ + + +
+ +
+ +
+

{$t('payments.fundsClaimed')}

+

+ {f(fiat(amount, rate), currency)} +

+

+ ⚡️{s(amount)} +

+
+ + +
+ + +
{$t('payments.tapAnywhere')}
diff --git a/src/routes/(app)/fund/[id]/withdraw/+page.server.js b/src/routes/(app)/fund/[id]/withdraw/+page.server.js new file mode 100644 index 00000000..476149f2 --- /dev/null +++ b/src/routes/(app)/fund/[id]/withdraw/+page.server.js @@ -0,0 +1,20 @@ +import { fail, json, redirect } from '@sveltejs/kit'; +import { fd, auth, post } from '$lib/utils'; + +export async function load({ parent }) { + let { user } = await parent(); + if (!user) throw redirect(307, '/register'); +} + +export const actions = { + default: async ({ cookies, request }) => { + let body = await fd(request); + try { + await post('/take', body, auth(cookies)); + } catch (e) { + return fail(400, { message: e.message }); + } + + throw redirect(307, `/fund/${body.id}`); + } +}; diff --git a/src/routes/(app)/fund/[id]/withdraw/+page.svelte b/src/routes/(app)/fund/[id]/withdraw/+page.svelte new file mode 100644 index 00000000..9cad945a --- /dev/null +++ b/src/routes/(app)/fund/[id]/withdraw/+page.svelte @@ -0,0 +1,58 @@ + + + + +{#if form?.message} +
+ {form.message} +
+{/if} + +
+ + +
+ + + + +
+ +
+
+
diff --git a/src/routes/(app)/fund/[id]/withdraw/+server.js b/src/routes/(app)/fund/[id]/withdraw/+server.js new file mode 100644 index 00000000..0f9a23f3 --- /dev/null +++ b/src/routes/(app)/fund/[id]/withdraw/+server.js @@ -0,0 +1,6 @@ +import { json } from '@sveltejs/kit'; +import { auth, post } from '$lib/utils'; + +export async function POST({ cookies, request }) { + return json(await post('/take', await request.json(), auth(cookies))); +} diff --git a/src/routes/(app)/funds/[id]/+page.server.js b/src/routes/(app)/funds/[id]/+page.server.js deleted file mode 100644 index 4194deed..00000000 --- a/src/routes/(app)/funds/[id]/+page.server.js +++ /dev/null @@ -1,23 +0,0 @@ -import { error, redirect } from '@sveltejs/kit'; -import { auth, get, post } from '$lib/utils'; -import Qr from 'qrcode-base64'; - -export let load = async ({ params: { id }, url }) => { - let { amount, payments } = await get(`/fund/${id}`); - - let src = Qr.drawImg(url.href, { size: 300 }); - return { amount, payments, src }; -}; - -export const actions = { - default: async ({ cookies, locals, params, request }) => { - let { user } = locals; - - if (user) { - await post('/redeem', params, auth(cookies)); - throw redirect(307, `/${user.username}/payments`); - } - - throw redirect(307, '/register'); - } -}; diff --git a/src/routes/(app)/funds/[id]/+page.svelte b/src/routes/(app)/funds/[id]/+page.svelte deleted file mode 100644 index d2d3079c..00000000 --- a/src/routes/(app)/funds/[id]/+page.svelte +++ /dev/null @@ -1,138 +0,0 @@ - - -
-
-
-
- - {#if id.split('-').length === 4} -

Card {id}

- {:else} - Fund -
-

{$t('payments.fund')}

-

{id}

-
- {/if} -
- {#if show} - {id} - {/if} -
-
-

- {f(amountFiat, currency)} -

-

- {sat(amount)} -

-
-
- -
- - -
- -
-
-
diff --git a/src/routes/(app)/funds/[id]/sweep/+page.server.js b/src/routes/(app)/funds/[id]/sweep/+page.server.js deleted file mode 100644 index 9fd244a3..00000000 --- a/src/routes/(app)/funds/[id]/sweep/+page.server.js +++ /dev/null @@ -1,14 +0,0 @@ -import { get, auth, post } from '$lib/utils'; -import { redirect } from '@sveltejs/kit'; - -export async function load({ cookies, params, parent }) { - let { user } = await parent(); - let { id } = params; - let { amount } = await get(`/fund/${id}`); - - - if (!amount) throw redirect(307, `/fund/${id}`); - if (!user) throw redirect(307, `/register?redirect=/fund/${id}/sweep`); - await post('/take', { amount, id }, auth(cookies)); - return { amount, id }; -} diff --git a/src/routes/(app)/funds/[id]/sweep/+page.svelte b/src/routes/(app)/funds/[id]/sweep/+page.svelte deleted file mode 100644 index 64bed4dd..00000000 --- a/src/routes/(app)/funds/[id]/sweep/+page.svelte +++ /dev/null @@ -1,37 +0,0 @@ - - -
-
- - - -
- -
- -
-

{$t('payments.fundsClaimed')}

-

- {f(fiat(amount, rate), currency)} -

-

- ⚡️{s(amount)} -

-
- - -
- - -
{$t('payments.tapAnywhere')}
diff --git a/src/routes/(app)/funds/[id]/withdraw/+page.server.js b/src/routes/(app)/funds/[id]/withdraw/+page.server.js deleted file mode 100644 index 476149f2..00000000 --- a/src/routes/(app)/funds/[id]/withdraw/+page.server.js +++ /dev/null @@ -1,20 +0,0 @@ -import { fail, json, redirect } from '@sveltejs/kit'; -import { fd, auth, post } from '$lib/utils'; - -export async function load({ parent }) { - let { user } = await parent(); - if (!user) throw redirect(307, '/register'); -} - -export const actions = { - default: async ({ cookies, request }) => { - let body = await fd(request); - try { - await post('/take', body, auth(cookies)); - } catch (e) { - return fail(400, { message: e.message }); - } - - throw redirect(307, `/fund/${body.id}`); - } -}; diff --git a/src/routes/(app)/funds/[id]/withdraw/+page.svelte b/src/routes/(app)/funds/[id]/withdraw/+page.svelte deleted file mode 100644 index 9cad945a..00000000 --- a/src/routes/(app)/funds/[id]/withdraw/+page.svelte +++ /dev/null @@ -1,58 +0,0 @@ - - - - -{#if form?.message} -
- {form.message} -
-{/if} - -
- - -
- - - - -
- -
-
-
diff --git a/src/routes/(app)/funds/[id]/withdraw/+server.js b/src/routes/(app)/funds/[id]/withdraw/+server.js deleted file mode 100644 index 0f9a23f3..00000000 --- a/src/routes/(app)/funds/[id]/withdraw/+server.js +++ /dev/null @@ -1,6 +0,0 @@ -import { json } from '@sveltejs/kit'; -import { auth, post } from '$lib/utils'; - -export async function POST({ cookies, request }) { - return json(await post('/take', await request.json(), auth(cookies))); -} diff --git a/src/routes/(app)/send/[...text]/+page.svelte b/src/routes/(app)/send/[...text]/+page.svelte index de84c287..b2c9616c 100644 --- a/src/routes/(app)/send/[...text]/+page.svelte +++ b/src/routes/(app)/send/[...text]/+page.svelte @@ -61,7 +61,7 @@ type="button" class="flex border rounded-full px-6 py-2 font-bold hover:opacity-80 mr-1" > - +
{$t('user.send.scan')}
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index ec9f55b7..0aaf887d 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -89,7 +89,7 @@
-

{$t('faq.header')}

+

{$t('faq.header')}

{#each Object.keys(faqs).filter((f) => f !== 'header') as faqID} {/each} diff --git a/static/icons/about.svg b/static/icons/about.svg new file mode 100644 index 00000000..3222097f --- /dev/null +++ b/static/icons/about.svg @@ -0,0 +1,12 @@ + + + + about + + + + + + + + \ No newline at end of file diff --git a/static/icons/book.svg b/static/icons/book.svg new file mode 100644 index 00000000..4d7b091d --- /dev/null +++ b/static/icons/book.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/static/icons/camera.svg b/static/icons/camera.svg index b615c7b5..3568ed14 100644 --- a/static/icons/camera.svg +++ b/static/icons/camera.svg @@ -1,49 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/static/icons/fund.svg b/static/icons/fund.svg index 93bd87f5..0ffd17cd 100644 --- a/static/icons/fund.svg +++ b/static/icons/fund.svg @@ -1,63 +1,4 @@ - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/static/icons/funds.svg b/static/icons/funds.svg new file mode 100644 index 00000000..f3d0c5a0 --- /dev/null +++ b/static/icons/funds.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/static/icons/home.svg b/static/icons/home.svg index 2aa2cbed..c3482cdd 100644 --- a/static/icons/home.svg +++ b/static/icons/home.svg @@ -1,42 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/static/icons/message.svg b/static/icons/message.svg new file mode 100644 index 00000000..47b935b5 --- /dev/null +++ b/static/icons/message.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/icons/receive.svg b/static/icons/receive.svg new file mode 100644 index 00000000..143ae144 --- /dev/null +++ b/static/icons/receive.svg @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/static/icons/shop.svg b/static/icons/shop.svg new file mode 100644 index 00000000..15b2918c --- /dev/null +++ b/static/icons/shop.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/static/icons/support.svg b/static/icons/support.svg index 47b935b5..f9265ed8 100644 --- a/static/icons/support.svg +++ b/static/icons/support.svg @@ -1,3 +1,2 @@ - - - + + \ No newline at end of file -- cgit v1.2.3 From 8e278fadaf0d8a735e259d4d6c59ade581150692 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 11 Nov 2023 00:04:17 -0800 Subject: map animation and list --- src/components/AppHeader.svelte | 4 +- src/components/LocationsMap.svelte | 147 ++++++++++++++++++--- src/locales/en.json | 2 +- src/routes/(app)/[username]/(profile)/+page.svelte | 2 +- static/icons/pause.svg | 2 + static/icons/play.svg | 17 +++ 6 files changed, 155 insertions(+), 19 deletions(-) create mode 100644 static/icons/pause.svg create mode 100644 static/icons/play.svg (limited to 'src/components/AppHeader.svelte') diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index 4ccd2d03..3bf1e893 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -17,6 +17,8 @@ menuButtons = [ { key: 'nav.settings', icon: 'settings', href: `/${user.username}/settings` }, { key: 'nav.support', icon: 'support', href: `/support` }, + { key: 'nav.map', icon: 'map', href: `/${user.username}/map` }, + { key: 'nav.merch', icon: 'shop', href: `https://coinosmerch.com` }, { key: 'nav.signOut', icon: 'logout', href: `/logout` }, ]; @@ -53,7 +55,7 @@ .url.pathname === `/${user.username}/receive` ? 'opacity-100' : 'opacity-70 hover:opacity-80'}" - > + > diff --git a/src/components/LocationsMap.svelte b/src/components/LocationsMap.svelte index 7876659a..edd20632 100644 --- a/src/components/LocationsMap.svelte +++ b/src/components/LocationsMap.svelte @@ -2,6 +2,7 @@ import { onMount, onDestroy } from 'svelte'; import { browser } from '$app/environment'; import html2canvas from 'html2canvas'; + import { Icon } from '$comp'; import 'maplibre-gl/dist/maplibre-gl.css'; @@ -10,6 +11,71 @@ let mapContainer; let markers = []; + let currentIndex = -1; + let timeout; + + function select(m) { + stopFlying(); + currentIndex = inview.indexOf(m); + flyToMarker(m); + } + + async function flyToMarker(marker) { + marker.getElement().click(); + + map.flyTo({ + zoom: 14, + center: marker.getLngLat(), + essential: true, + easing: function (t) { + return 1 - Math.pow(1 - t, 3); + }, + duration: 5000 + }); + + await new Promise((r) => setTimeout(r, 5000)); + + if (!timeout) return; + + map.flyTo({ + zoom: 10.5, + center: marker.getLngLat(), + essential: true, + easing: function (t) { + return 1 - Math.pow(1 - t, 3); + }, + duration: 2000 + }); + } + + let toggle = () => { + if (timeout) stopFlying(); + else startFlying(); + }; + + let currentPopup; + function startFlying() { + currentIndex++; + + for (let p in popups) popups[p].remove(); + if (currentIndex >= inview.length) currentIndex = 0; + flyToMarker(inview[currentIndex]); + + timeout = setTimeout(startFlying, 7000); + } + + function stopFlying() { + if (!timeout) return; + timeout = clearTimeout(timeout); + + if (currentPopup) { + currentPopup.remove(); + } + + map.jumpTo({ center: map.getCenter(), zoom: map.getZoom() }); + map.off('moveend'); // Remove moveend listener if set + } + let checkAddress = (location) => { if (location['addr:housenumber'] && location['addr:street'] && location['addr:city']) { return `${ @@ -24,23 +90,24 @@ } }; + let inview = []; + function updateLabelVisibility() { + inview = []; if (!map) return; let zoom = map.getZoom(); let bounds = map.getBounds(); for (let marker of markers) { let isInView = bounds.contains(marker.getLngLat()); - let popup = marker.getPopup(); let { tags } = marker; - if (zoom > 13 && isInView) { - popup.setHTML(`${tags.name}`).addTo(map); - } else { - popup.remove(); - popup.setHTML(html(tags)); + if (isInView) { + inview.push(marker); } } + + inview = inview.sort((a, b) => a.tags.name.localeCompare(b.tags.name)); } let html = (tags) => `${ @@ -53,10 +120,13 @@ ${ tags && tags.website - ? `${tags.website}` + ? `${tags.website}` : '' }`; + let popups = {}; + let counter = 0; + onMount(() => { if (browser) { import('maplibre-gl').then(({ default: maplibre }) => { @@ -82,10 +152,16 @@ .setPopup(new maplibre.Popup().setHTML(html(tags))) .addTo(map); + marker.id = counter++; + marker.getElement().addEventListener('click', () => { let h = html(marker.tags); - let popup = marker.getPopup(); - popup.setHTML(h); + let p = marker.getPopup(); + popups[marker.id] = p; + p.setHTML(h); + p.on('close', () => { + delete popups[marker.id]; + }); }); marker.tags = tags; @@ -93,18 +169,31 @@ markers.push(marker); }); - // updateLabelVisibility(); - // map.on('moveend', updateLabelVisibility); - // map.on('zoomend', updateLabelVisibility); + updateLabelVisibility(); + + let observer = new IntersectionObserver( + (entries, observer) => { + entries.forEach((entry) => { + if (entry.isIntersecting) startFlying(); + else stopFlying(); + }); + }, + { threshold: 0.5 } + ); + + observer.observe(mapContainer); }); + + map.on('mousedown', stopFlying); + map.on('touchstart', stopFlying); + map.on('wheel', stopFlying); + map.on('dragstart', stopFlying); }); } }); onDestroy(() => { if (map) { - // map.off('moveend', updateLabelVisibility); - // map.off('zoomend', updateLabelVisibility); map.remove(); } }); @@ -113,12 +202,37 @@
+
+ + +
+ {#each inview as m} + + {/each} +
+
+ + {inview.length}
diff --git a/src/locales/en.json b/src/locales/en.json index 9ecd3702..2f629675 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -135,7 +135,7 @@ "messages": "Messages", "funds": "Funds", "map": "Map", - "merch": "Shop", + "merch": "Swag", "profile": "Profile", "startInSeconds": "Start in Seconds", "account": "Account", diff --git a/src/routes/(app)/[username]/(profile)/+page.svelte b/src/routes/(app)/[username]/(profile)/+page.svelte index 180b12bd..e3150ff2 100644 --- a/src/routes/(app)/[username]/(profile)/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/+page.svelte @@ -99,7 +99,7 @@ class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-full" >
- +
{$t('user.dashboard.receive')}
diff --git a/static/icons/pause.svg b/static/icons/pause.svg new file mode 100644 index 00000000..81f4ea44 --- /dev/null +++ b/static/icons/pause.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/static/icons/play.svg b/static/icons/play.svg new file mode 100644 index 00000000..144f8219 --- /dev/null +++ b/static/icons/play.svg @@ -0,0 +1,17 @@ + + + + + play + Created with Sketch Beta. + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From a27cde8cea5a6266ed58a3fcc0be3e187e726c86 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 11 Nov 2023 00:17:22 -0800 Subject: restore coinos link --- src/components/AppHeader.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/components/AppHeader.svelte') diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index 3bf1e893..a37a834e 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -19,7 +19,7 @@ { key: 'nav.support', icon: 'support', href: `/support` }, { key: 'nav.map', icon: 'map', href: `/${user.username}/map` }, { key: 'nav.merch', icon: 'shop', href: `https://coinosmerch.com` }, - { key: 'nav.signOut', icon: 'logout', href: `/logout` }, + { key: 'nav.signOut', icon: 'logout', href: `/logout` } ]; let showMenu = false; @@ -115,6 +115,8 @@ {/each} +
+ Coinos
-- cgit v1.2.3 From b466b3d39c3b9ec792ef924c7f4750fb70b6a016 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 15 Nov 2023 23:02:29 -0800 Subject: prefill register page --- package.json | 4 +- pnpm-lock.yaml | 16 ++ src/components/AppHeader.svelte | 193 ++++++++-------- src/components/Avatar.svelte | 2 +- src/lib/punks.js | 66 ++++++ src/lib/upload.js | 3 +- src/locales/en.json | 2 +- src/routes/(app)/+layout.svelte | 2 +- .../(app)/[username]/(profile)/+layout.svelte | 36 +-- src/routes/(app)/[username]/(profile)/+page.svelte | 8 +- .../[username]/settings/[...tab]/+page.svelte | 28 ++- .../[username]/settings/[...tab]/_account.svelte | 6 +- .../(app)/[username]/settings/[...tab]/_pos.svelte | 4 +- .../[username]/settings/[...tab]/_security.svelte | 2 +- src/routes/(app)/register/+page.server.js | 29 ++- src/routes/(app)/register/+page.svelte | 245 ++++++++++++++++++++- src/routes/+layout.svelte | 3 + src/routes/+page.server.js | 1 + src/routes/+page.svelte | 109 ++++----- static/icons/upload.svg | 4 + 20 files changed, 576 insertions(+), 187 deletions(-) create mode 100644 src/lib/punks.js create mode 100644 static/icons/upload.svg (limited to 'src/components/AppHeader.svelte') diff --git a/package.json b/package.json index 2063fb63..911e287f 100644 --- a/package.json +++ b/package.json @@ -52,10 +52,12 @@ }, "type": "module", "dependencies": { + "@faker-js/faker": "^8.2.0", "@scure/bip39": "^1.2.1", "html2canvas": "^1.4.1", "leaflet-tooltip-layout": "^0.1.2", "maplibre-gl": "^3.3.1", - "uint8array-extras": "^0.5.0" + "uint8array-extras": "^0.5.0", + "unique-names-generator": "^4.7.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c6490728..1463027a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,9 @@ settings: excludeLinksFromLockfile: false dependencies: + '@faker-js/faker': + specifier: ^8.2.0 + version: 8.2.0 '@scure/bip39': specifier: ^1.2.1 version: 1.2.1 @@ -20,6 +23,9 @@ dependencies: uint8array-extras: specifier: ^0.5.0 version: 0.5.0 + unique-names-generator: + specifier: ^4.7.1 + version: 4.7.1 devDependencies: '@scure/base': @@ -319,6 +325,11 @@ packages: dev: true optional: true + /@faker-js/faker@8.2.0: + resolution: {integrity: sha512-VacmzZqVxdWdf9y64lDOMZNDMM/FQdtM9IsaOPKOm2suYwEatb8VkdHqOzXcDnZbk7YDE2BmsJmy/2Hmkn563g==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0, npm: '>=6.14.13'} + dev: false + /@jridgewell/sourcemap-codec@1.4.14: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} dev: true @@ -2011,6 +2022,11 @@ packages: set-value: 2.0.1 dev: false + /unique-names-generator@4.7.1: + resolution: {integrity: sha512-lMx9dX+KRmG8sq6gulYYpKWZc9RlGsgBR6aoO8Qsm3qvkSJ+3rAymr+TnV8EDMrIrwuFJ4kruzMWM/OpYzPoow==} + engines: {node: '>=8'} + dev: false + /update-browserslist-db@1.0.10(browserslist@4.21.4): resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} hasBin: true diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index a37a834e..123606e1 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -3,7 +3,7 @@ import { banner, newPayment, colorTheme } from '$lib/store'; import { goto } from '$app/navigation'; import { Avatar, Icon } from '$comp'; - import { t } from '$lib/translations'; + import { loading, t } from '$lib/translations'; import { page } from '$app/stores'; export let data; @@ -28,112 +28,115 @@ $banner?.id && $banner.id === subject.id ? `url(${$banner.src})` : subject?.banner - ? `url(/api/public/${subject.id}-banner.webp)` + ? `url(/api/public/${subject.banner}.webp)` : undefined; $: $page && (showMenu = false); -
-
- {:else} - - - - {/if} - -
- -
- + + {/if} + +
+ +
+ +{/if} diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index 7f4e3c7b..3422d358 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -10,8 +10,6 @@ import { warning, protectedRoutes } from '$lib/utils'; import { t, locale } from '$lib/translations'; - const localeLocalStorageKey = 'sveltekit-i18n-locale'; - export let data; let { rate, user, subject, token, rates } = data; @@ -22,6 +20,7 @@ }; onMount(async () => { + let localeLocalStorageKey = 'sveltekit-i18n-locale'; let localStorageLocale = localStorage.getItem(localeLocalStorageKey); if (localStorageLocale) locale.set(localStorageLocale); @@ -32,7 +31,7 @@ if (browser) { let log = console.log; checkSocket(); - expireTimer = setTimeout(expirePin, user.locktime * 1000 || 300000); + expireTimer = setTimeout(expirePin, user.locktime * 1000 || 300000); // if (window.NDEFReader) { // try { diff --git a/src/routes/(app)/[username]/+layout.svelte b/src/routes/(app)/[username]/+layout.svelte index b2efa894..54fcd600 100644 --- a/src/routes/(app)/[username]/+layout.svelte +++ b/src/routes/(app)/[username]/+layout.svelte @@ -1,7 +1,57 @@ - +
+ +
+ + diff --git a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte index a3afce62..933fa1f6 100644 --- a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte +++ b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte @@ -121,6 +121,10 @@ } } + if (user.email !== prev.email) { + await post('/api/verify', { test: true }); + } + const response = await fetch(formElement.action, { method: 'POST', body: data @@ -156,20 +160,22 @@
-

- {$t('user.settings.header')} -

- -
- {#each tabs.filter((t) => t.name !== 'shopify') as { name, key }} - - - - {/each} +
+

+ {$t('user.settings.header')} +

+ +
+ {#each tabs.filter((t) => t.name !== 'shopify') as { name, key }} + + + + {/each} +
@@ -192,3 +198,9 @@
+ + -- cgit v1.2.3 From 216a600224fde22ce76b367557a02094ec693886 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 1 Dec 2023 20:04:13 -0800 Subject: prettier --- .prettierrc | 6 +- doc/i18n-technical.md | 10 +- docker-compose.yml | 16 +- postcss.config.cjs | 8 +- src/app.css | 33 +- src/app.html | 27 +- src/components/404.svelte | 20 +- src/components/About.svelte | 131 +- src/components/AppHeader.svelte | 276 +- src/components/Avatar.svelte | 44 +- src/components/Balance.svelte | 48 +- src/components/Calendar.svelte | 22 +- src/components/Card.svelte | 22 +- src/components/Check.svelte | 18 +- src/components/Code.svelte | 42 +- src/components/Event.svelte | 147 +- src/components/FaqCard.svelte | 18 +- src/components/Feed.svelte | 124 +- src/components/Footer.svelte | 121 +- src/components/Heart.svelte | 26 +- src/components/HowItWorksCard.svelte | 18 +- src/components/Icon.svelte | 4 +- src/components/Image.svelte | 4 +- src/components/Invoice.svelte | 61 +- src/components/LandingHeader.svelte | 230 +- src/components/LandingHero.svelte | 63 +- src/components/LandingInfoCard.svelte | 46 +- src/components/Left.svelte | 26 +- src/components/Lnurlp.svelte | 104 +- src/components/Lnurlw.svelte | 103 +- src/components/LoadingSplash.svelte | 4 +- src/components/LocaleSelector.svelte | 20 +- src/components/LocationsMap.svelte | 546 ++-- src/components/Lock.svelte | 22 +- src/components/Numpad.svelte | 445 ++-- src/components/Password.svelte | 144 +- src/components/Pin.svelte | 112 +- src/components/Pinpad.svelte | 144 +- src/components/Popup.svelte | 66 +- src/components/Qr.svelte | 16 +- src/components/Quote.svelte | 18 +- src/components/RegisterOrLogin.svelte | 322 +-- src/components/Request.svelte | 56 +- src/components/Slider.svelte | 90 +- src/components/Spinner.svelte | 27 +- src/components/Toggle.svelte | 18 +- src/components/index.js | 80 +- src/lib/english.js | 2 +- src/lib/invoice.js | 67 +- src/lib/nostr.js | 230 +- src/lib/punks.js | 128 +- src/lib/samples.js | 26 +- src/lib/socket.js | 122 +- src/lib/store.js | 66 +- src/lib/ticket.js | 50 +- src/lib/tickets.js | 100 +- src/lib/translations/index.js | 111 +- src/lib/translations/lang.json | 16 +- src/lib/upload.js | 32 +- src/lib/utils.js | 418 +-- src/locales/de.json | 594 ++--- src/locales/el.json | 590 ++--- src/locales/en.json | 542 ++-- src/locales/es.json | 494 ++-- src/locales/fa.json | 560 ++-- src/locales/fr.json | 620 ++--- src/locales/pt.json | 530 ++-- src/locales/zh.json | 576 ++--- src/params/uuid.js | 2 +- src/routes/(app)/+error.svelte | 58 +- src/routes/(app)/+layout.server.js | 86 +- src/routes/(app)/+layout.svelte | 297 +-- .../(app)/[username]/(profile)/+layout.server.js | 36 +- .../(app)/[username]/(profile)/+layout.svelte | 466 ++-- .../(app)/[username]/(profile)/+page.server.js | 52 +- src/routes/(app)/[username]/(profile)/+page.svelte | 462 ++-- .../(profile)/event/[id]/+page.server.js | 18 +- .../[username]/(profile)/event/[id]/+page.svelte | 6 +- .../[username]/(profile)/followers/+page.svelte | 81 +- .../[username]/(profile)/follows/+page.svelte | 78 +- .../[username]/(profile)/request/+page.server.js | 22 +- .../[username]/(profile)/request/+page.svelte | 50 +- .../[username]/(profile)/request/sent/+page.svelte | 21 +- src/routes/(app)/[username]/+layout.server.js | 18 +- src/routes/(app)/[username]/+layout.svelte | 96 +- .../(app)/[username]/address/+page.server.js | 14 +- .../(app)/[username]/card/[serial]/+page.server.js | 22 +- .../(app)/[username]/card/[serial]/+page.svelte | 60 +- src/routes/(app)/[username]/funds/+page.svelte | 83 +- src/routes/(app)/[username]/generate/+page.svelte | 110 +- src/routes/(app)/[username]/generate/+server.js | 16 +- src/routes/(app)/[username]/invoice/+server.js | 8 +- .../[username]/invoice/[id]/+layout.server.js | 52 +- .../(app)/[username]/invoice/[id]/+page.server.js | 4 +- .../(app)/[username]/invoice/[id]/+page.svelte | 442 ++-- .../[username]/invoice/[id]/paid/+page.svelte | 108 +- .../[username]/invoice/[id]/tip/+page.server.js | 11 +- .../(app)/[username]/invoice/[id]/tip/+page.svelte | 386 +-- .../(app)/[username]/invoice/sent/+page.svelte | 8 +- src/routes/(app)/[username]/map/+page.server.js | 12 +- src/routes/(app)/[username]/map/+page.svelte | 6 +- .../(app)/[username]/messages/+page.server.js | 31 +- src/routes/(app)/[username]/messages/+page.svelte | 335 +-- .../[username]/payments/[...page]/+page.server.js | 30 +- .../[username]/payments/[...page]/+page.svelte | 514 ++-- .../(app)/[username]/payments/[...page]/+server.js | 22 +- .../[username]/receive/[...param]/+page.server.js | 14 +- .../[username]/receive/[...param]/+page.svelte | 82 +- .../(app)/[username]/request/[id]/+page.server.js | 35 +- .../(app)/[username]/request/[id]/+page.svelte | 85 +- src/routes/(app)/[username]/reset/+server.js | 14 +- .../[username]/settings/[...tab]/+page.server.js | 31 +- .../[username]/settings/[...tab]/+page.svelte | 400 +-- .../[username]/settings/[...tab]/_account.svelte | 342 +-- .../(app)/[username]/settings/[...tab]/_pos.svelte | 84 +- .../[username]/settings/[...tab]/_security.svelte | 561 ++-- .../[username]/settings/[...tab]/_shopify.svelte | 129 +- src/routes/(app)/[username]/shopify.js/+server.js | 14 +- src/routes/(app)/admin/+layout.server.js | 14 +- src/routes/(app)/admin/+layout.svelte | 8 +- src/routes/(app)/admin/+page.server.js | 14 +- src/routes/(app)/admin/+page.svelte | 34 +- src/routes/(app)/buy/+page.server.js | 43 +- src/routes/(app)/buy/+page.svelte | 230 +- src/routes/(app)/disable2fa/+server.js | 18 +- src/routes/(app)/enable2fa/+server.js | 8 +- src/routes/(app)/events/+server.js | 6 +- src/routes/(app)/fund/[id]/+page.server.js | 28 +- src/routes/(app)/fund/[id]/+page.svelte | 256 +- src/routes/(app)/fund/[id]/sweep/+page.server.js | 17 +- src/routes/(app)/fund/[id]/sweep/+page.svelte | 54 +- .../(app)/fund/[id]/withdraw/+page.server.js | 26 +- src/routes/(app)/fund/[id]/withdraw/+page.svelte | 94 +- src/routes/(app)/fund/[id]/withdraw/+server.js | 6 +- src/routes/(app)/launch/+page.server.js | 6 +- src/routes/(app)/launch/+page.svelte | 187 +- src/routes/(app)/launch/purchase/+page.server.js | 68 +- src/routes/(app)/launch/purchase/+page.svelte | 114 +- .../(app)/launch/purchase/card/+page.server.js | 88 +- src/routes/(app)/launch/purchase/card/+page.svelte | 134 +- .../(app)/launch/thanks/[asset]/+page.svelte | 40 +- src/routes/(app)/launch/ticket/+page.server.js | 14 +- src/routes/(app)/launch/ticket/+page.svelte | 56 +- src/routes/(app)/ln/[lnurl]/+page.server.js | 118 +- src/routes/(app)/ln/[lnurl]/+page.svelte | 14 +- src/routes/(app)/ln/withdrawal/sent/+page.svelte | 31 +- src/routes/(app)/locations/+server.js | 20 +- src/routes/(app)/login/+page.server.js | 36 +- src/routes/(app)/login/+page.svelte | 20 +- src/routes/(app)/logout/+page.server.js | 12 +- src/routes/(app)/otpsecret/+server.js | 26 +- src/routes/(app)/password/+server.js | 8 +- src/routes/(app)/payment/[id]/+page.server.js | 6 +- src/routes/(app)/payment/[id]/+page.svelte | 289 ++- .../(app)/payment/[id]/plain/+page.server.js | 6 +- src/routes/(app)/payment/[id]/plain/+page.svelte | 132 +- src/routes/(app)/payment/[id]/print/+server.js | 8 +- src/routes/(app)/pin/+server.js | 8 +- src/routes/(app)/qr/[text]/+page.server.js | 8 +- src/routes/(app)/qr/[text]/+page.svelte | 18 +- .../(app)/redeem/[redeemcode]/+page.server.js | 24 +- src/routes/(app)/redeem/[redeemcode]/+page.svelte | 4 +- src/routes/(app)/register/+page.server.js | 67 +- src/routes/(app)/register/+page.svelte | 582 +++-- src/routes/(app)/scan/+page.svelte | 63 +- src/routes/(app)/send/+layout.svelte | 14 +- src/routes/(app)/send/[...text]/+page.server.js | 182 +- src/routes/(app)/send/[...text]/+page.svelte | 212 +- .../bitcoin/[address]/[...amount]/+page.server.js | 45 +- .../bitcoin/[address]/[...amount]/+page.svelte | 279 +- .../send/fund/[name]/[...amount]/+page.server.js | 24 +- .../send/fund/[name]/[...amount]/+page.svelte | 94 +- src/routes/(app)/send/invoice/[id]/+page.server.js | 65 +- src/routes/(app)/send/invoice/[id]/+page.svelte | 300 +-- .../(app)/send/lightning/[payreq]/+page.server.js | 30 +- .../(app)/send/lightning/[payreq]/+page.svelte | 181 +- .../user/[username]/[...amount]/+page.server.js | 81 +- .../send/user/[username]/[...amount]/+page.svelte | 166 +- src/routes/(app)/sent/+page.server.js | 6 +- src/routes/(app)/sent/+page.svelte | 73 +- src/routes/(app)/support/+page.svelte | 214 +- src/routes/(app)/support/+server.js | 8 +- src/routes/(app)/withdraw/+server.js | 11 +- src/routes/(static)/+layout.server.js | 22 +- src/routes/(static)/+layout.svelte | 10 +- src/routes/(static)/bounties/+page.svelte | 174 +- src/routes/(static)/docs/+page.server.js | 4 +- src/routes/(static)/docs/+page.svelte | 241 +- src/routes/+layout.server.js | 26 +- src/routes/+layout.svelte | 57 +- src/routes/+page.server.js | 2 +- src/routes/+page.svelte | 216 +- src/routes/about/+server.js | 4 +- src/routes/map/+page.server.js | 12 +- src/routes/map/+page.svelte | 22 +- static/lottie/success.json | 2660 +++++++++---------- static/manifest.webmanifest | 72 +- static/qr.js | 2698 ++++++++++---------- static/shopify.html | 267 +- svelte.config.js | 35 +- tailwind.config.cjs | 28 +- vite.config.js | 32 +- 202 files changed, 14108 insertions(+), 13258 deletions(-) (limited to 'src/components/AppHeader.svelte') diff --git a/.prettierrc b/.prettierrc index 4d33dfc8..98ddc618 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,7 +1,3 @@ { - "useTabs": true, - "singleQuote": true, - "trailingComma": "none", - "printWidth": 100, - "plugins": ["./node_modules/prettier-plugin-svelte"] + "plugins": ["./node_modules/prettier-plugin-svelte"] } diff --git a/doc/i18n-technical.md b/doc/i18n-technical.md index 3f6a09d5..6aed2068 100644 --- a/doc/i18n-technical.md +++ b/doc/i18n-technical.md @@ -23,11 +23,11 @@ Each locale in `coinos-ui-v2` is defined by a JSON file in `src/locales`. Its na ```json { - "howItWorks": "How it works", - "faq": "FAQ", - "about": "About", - "startInSeconds": "Start in Seconds", - "signIn": "Sign In" + "howItWorks": "How it works", + "faq": "FAQ", + "about": "About", + "startInSeconds": "Start in Seconds", + "signIn": "Sign In" } ``` diff --git a/docker-compose.yml b/docker-compose.yml index 7e6e4e61..e40cf483 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.6' +version: "3.6" services: v2: container_name: v2 @@ -6,18 +6,18 @@ services: context: . dockerfile: Dockerfile.dev args: - URL: '${PUBLIC_COINOS_URL}' - BTC: '${PUBLIC_BTC}' - SOCKET: '${PUBLIC_SOCKET}' + URL: "${PUBLIC_COINOS_URL}" + BTC: "${PUBLIC_BTC}" + SOCKET: "${PUBLIC_SOCKET}" restart: always ports: - - '3121:3121' + - "3121:3121" environment: NODE_ENV: production - ORIGIN: '${ORIGIN}' + ORIGIN: "${ORIGIN}" PORT: 3121 - STRIPE: '${STRIPE}' - LAUNCH: '${LAUNCH}' + STRIPE: "${STRIPE}" + LAUNCH: "${LAUNCH}" extra_hosts: - host.docker.internal:host-gateway networks: diff --git a/postcss.config.cjs b/postcss.config.cjs index 054c147c..12a703d9 100644 --- a/postcss.config.cjs +++ b/postcss.config.cjs @@ -1,6 +1,6 @@ module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {} - } + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, }; diff --git a/src/app.css b/src/app.css index 3a722fb1..ba1db128 100644 --- a/src/app.css +++ b/src/app.css @@ -3,39 +3,40 @@ @tailwind utilities; @font-face { - font-family: 'PublicSans'; - src: url('/fonts/Public_Sans/static/PublicSans-Regular.ttf') format('truetype'); + font-family: "PublicSans"; + src: url("/fonts/Public_Sans/static/PublicSans-Regular.ttf") + format("truetype"); } html { - font-family: PublicSans, sans-serif; + font-family: PublicSans, sans-serif; } ::selection { - color: black; - background: #eaf2ff; + color: black; + background: #eaf2ff; } :fullscreen { - background-color: white; + background-color: white; } input, textarea { - @apply block border rounded-2xl px-5 py-4 w-full; + @apply block border rounded-2xl px-5 py-4 w-full; } button.primary { - @apply rounded-full border py-2 font-bold my-4 flex px-4 bg-white mx-auto hover:opacity-80; + @apply rounded-full border py-2 font-bold my-4 flex px-4 bg-white mx-auto hover:opacity-80; } .select-styles { - @apply border rounded-2xl py-4 px-5; - cursor: pointer; - -webkit-appearance: none; - -moz-appearance: none; - background: transparent; - background-repeat: no-repeat; - background-position-x: 95%; - background-position-y: 1em; + @apply border rounded-2xl py-4 px-5; + cursor: pointer; + -webkit-appearance: none; + -moz-appearance: none; + background: transparent; + background-repeat: no-repeat; + background-position-x: 95%; + background-position-y: 1em; } diff --git a/src/app.html b/src/app.html index c0b7b4c1..28f07d06 100644 --- a/src/app.html +++ b/src/app.html @@ -1,15 +1,18 @@ - - - - - - - - %sveltekit.head% - - -
%sveltekit.body%
- + + + + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ diff --git a/src/components/404.svelte b/src/components/404.svelte index 08323d40..d831a40a 100644 --- a/src/components/404.svelte +++ b/src/components/404.svelte @@ -1,17 +1,17 @@
-
- - - +
+ + + - + -

{$t('404.404')}

-

{$t('404.pageNotFound')}

-
+

{$t("404.404")}

+

{$t("404.pageNotFound")}

+
diff --git a/src/components/About.svelte b/src/components/About.svelte index 1dbd8038..6e0cdcb5 100644 --- a/src/components/About.svelte +++ b/src/components/About.svelte @@ -1,7 +1,7 @@
-
-

- {$t('about.team.header')} -

-
- {#each team as member} -
-
-
- +
+

+ {$t("about.team.header")} +

+
+ {#each team as member} +
+
+
+ -
- {$t(`about.team.${member.name}.name`)} - {$t(`about.team.${member.name}.position`)} -
+
+ {$t(`about.team.${member.name}.name`)} + {$t(`about.team.${member.name}.position`)} +
-
- {#each member.socials as social} - - {/each} -
-
-
- {$t(`about.team.${member.name}.bio`)} -
-
-
- {/each} -
-
+
+ {#each member.socials as social} + + {/each} +
+
+
+ {$t(`about.team.${member.name}.bio`)} +
+
+
+ {/each} +
+
{#if locations?.length} -
-

{$t('about.locations.header')}

-

- {@html $t('about.locations.description')} -

- -
+
+

+ {$t("about.locations.header")} +

+

+ {@html $t("about.locations.description")} +

+ +
{/if} diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index 53b31de4..2f088eec 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -1,149 +1,159 @@ {#if !$loading} -
- +
+ +
+
{/if} diff --git a/src/components/Avatar.svelte b/src/components/Avatar.svelte index b258a0e8..3955a42f 100644 --- a/src/components/Avatar.svelte +++ b/src/components/Avatar.svelte @@ -1,29 +1,31 @@ -
- {user.username} -
+
+ {user.username} +
diff --git a/src/components/Balance.svelte b/src/components/Balance.svelte index 0e4f2ec2..92714f98 100644 --- a/src/components/Balance.svelte +++ b/src/components/Balance.svelte @@ -1,34 +1,34 @@ {#if show && user.haspin && $pin?.length !== 6} - (show = false)} /> + (show = false)} /> {/if}
- {#if user.haspin && !$pin} - - {:else} -
- {#if isNaN($animatedRate)} -
—
- {:else} - {f((user.balance * $animatedRate) / sats, user.currency)} - {/if} -
+ {#if user.haspin && !$pin} + + {:else} +
+ {#if isNaN($animatedRate)} +
—
+ {:else} + {f((user.balance * $animatedRate) / sats, user.currency)} + {/if} +
-
- ⚡️{s(user.balance)} -
- {/if} +
+ ⚡️{s(user.balance)} +
+ {/if}
diff --git a/src/components/Calendar.svelte b/src/components/Calendar.svelte index 7504f48e..b07c136c 100644 --- a/src/components/Calendar.svelte +++ b/src/components/Calendar.svelte @@ -1,14 +1,14 @@ - + diff --git a/src/components/Card.svelte b/src/components/Card.svelte index 44ab635f..864465c0 100644 --- a/src/components/Card.svelte +++ b/src/components/Card.svelte @@ -1,14 +1,14 @@ - + diff --git a/src/components/Check.svelte b/src/components/Check.svelte index 4c9f504b..222c4dea 100644 --- a/src/components/Check.svelte +++ b/src/components/Check.svelte @@ -1,11 +1,11 @@ diff --git a/src/components/Code.svelte b/src/components/Code.svelte index ffca98a4..6c1048cf 100644 --- a/src/components/Code.svelte +++ b/src/components/Code.svelte @@ -1,27 +1,31 @@ -
-
-
{samples[sample]}
-
- +
+
+
{samples[sample]}
+
+
diff --git a/src/components/Event.svelte b/src/components/Event.svelte index 68f44589..2312f44e 100644 --- a/src/components/Event.svelte +++ b/src/components/Event.svelte @@ -1,84 +1,87 @@ -
- -
-
- -
- -
-
+
+ +
+
+ +
+ +
+
-
-
-
- {user.display_name || ''} - @{user.username} -
-
 {distance(seen)}
-
-
- {content} -
+
+
+
+ {user.display_name || ""} + @{user.username} +
+
 {distance(seen)}
+
+
+ {content} +
-
-
- -
444
-
-
- -
1072
-
-
- -
26
-
-
- -
4
-
-
-
+
+
+ +
444
+
+
+ +
1072
+
+
+ +
26
+
+
+ +
4
+
+
+
diff --git a/src/components/FaqCard.svelte b/src/components/FaqCard.svelte index 918e03d6..ae1ad077 100644 --- a/src/components/FaqCard.svelte +++ b/src/components/FaqCard.svelte @@ -1,15 +1,15 @@
-

{$t('faq.' + questionID + '.question')}

-

- {$t('faq.' + questionID + '.answer')} -

+

{$t("faq." + questionID + ".question")}

+

+ {$t("faq." + questionID + ".answer")} +

diff --git a/src/components/Feed.svelte b/src/components/Feed.svelte index 7de087a7..0c9c96d1 100644 --- a/src/components/Feed.svelte +++ b/src/components/Feed.svelte @@ -1,72 +1,84 @@ {#if user} -
-
- -
- -
+
+
+ +
+ +
{/if} {#if browser} - {#if sorted.length} - - - - - - {:else} -
-
{$t('user.noNotes')}
-
- {/if} + {#if sorted.length} + + + + + + {:else} +
+
{$t("user.noNotes")}
+
+ {/if} {/if} diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte index eda26526..c1ac79cf 100644 --- a/src/components/Footer.svelte +++ b/src/components/Footer.svelte @@ -1,65 +1,74 @@ -