From 21ef35ea20bb2a892fe06b45f39bf801f18e2985 Mon Sep 17 00:00:00 2001 From: wukko Date: Fri, 9 Aug 2024 14:35:55 +0600 Subject: [PATCH] web/donate: add a share card with qr and buttons also: - fixed more scaling quirks - fixed thick icons - fixed icon padding --- web/i18n/en/donate.json | 4 +- .../donate/DonateCardContainer.svelte | 3 +- .../donate/DonateOptionsCard.svelte | 29 +++- .../components/donate/DonateShareCard.svelte | 164 ++++++++++++++++++ .../components/donate/DonationOption.svelte | 1 + web/src/lib/env.ts | 7 +- web/src/lib/icons/CobaltQR.svelte | 4 + web/src/routes/donate/+page.svelte | 8 +- 8 files changed, 209 insertions(+), 11 deletions(-) create mode 100644 web/src/components/donate/DonateShareCard.svelte create mode 100644 web/src/lib/icons/CobaltQR.svelte diff --git a/web/i18n/en/donate.json b/web/i18n/en/donate.json index 09e27130..ef4c6033 100644 --- a/web/i18n/en/donate.json +++ b/web/i18n/en/donate.json @@ -17,5 +17,7 @@ "card.option.15": "full lunch", "card.option.30": "lunch for two", - "card.custom.submit": "donate custom amount" + "card.custom.submit": "donate custom amount", + + "share.title": "share cobalt with a friend" } diff --git a/web/src/components/donate/DonateCardContainer.svelte b/web/src/components/donate/DonateCardContainer.svelte index e69a0da6..1042e6f8 100644 --- a/web/src/components/donate/DonateCardContainer.svelte +++ b/web/src/components/donate/DonateCardContainer.svelte @@ -75,9 +75,10 @@ align-items: center; font-size: 16px; gap: 4px; + font-weight: 500; } - @media screen and (max-width: 550px) { + @media screen and (max-width: 865px) { :global(.donate-card) { --donate-card-main-padding: 18px; } diff --git a/web/src/components/donate/DonateOptionsCard.svelte b/web/src/components/donate/DonateOptionsCard.svelte index 3b3609c7..1b2e5fda 100644 --- a/web/src/components/donate/DonateOptionsCard.svelte +++ b/web/src/components/donate/DonateOptionsCard.svelte @@ -62,9 +62,11 @@ role="tab" >
- - @@ -133,7 +137,7 @@ diff --git a/web/src/components/donate/DonationOption.svelte b/web/src/components/donate/DonationOption.svelte index 0e2b262e..3486e7b0 100644 --- a/web/src/components/donate/DonationOption.svelte +++ b/web/src/components/donate/DonationOption.svelte @@ -22,6 +22,7 @@ .donation-option :global(svg) { width: 20px; height: 20px; + stroke-width: 1.8px; } @media screen and (max-width: 550px) { diff --git a/web/src/lib/env.ts b/web/src/lib/env.ts index 3334ebf3..26cc1fff 100644 --- a/web/src/lib/env.ts +++ b/web/src/lib/env.ts @@ -7,6 +7,11 @@ const variables = { DEFAULT_API: env.PUBLIC_DEFAULT_API, } +const contacts = { + github: "https://github.com/imputnet/cobalt", + twitter: "https://x.com/justusecobalt", +} + const donate = { stripe: 'https://donate.stripe.com/3cs2cc6ew1Qda4wbII', liberapay: 'https://liberapay.com/imput/donate', @@ -23,5 +28,5 @@ const donate = { const apiURL = "https://api.cobalt.tools"; -export { donate, apiURL }; +export { donate, apiURL, contacts }; export default variables; diff --git a/web/src/lib/icons/CobaltQR.svelte b/web/src/lib/icons/CobaltQR.svelte new file mode 100644 index 00000000..e1c90e39 --- /dev/null +++ b/web/src/lib/icons/CobaltQR.svelte @@ -0,0 +1,4 @@ + + + + diff --git a/web/src/routes/donate/+page.svelte b/web/src/routes/donate/+page.svelte index dbe61fc7..5c5c6325 100644 --- a/web/src/routes/donate/+page.svelte +++ b/web/src/routes/donate/+page.svelte @@ -5,6 +5,7 @@ import DonateBanner from "$components/donate/DonateBanner.svelte"; import DonateOptionsCard from "$components/donate/DonateOptionsCard.svelte"; + import DonateShareCard from "$components/donate/DonateShareCard.svelte"; @@ -17,6 +18,7 @@
+