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,
CryptoWallet,
Social,
Info
Info,
CompatiblePackage
} from '$lib/types';
export type ReposData = { repositories: Repository[] };
@ -44,7 +45,7 @@ async function patches(): Promise<PatchesData> {
// gets packages and patch count
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;
});
}

View File

@ -1,10 +1,21 @@
<script lang="ts">
let _title: string = "";
$: title = _title === "" ? "ReVanced" : `ReVanced · ${_title}`;
import { JsonLd } from 'svelte-meta-tags';
import { queries } from '$data/api';
import { createQuery } from '@tanstack/svelte-query';
let _title: string = '';
$: title = _title === '' ? 'ReVanced' : `ReVanced · ${_title}`;
export { _title as title };
export let description: string = "Continuing the legacy of Vanced.";
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);
});
</script>
<svelte:head>
@ -23,4 +34,8 @@ export let description: string = "Continuing the legacy of Vanced.";
<meta name="twitter:description" content={description} />
<meta name="twitter:image" itemprop="image" content="/embed.png" />
<meta name="twitter:card" content="summary" />
{#if schema}
<JsonLd {schema} />
{/if}
</svelte:head>

View File

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

View File

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

View File

@ -4,12 +4,9 @@
import SocialHost from '$layout/Hero/SocialHost.svelte';
import Wave from '$lib/components/Wave.svelte';
import Meta from '$lib/components/Meta.svelte';
import { JsonLd } from 'svelte-meta-tags';
</script>
<Meta />
<JsonLd
<Meta
schema={{
'@context': 'https://schema.org',
'@type': 'WebPage',
@ -23,15 +20,7 @@
logo: {
'@type': 'ImageObject',
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 Footer from '$layout/Footer/FooterHost.svelte';
import Meta from '$lib/components/Meta.svelte';
import { JsonLd } from 'svelte-meta-tags';
import Query from '$lib/components/Query.svelte';
import { queries } from '$data/api';
@ -14,8 +13,8 @@
const query = createQuery(['repositories'], queries.repositories);
</script>
<Meta title="Contributors" />
<JsonLd
<Meta
title="Contributors"
schema={{
'@context': 'https://schema.org',
'@type': 'WebPage',
@ -29,15 +28,7 @@
logo: {
'@type': 'ImageObject',
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>
<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 }}>
<section>
@ -67,11 +85,12 @@
<a class="donate-card" target="_blank" rel="noreferrer" href={platform.url}>
<!-- not using <img/> because we want the image height to always be 200px -->
<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"
aria-label="{platform.name} preview image"
>
</div>
/>
<span>{platform.name}</span>
</a>
{/each}
@ -79,7 +98,9 @@
{#if data.wallets}
<button class="donate-card" on:click={() => (cryptoDialogue = !cryptoDialogue)}>
<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"
aria-label="Cryptocurrencies preview image"
/>
@ -209,7 +230,6 @@
}
}
// COPEEEE
@media screen and (max-width: 768px) {
#heart {

View File

@ -8,7 +8,6 @@
import manager_screenshot from '$images/manager.png?format=avif;webp;png&picture';
import Meta from '$lib/components/Meta.svelte';
import { JsonLd } from 'svelte-meta-tags';
import Query from '$lib/components/Query.svelte';
import Button from '$lib/components/Button.svelte';
import Footer from '$layout/Footer/FooterHost.svelte';
@ -44,8 +43,8 @@
}
</script>
<Meta title="Download" />
<JsonLd
<Meta
title="Download"
schema={{
'@type': 'MobileApplication',
name: 'ReVanced Manager',
@ -68,15 +67,7 @@
logo: {
'@type': 'ImageObject',
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 === '') {
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) {
return str.toLowerCase().replace(filter, '').includes(term);
function searchString(str?: string, term: string, filter: RegExp) {
return str?.toLowerCase().replace(filter, '').includes(term);
}
function filter(patches: Patch[], pkg: string, search?: string): Patch[] {
@ -70,7 +70,7 @@
return (
searchString(patch.description, 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;
@ -107,8 +107,8 @@
};
</script>
<Meta title="Patches" />
<JsonLd
<Meta
title="Patches"
schema={{
'@context': 'https://schema.org',
'@type': 'WebPage',
@ -122,15 +122,7 @@
logo: {
'@type': 'ImageObject',
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 showAllVersions: boolean;
const hasPatchOptions = !!patch.options.length;
const hasPatchOptions = !!patch.options?.length;
let expanded: boolean = false;
</script>
@ -26,8 +26,13 @@
<img class="expand-arrow" src="/icons/expand_more.svg" alt="dropdown" />
{/if}
</div>
{#if patch.description}
<h5>{patch.description}</h5>
{/if}
<ul class="info-container">
{#if !patch.compatiblePackages?.length}
<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}"
@ -37,17 +42,14 @@
<li class="patch-info">📦 {pkg.name}</li>
</a>
{/each}
{#if !patch.compatiblePackages.length}
<li class="patch-info">🌎 Universal patch</li>
{/if}
{#if hasPatchOptions}
<li class="patch-info">⚙️ Patch options</li>
{/if}
<!-- should i hardcode this to get the version of the first package? idk you cant stop me -->
{#if patch.compatiblePackages.length && patch.compatiblePackages[0].versions.length}
<!-- Should this be hardcoded to get the version of the first package? -->
{#if patch.compatiblePackages?.length && patch.compatiblePackages[0].versions?.length}
{#if showAllVersions}
{#each patch.compatiblePackages[0].versions
.slice()
@ -78,6 +80,8 @@
/>
</Button>
{/if}
{:else}
<li class="patch-info">🎯 Any</li>
{/if}
</ul>