From 2d7bceed00db1c76d5cbc95ec2a7fc9b532d9dec Mon Sep 17 00:00:00 2001 From: Fornax Date: Fri, 15 Sep 2023 18:10:35 +0200 Subject: [PATCH] Add separate tabs for mollie and crypto payents --- svelte/src/home_page/FeatureTable.svelte | 28 +++---- svelte/src/home_page/HomePage.svelte | 1 - svelte/src/user_home/DepositCredit.svelte | 84 +++++++++++++------ .../src/user_home/HotlinkProgressBar.svelte | 7 +- 4 files changed, 75 insertions(+), 45 deletions(-) diff --git a/svelte/src/home_page/FeatureTable.svelte b/svelte/src/home_page/FeatureTable.svelte index e73c67b..e834dfd 100644 --- a/svelte/src/home_page/FeatureTable.svelte +++ b/svelte/src/home_page/FeatureTable.svelte @@ -57,21 +57,25 @@ onMount(() => {
- Download limit + Downloading
10 GB per day
- Download speed is reduced to 1 MiB/s when exceeded + + Download speed is reduced to 1 MiB/s when exceeded. Max 3 concurrent + downloads
2 TB per month
- Transfer limit is used for downloading, sharing and hotlinking files + + Transfer limit is used for downloading, sharing and hotlinking. No + connection limit
€2 per TB transferred
- Used for downloading, sharing and hotlinking files. You only pay for - what you use + Used for downloading, sharing and hotlinking. You only pay for what + you use. No connection limit
@@ -82,7 +86,7 @@ onMount(() => {
Only image files below 1 MB in size + class="bold">1 MB in size can be hotlinked
Any file type
@@ -94,7 +98,7 @@ onMount(() => {
No limit
- But files expire when they are not downloaded + Files expire when they are not downloaded
€4 / TB / month
@@ -345,7 +349,6 @@ header { background-position: center; background-size: cover; background-blend-mode: normal; - box-shadow: inset 0 0 10px -4px var(--shadow_color); } header > h1 { margin-top: 60px; @@ -369,9 +372,9 @@ header > h1 { grid-auto-flow: row; grid-template-columns: 9em 1fr 1fr 1fr; min-width: 40em; - max-width: 65em; - gap: 6px; - margin: 12px; + max-width: 70em; + gap: 5px; + margin: 10px; } .grid > div { justify-content: center; @@ -415,7 +418,4 @@ header > h1 { .span3 { grid-column: span 3; } -.vspan2 { - grid-row: span 2; -} diff --git a/svelte/src/home_page/HomePage.svelte b/svelte/src/home_page/HomePage.svelte index 0ac708f..d368eb7 100644 --- a/svelte/src/home_page/HomePage.svelte +++ b/svelte/src/home_page/HomePage.svelte @@ -74,7 +74,6 @@ header { background-position: center; background-size: cover; background-blend-mode: normal; - box-shadow: inset 0 0 10px -4px var(--shadow_color); } header > h1 { margin-top: 60px; diff --git a/svelte/src/user_home/DepositCredit.svelte b/svelte/src/user_home/DepositCredit.svelte index 3903ea5..8da0b10 100644 --- a/svelte/src/user_home/DepositCredit.svelte +++ b/svelte/src/user_home/DepositCredit.svelte @@ -7,6 +7,7 @@ import MollieDeposit from "./MollieDeposit.svelte"; let loading = false let credit_amount = 10 +let tab = "mollie" const checkout = async (network = "", amount = 0, country = "") => { loading = true @@ -40,6 +41,7 @@ const checkout = async (network = "", amount = 0, country = "") => { } let invoices = [] +let unpaid_invoice = false const load_invoices = async () => { loading = true try { @@ -49,8 +51,13 @@ const load_invoices = async () => { } let invoices_tmp = await resp.json() + unpaid_invoice = false invoices_tmp.forEach(row => { row.time = new Date(row.time) + + if (row.payment_method === "mollie" && row.status === "open") { + unpaid_invoice = true + } }) invoices_tmp.sort((a, b) => { return b.time - a.time @@ -80,36 +87,59 @@ onMount(() => { transfer.

- - -

Crypto payments

-

- Alternatively you can use Bitcoin, Lightning network (node info) and Dogecoin to deposit - credits on your pixeldrain account. You must pay the full amount as - stated on the invoice, else your payment will fail. -

-

- Do note that it is not possible to withdraw coins from your - pixeldrain account. It's not a wallet. Any amount of money you - deposit has to be used up. -

-
- Deposit amount € - -
- Choose payment method:
- - -
+ {#if tab === "mollie"} + {#if unpaid_invoice} +
+

+ You still have an unpaid invoice open. Please pay that one + before requesting a new invoice. You can find unpaid + invoices at the bottom of this page. You can cancel an + invoice by clicking Pay, and then clicking the Back link at + the bottom of the page. +

+
+ {:else} + + {/if} + {:else if tab === "btcpay"} +
+

+ Alternatively you can use Bitcoin, Lightning network (node info) and Dogecoin to deposit + credits on your pixeldrain account. You must pay the full amount as + stated on the invoice, else your payment will fail. +

+

+ Do note that it is not possible to withdraw coins from your + pixeldrain account. It's not a wallet. Any amount of money you + deposit has to be used up. +

+ Deposit amount € + +
+ Choose payment method:
+ + + +
+ {/if}

Past invoices

diff --git a/svelte/src/user_home/HotlinkProgressBar.svelte b/svelte/src/user_home/HotlinkProgressBar.svelte index e32c10d..43c2753 100644 --- a/svelte/src/user_home/HotlinkProgressBar.svelte +++ b/svelte/src/user_home/HotlinkProgressBar.svelte @@ -34,9 +34,10 @@ $: frac = used / total

You have used {(frac*100).toFixed(0)}% of your data cap. If your - data runs out people won't be able to download your files directly - from the API anymore, ads will be shown on the file viewer and - transfer rates will be limited. + data runs out the premium features related to downloading will be + disabled. This means that the download page shows pixeldrain + branding, people who download your files have a daily download limit + and hotlinking is disabled.

{#if window.user.monthly_transfer_cap > 0}