diff --git a/src/layout/Navbar/NavHost.svelte b/src/layout/Navbar/NavHost.svelte index 57a1127..430bb44 100644 --- a/src/layout/Navbar/NavHost.svelte +++ b/src/layout/Navbar/NavHost.svelte @@ -125,11 +125,12 @@ -
- - -
+ + + + + + + diff --git a/src/routes/+error.svelte b/src/routes/+error.svelte index 1fffd5e..ffc5ea3 100644 --- a/src/routes/+error.svelte +++ b/src/routes/+error.svelte @@ -14,7 +14,7 @@ {#if status == 404}

This page received a cease and desist letter from a multi-billion dollar tech company.


- + {:else}

{$page.error?.message} diff --git a/src/routes/download/+page.svelte b/src/routes/download/+page.svelte index 48d0c1a..160ed06 100644 --- a/src/routes/download/+page.svelte +++ b/src/routes/download/+page.svelte @@ -12,22 +12,79 @@ import Button from '$lib/components/Button.svelte'; import Footer from '$layout/Footer.svelte'; import Picture from '$lib/components/Picture.svelte'; + import Dialogue from '$lib/components/Dialogue.svelte'; + import { onMount } from 'svelte'; const query = createQuery(['manager'], queries.manager); + + let warning: string; + let warningDialogue = false; + + let userAgent: string; + let isAndroid: boolean; + let androidVersionMatch: RegExpExecArray | null; + let androidVersion: number; + + onMount(() => { + userAgent = navigator.userAgent; + androidVersionMatch = /Android\s([\d.]+)/i.exec(userAgent); + androidVersion = androidVersionMatch ? parseInt(androidVersionMatch[1]) : 0; + isAndroid = !!androidVersion; + }); + + function handleClick() { + if (!isAndroid) { + warning = 'Your device is not running Android.'; + warningDialogue = true; + } else if (androidVersion < 8) { + warning = `Your device is running ${androidVersion}. ReVanced only supports Android versions 8 and above.`; + warningDialogue = true; + } + } + + Warning + {warning} Do you still want to download? + + + + + + + +

ReVanced Manager

Patch your favourite apps, right on your device.

- + {#if !isAndroid || androidVersion < 8} + + {:else} + + {/if} - +