From 012e798aed820f4bae423ca95fd6a61a415de788 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Wed, 17 Sep 2025 02:33:53 +0200 Subject: [PATCH] feat: Add notice before showing e-mail (#327) Co-authored-by: Ushie --- src/layout/Banners/StatusBanner.svelte | 4 +- src/layout/Dialogs/EmailDialog.svelte | 65 ++++++++++++++++++++++++++ src/layout/Footer/FooterHost.svelte | 19 ++++++-- src/lib/components/Button.svelte | 2 + 4 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 src/layout/Dialogs/EmailDialog.svelte 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 ed70de5..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; }); + +