mirror of
https://github.com/ReVanced/revanced-website.git
synced 2026-01-11 05:36:17 +00:00
feat: Add notice before showing e-mail (#327)
Co-authored-by: Ushie <ushiekane@gmail.com>
This commit is contained in:
@@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
<Banner
|
<Banner
|
||||||
title="API service is currently down"
|
title="API service is currently down"
|
||||||
description="Some features of the site might be impacted. If this issue persists, reach out to mailto:{email()}"
|
description="Some features of the site might be impacted. If this issue persists, reach out to {email()}."
|
||||||
buttonText={statusUrl ? 'View status' : undefined}
|
buttonText={statusUrl ? 'Check status' : undefined}
|
||||||
buttonOnClick={statusUrl ? handleClick : undefined}
|
buttonOnClick={statusUrl ? handleClick : undefined}
|
||||||
level="caution"
|
level="caution"
|
||||||
permanent
|
permanent
|
||||||
|
|||||||
65
src/layout/Dialogs/EmailDialog.svelte
Normal file
65
src/layout/Dialogs/EmailDialog.svelte
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Dialog bind:dialogOpen={showEmailDialog} notDismissible>
|
||||||
|
<svelte:fragment slot="title">Abuse notice</svelte:fragment>
|
||||||
|
<svelte:fragment slot="description">
|
||||||
|
<p>
|
||||||
|
This E-Mail address is <b>not</b> for support, help, bug reports or feature requests. It must
|
||||||
|
have a subject and body and have the keyword <span style="user-select: none;">'Reficio'</span>
|
||||||
|
in either, otherwise your mail will be
|
||||||
|
<b>ignored</b>.
|
||||||
|
</p>
|
||||||
|
<br />
|
||||||
|
{#if enableInputSeconds == 0}
|
||||||
|
<span>Enter the keyword, then click "Send".</span>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<Input placeholder="Keyword" type="text" bind:value={keyword}></Input>
|
||||||
|
{:else}
|
||||||
|
<span>Read above and wait <b>{enableInputSeconds}</b> seconds.</span>
|
||||||
|
{/if}
|
||||||
|
</svelte:fragment>
|
||||||
|
<svelte:fragment slot="buttons">
|
||||||
|
{#if keyword.toLowerCase() === 'reficio'}
|
||||||
|
<Button type="text"><a href="mailto:{email()}">Send</a></Button>
|
||||||
|
{/if}
|
||||||
|
<Button type="filled" on:click={closeDialog}>Close</Button>
|
||||||
|
</svelte:fragment>
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: var(--text-four);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -10,18 +10,23 @@
|
|||||||
import { RV_DMCA_GUID } from '$env/static/public';
|
import { RV_DMCA_GUID } from '$env/static/public';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import Divider from '$lib/components/Divider.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());
|
const aboutQuery = createQuery(queries.about());
|
||||||
|
|
||||||
let location: string;
|
let location: string;
|
||||||
|
|
||||||
|
let showEmailDialog = false;
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
// DMCA Protection Badge
|
// DMCA Protection Badge
|
||||||
location = document.location.href;
|
location = document.location.href;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<EmailDialog bind:showEmailDialog />
|
||||||
|
|
||||||
<Divider horizontalPadding={'15px'} />
|
<Divider horizontalPadding={'15px'} />
|
||||||
<footer in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
|
<footer in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
|
||||||
<div class="top">
|
<div class="top">
|
||||||
@@ -60,8 +65,16 @@
|
|||||||
|
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<div id="logo-name"><span>Re</span>Vanced</div>
|
<div id="logo-name"><span>Re</span>Vanced</div>
|
||||||
<a href="/donate"><div>Donate</div></a>
|
<Button type="text" style="color: var(--text-four); font-weight: 600;">
|
||||||
<a href="mailto:{email()}"><div>Email</div></a>
|
<a href="/donate">Donate</a>
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="text"
|
||||||
|
style="color: var(--text-four); font-weight: 600;"
|
||||||
|
on:click={() => (showEmailDialog = true)}
|
||||||
|
>
|
||||||
|
E-Mail
|
||||||
|
</Button>
|
||||||
<!-- DMCA Protection Badge -->
|
<!-- DMCA Protection Badge -->
|
||||||
<a
|
<a
|
||||||
href="//www.dmca.com/Protection/Status.aspx?ID={RV_DMCA_GUID}&refurl={location}"
|
href="//www.dmca.com/Protection/Status.aspx?ID={RV_DMCA_GUID}&refurl={location}"
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
export let label: string = '';
|
export let label: string = '';
|
||||||
export let disabled: boolean = false;
|
export let disabled: boolean = false;
|
||||||
export let toolTipText: string | undefined = undefined;
|
export let toolTipText: string | undefined = undefined;
|
||||||
|
export let style: string = '';
|
||||||
|
|
||||||
$: type = $$slots.default ? type : 'icon';
|
$: type = $$slots.default ? type : 'icon';
|
||||||
</script>
|
</script>
|
||||||
@@ -26,6 +27,7 @@
|
|||||||
<button
|
<button
|
||||||
on:click
|
on:click
|
||||||
class={`${type} ${variant}`}
|
class={`${type} ${variant}`}
|
||||||
|
style="{style}"
|
||||||
class:disabled
|
class:disabled
|
||||||
aria-label={label}
|
aria-label={label}
|
||||||
type={functionType}
|
type={functionType}
|
||||||
|
|||||||
Reference in New Issue
Block a user