chore: merge branch dev to main (#181)

This commit is contained in:
oSumAtrIX 2023-10-05 04:57:43 +02:00 committed by GitHub
commit aaf928c92b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 90 additions and 89 deletions

View File

@ -10,7 +10,8 @@ import type {
DonationPlatform, DonationPlatform,
CryptoWallet, CryptoWallet,
Social, Social,
Info Info,
CompatiblePackage
} from '$lib/types'; } from '$lib/types';
export type ReposData = { repositories: Repository[] }; export type ReposData = { repositories: Repository[] };
@ -44,7 +45,7 @@ async function patches(): Promise<PatchesData> {
// gets packages and patch count // gets packages and patch count
for (let i = 0; i < json.patches.length; i++) { for (let i = 0; i < json.patches.length; i++) {
json.patches[i].compatiblePackages.forEach((pkg: Patch) => { json.patches[i].compatiblePackages?.forEach((pkg: CompatiblePackage) => {
packagesWithCount[pkg.name] = (packagesWithCount[pkg.name] || 0) + 1; packagesWithCount[pkg.name] = (packagesWithCount[pkg.name] || 0) + 1;
}); });
} }

View File

@ -1,26 +1,41 @@
<script lang="ts"> <script lang="ts">
let _title: string = ""; import { JsonLd } from 'svelte-meta-tags';
$: title = _title === "" ? "ReVanced" : `ReVanced · ${_title}`; import { queries } from '$data/api';
import { createQuery } from '@tanstack/svelte-query';
export { _title as title }; let _title: string = '';
$: title = _title === '' ? 'ReVanced' : `ReVanced · ${_title}`;
export { _title as title };
export let description: string = 'Continuing the legacy of Vanced.';
export let schema: any | undefined;
createQuery(['socials'], queries.socials).subscribe((query) => {
schema.publisher.sameAs = query.data?.socials?.map((social) => social.url);
});
export let description: string = "Continuing the legacy of Vanced.";
</script> </script>
<svelte:head> <svelte:head>
<title>{title}</title> <title>{title}</title>
<meta name="description" content={description} /> <meta name="description" content={description} />
<meta name="theme-color" content="#9FD5FF" /> <meta name="theme-color" content="#9FD5FF" />
<!-- OpenGraph --> <!-- OpenGraph -->
<meta property="og:title" content={title} /> <meta property="og:title" content={title} />
<meta property="og:description" content={description} /> <meta property="og:description" content={description} />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:image" content="/embed.png" /> <meta property="og:image" content="/embed.png" />
<!-- Twitter --> <!-- Twitter -->
<meta name="twitter:title" content={title} /> <meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} /> <meta name="twitter:description" content={description} />
<meta name="twitter:image" itemprop="image" content="/embed.png" /> <meta name="twitter:image" itemprop="image" content="/embed.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
{#if schema}
<JsonLd {schema} />
{/if}
</svelte:head> </svelte:head>

View File

@ -12,11 +12,10 @@ export interface Repository {
export interface Patch { export interface Patch {
name: string; name: string;
description: string; description: string;
version: string;
excluded: boolean;
dependencies: string[];
options: PatchOption[];
compatiblePackages: CompatiblePackage[]; compatiblePackages: CompatiblePackage[];
use: boolean;
requiresIntegrations: boolean;
options: PatchOption[];
} }
export interface CompatiblePackage { export interface CompatiblePackage {
@ -26,10 +25,10 @@ export interface CompatiblePackage {
export interface PatchOption { export interface PatchOption {
key: string; key: string;
default: any;
title: string; title: string;
description: string; description: string;
required: boolean; required: boolean;
choices: string[];
} }
export interface Asset { export interface Asset {

View File

@ -1,6 +1,5 @@
<script lang="ts"> <script lang="ts">
import Meta from '$lib/components/Meta.svelte'; import Meta from '$lib/components/Meta.svelte';
import Navigation from '$layout/Navbar/NavButton.svelte';
import { page } from '$app/stores'; import { page } from '$app/stores';
import Button from '$lib/components/Button.svelte'; import Button from '$lib/components/Button.svelte';

View File

@ -4,12 +4,9 @@
import SocialHost from '$layout/Hero/SocialHost.svelte'; import SocialHost from '$layout/Hero/SocialHost.svelte';
import Wave from '$lib/components/Wave.svelte'; import Wave from '$lib/components/Wave.svelte';
import Meta from '$lib/components/Meta.svelte'; import Meta from '$lib/components/Meta.svelte';
import { JsonLd } from 'svelte-meta-tags';
</script> </script>
<Meta /> <Meta
<JsonLd
schema={{ schema={{
'@context': 'https://schema.org', '@context': 'https://schema.org',
'@type': 'WebPage', '@type': 'WebPage',
@ -23,15 +20,7 @@
logo: { logo: {
'@type': 'ImageObject', '@type': 'ImageObject',
url: 'https://revanced.app/embed.png' url: 'https://revanced.app/embed.png'
}, }
sameAs: [
'https://github.com/revanced',
'https://twitter.com/revancedapp',
'https://revanced.app/discord',
'https://www.reddit.com/r/revancedapp',
'https://t.me/app_revanced',
'https://www.youtube.com/@ReVanced'
]
} }
}} }}
/> />

View File

@ -5,7 +5,6 @@
import ContributorHost from './ContributorSection.svelte'; import ContributorHost from './ContributorSection.svelte';
import Footer from '$layout/Footer/FooterHost.svelte'; import Footer from '$layout/Footer/FooterHost.svelte';
import Meta from '$lib/components/Meta.svelte'; import Meta from '$lib/components/Meta.svelte';
import { JsonLd } from 'svelte-meta-tags';
import Query from '$lib/components/Query.svelte'; import Query from '$lib/components/Query.svelte';
import { queries } from '$data/api'; import { queries } from '$data/api';
@ -14,8 +13,8 @@
const query = createQuery(['repositories'], queries.repositories); const query = createQuery(['repositories'], queries.repositories);
</script> </script>
<Meta title="Contributors" /> <Meta
<JsonLd title="Contributors"
schema={{ schema={{
'@context': 'https://schema.org', '@context': 'https://schema.org',
'@type': 'WebPage', '@type': 'WebPage',
@ -29,15 +28,7 @@
logo: { logo: {
'@type': 'ImageObject', '@type': 'ImageObject',
url: 'https://revanced.app/embed.png' url: 'https://revanced.app/embed.png'
}, }
sameAs: [
'https://github.com/revanced',
'https://twitter.com/revancedapp',
'https://revanced.app/discord',
'https://www.reddit.com/r/revancedapp',
'https://t.me/app_revanced',
'https://www.youtube.com/@ReVanced'
]
} }
}} }}
/> />

View File

@ -39,7 +39,25 @@
} }
</script> </script>
<Meta title="Donate" /> <Meta
title="Donate"
schema={{
'@context': 'https://schema.org',
'@type': 'WebPage',
name: 'ReVanced Donation',
abstract: 'Various ways to support ReVanced',
breadcrumb: 'Home > Donate',
publisher: {
'@type': 'Organization',
name: 'ReVanced',
url: 'https://revanced.app/',
logo: {
'@type': 'ImageObject',
url: 'https://revanced.app/embed.png'
}
}
}}
/>
<main class="wrapper" in:fly={{ y: 10, easing: quintOut, duration: 750 }}> <main class="wrapper" in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<section> <section>
@ -67,11 +85,12 @@
<a class="donate-card" target="_blank" rel="noreferrer" href={platform.url}> <a class="donate-card" target="_blank" rel="noreferrer" href={platform.url}>
<!-- not using <img/> because we want the image height to always be 200px --> <!-- not using <img/> because we want the image height to always be 200px -->
<div <div
style="background-image: url('/donate/card-images/{platform.name}.{supportsWebP() ? 'webp' : 'png'}'), url('/donate/card-images/fallback.svg');" style="background-image: url('/donate/card-images/{platform.name}.{supportsWebP()
? 'webp'
: 'png'}'), url('/donate/card-images/fallback.svg');"
role="img" role="img"
aria-label="{platform.name} preview image" aria-label="{platform.name} preview image"
> />
</div>
<span>{platform.name}</span> <span>{platform.name}</span>
</a> </a>
{/each} {/each}
@ -79,7 +98,9 @@
{#if data.wallets} {#if data.wallets}
<button class="donate-card" on:click={() => (cryptoDialogue = !cryptoDialogue)}> <button class="donate-card" on:click={() => (cryptoDialogue = !cryptoDialogue)}>
<div <div
style="background-image: url('/donate/card-images/Cryptocurrencies.{supportsWebP() ? 'webp' : 'png'}'), url('/donate/card-images/fallback.svg');" style="background-image: url('/donate/card-images/Cryptocurrencies.{supportsWebP()
? 'webp'
: 'png'}'), url('/donate/card-images/fallback.svg');"
role="img" role="img"
aria-label="Cryptocurrencies preview image" aria-label="Cryptocurrencies preview image"
/> />
@ -209,7 +230,6 @@
} }
} }
// COPEEEE // COPEEEE
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
#heart { #heart {

View File

@ -8,7 +8,6 @@
import manager_screenshot from '$images/manager.png?format=avif;webp;png&picture'; import manager_screenshot from '$images/manager.png?format=avif;webp;png&picture';
import Meta from '$lib/components/Meta.svelte'; import Meta from '$lib/components/Meta.svelte';
import { JsonLd } from 'svelte-meta-tags';
import Query from '$lib/components/Query.svelte'; import Query from '$lib/components/Query.svelte';
import Button from '$lib/components/Button.svelte'; import Button from '$lib/components/Button.svelte';
import Footer from '$layout/Footer/FooterHost.svelte'; import Footer from '$layout/Footer/FooterHost.svelte';
@ -44,8 +43,8 @@
} }
</script> </script>
<Meta title="Download" /> <Meta
<JsonLd title="Download"
schema={{ schema={{
'@type': 'MobileApplication', '@type': 'MobileApplication',
name: 'ReVanced Manager', name: 'ReVanced Manager',
@ -68,15 +67,7 @@
logo: { logo: {
'@type': 'ImageObject', '@type': 'ImageObject',
url: 'https://revanced.app/embed.png' url: 'https://revanced.app/embed.png'
}, }
sameAs: [
'https://github.com/revanced',
'https://twitter.com/revancedapp',
'https://revanced.app/discord',
'https://www.reddit.com/r/revancedapp',
'https://t.me/app_revanced',
'https://www.youtube.com/@ReVanced'
]
} }
}} }}
/> />

View File

@ -47,11 +47,11 @@
if (pkg === '') { if (pkg === '') {
return false; return false;
} }
return !!patch.compatiblePackages.find((compat) => compat.name === pkg); return !!patch.compatiblePackages?.find((compat) => compat.name === pkg);
} }
function searchString(str: string, term: string, filter: RegExp) { function searchString(str?: string, term: string, filter: RegExp) {
return str.toLowerCase().replace(filter, '').includes(term); return str?.toLowerCase().replace(filter, '').includes(term);
} }
function filter(patches: Patch[], pkg: string, search?: string): Patch[] { function filter(patches: Patch[], pkg: string, search?: string): Patch[] {
@ -70,7 +70,7 @@
return ( return (
searchString(patch.description, search, /\s/g) || searchString(patch.description, search, /\s/g) ||
searchString(patch.name, search, /\s/g) || searchString(patch.name, search, /\s/g) ||
patch.compatiblePackages.find((x) => searchString(x.name, search, /\./g)) patch.compatiblePackages?.find((x) => searchString(x.name, search, /\./g))
); );
} }
return true; return true;
@ -107,8 +107,8 @@
}; };
</script> </script>
<Meta title="Patches" /> <Meta
<JsonLd title="Patches"
schema={{ schema={{
'@context': 'https://schema.org', '@context': 'https://schema.org',
'@type': 'WebPage', '@type': 'WebPage',
@ -122,15 +122,7 @@
logo: { logo: {
'@type': 'ImageObject', '@type': 'ImageObject',
url: 'https://revanced.app/embed.png' url: 'https://revanced.app/embed.png'
}, }
sameAs: [
'https://github.com/revanced',
'https://twitter.com/revancedapp',
'https://revanced.app/discord',
'https://www.reddit.com/r/revancedapp',
'https://t.me/app_revanced',
'https://www.youtube.com/@ReVanced'
]
} }
}} }}
/> />

View File

@ -7,7 +7,7 @@
export let patch: Patch; export let patch: Patch;
export let showAllVersions: boolean; export let showAllVersions: boolean;
const hasPatchOptions = !!patch.options.length; const hasPatchOptions = !!patch.options?.length;
let expanded: boolean = false; let expanded: boolean = false;
</script> </script>
@ -26,28 +26,30 @@
<img class="expand-arrow" src="/icons/expand_more.svg" alt="dropdown" /> <img class="expand-arrow" src="/icons/expand_more.svg" alt="dropdown" />
{/if} {/if}
</div> </div>
<h5>{patch.description}</h5> {#if patch.description}
<h5>{patch.description}</h5>
{/if}
<ul class="info-container"> <ul class="info-container">
{#each patch.compatiblePackages as pkg} {#if !patch.compatiblePackages?.length}
<a
href="https://play.google.com/store/apps/details?id={pkg.name}"
target="_blank"
rel="noreferrer"
>
<li class="patch-info">📦 {pkg.name}</li>
</a>
{/each}
{#if !patch.compatiblePackages.length}
<li class="patch-info">🌎 Universal patch</li> <li class="patch-info">🌎 Universal patch</li>
{:else}
{#each patch.compatiblePackages as pkg}
<a
href="https://play.google.com/store/apps/details?id={pkg.name}"
target="_blank"
rel="noreferrer"
>
<li class="patch-info">📦 {pkg.name}</li>
</a>
{/each}
{/if} {/if}
{#if hasPatchOptions} {#if hasPatchOptions}
<li class="patch-info">⚙️ Patch options</li> <li class="patch-info">⚙️ Patch options</li>
{/if} {/if}
<!-- should i hardcode this to get the version of the first package? idk you cant stop me --> <!-- Should this be hardcoded to get the version of the first package? -->
{#if patch.compatiblePackages.length && patch.compatiblePackages[0].versions.length} {#if patch.compatiblePackages?.length && patch.compatiblePackages[0].versions?.length}
{#if showAllVersions} {#if showAllVersions}
{#each patch.compatiblePackages[0].versions {#each patch.compatiblePackages[0].versions
.slice() .slice()
@ -78,6 +80,8 @@
/> />
</Button> </Button>
{/if} {/if}
{:else}
<li class="patch-info">🎯 Any</li>
{/if} {/if}
</ul> </ul>