diff --git a/src/app.html b/src/app.html index 5266886..1288b4b 100644 --- a/src/app.html +++ b/src/app.html @@ -21,7 +21,7 @@ %sveltekit.head% - +
%sveltekit.body%
diff --git a/src/app.scss b/src/app.scss index bb3da8d..b9045e6 100644 --- a/src/app.scss +++ b/src/app.scss @@ -23,7 +23,6 @@ html { body { margin: 0; padding: 0; - background-color: var(--background-one); } html, diff --git a/src/data/api/settings.ts b/src/data/api/settings.ts index b509d57..bce554c 100644 --- a/src/data/api/settings.ts +++ b/src/data/api/settings.ts @@ -16,8 +16,6 @@ export function api_base_url(): string { if (browser) { const apiUrl = localStorage.getItem(URL_KEY) || default_api_url; - set_about_info(apiUrl); - return apiUrl; } @@ -46,11 +44,11 @@ export function set_api_base_url(url?: string) { localStorage.removeItem(URL_KEY); } else { localStorage.setItem(URL_KEY, url); - set_about_info(url); } + set_about_info(api_base_url()); } -function set_about_info(apiUrl: string) { +export function set_about_info(apiUrl: string) { if (!localStorage.getItem(STATUS_KEY) || !localStorage.getItem(EMAIL_KEY)) { fetch(`${apiUrl}/v4/about`) .then((response) => (response.ok ? response.json() : null)) diff --git a/src/layout/Banners/StatusBanner.svelte b/src/layout/Banners/StatusBanner.svelte index db32556..3dd5921 100644 --- a/src/layout/Banners/StatusBanner.svelte +++ b/src/layout/Banners/StatusBanner.svelte @@ -10,8 +10,8 @@ + import Divider from '$lib/components/Divider.svelte'; + import { email } from '$data/api/settings'; + import Dialog from '$layout/Dialogs/Dialog.svelte'; + import Button from '$lib/components/Button.svelte'; + import Input from '$lib/components/Input.svelte'; + + export let showEmailDialog: boolean; + + let enableInputSeconds = 15; + let keyword: string = ''; + + let interval: NodeJS.Timeout; + function closeDialog() { + showEmailDialog = false; + clearInterval(interval); + enableInputSeconds = 15; + keyword = ''; + } + + $: if (showEmailDialog && !interval && enableInputSeconds != 0) { + interval = setInterval(() => { + if (enableInputSeconds <= 0) { + clearInterval(interval); + return; + } + enableInputSeconds -= 1; + }, 1000); + } + + + + Abuse notice + +

+ This E-Mail address is not for support, help, bug reports or feature requests. It must + have a subject and body and have the keyword 'Reficio' + in either, otherwise your mail will be + ignored. +

+
+ {#if enableInputSeconds == 0} + Enter the keyword, then click "Send". +
+
+ + {:else} + Read above and wait {enableInputSeconds} seconds. + {/if} +
+ + {#if keyword.toLowerCase() === 'reficio'} + + {/if} + + +
+ + diff --git a/src/layout/Footer/FooterHost.svelte b/src/layout/Footer/FooterHost.svelte index f49cbae..09e2d18 100644 --- a/src/layout/Footer/FooterHost.svelte +++ b/src/layout/Footer/FooterHost.svelte @@ -10,18 +10,23 @@ import { RV_DMCA_GUID } from '$env/static/public'; import { onMount } from 'svelte'; import Divider from '$lib/components/Divider.svelte'; - import { email } from '$data/api/settings'; + import Button from '$lib/components/Button.svelte'; + import EmailDialog from '$layout/Dialogs/EmailDialog.svelte'; const aboutQuery = createQuery(queries.about()); let location: string; + let showEmailDialog = false; + onMount(() => { // DMCA Protection Badge location = document.location.href; }); + +