mirror of
https://github.com/revanced/revanced-website.git
synced 2025-06-12 21:27:42 +02:00
feat: nicer patches + filtering, use stores again
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
let alt = `${name}'s profile picture`;
|
||||
</script>
|
||||
|
||||
<a href={url} target="_blank">
|
||||
<a href={url} rel="noreferrer" target="_blank">
|
||||
<button tabindex="-1">
|
||||
<img src={pfp} {alt} />
|
||||
</button>
|
||||
|
@ -41,7 +41,7 @@
|
||||
}
|
||||
|
||||
li.selected {
|
||||
background-color: var(--grey-three);
|
||||
background-color: var(--grey-two);
|
||||
color: var(--accent-color);
|
||||
}
|
||||
</style>
|
||||
|
@ -1,79 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { fly } from 'svelte/transition';
|
||||
import { quintOut } from 'svelte/easing';
|
||||
|
||||
export let name: string;
|
||||
export let desc: string;
|
||||
export let ver: string;
|
||||
// export let pkgName: string;
|
||||
export let hasPatchOptions: boolean;
|
||||
|
||||
function handleClick() {
|
||||
const el = document.getElementById('arrow');
|
||||
if (!el) return;
|
||||
el!.style.transform = 'rotate(180deg)';
|
||||
}
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="patch-container {hasPatchOptions ? 'expanded' : ''}"
|
||||
on:click={hasPatchOptions ? handleClick : null}
|
||||
>
|
||||
<div class="things">
|
||||
<div class="title">
|
||||
<h1>{name}</h1>
|
||||
<h3>{ver}</h3>
|
||||
</div>
|
||||
|
||||
{#if hasPatchOptions}
|
||||
<img id="arrow" src="/icons/arrow.svg" alt="dropdown" />
|
||||
{/if}
|
||||
</div>
|
||||
<!-- <h3>{pkgName}</h3> -->
|
||||
<h4>{desc}</h4>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
h1 {
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.5rem;
|
||||
margin-right: 0.5rem;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: var(--grey-five);
|
||||
font-size: 0.8rem;
|
||||
margin-bottom: 0.1rem;
|
||||
}
|
||||
|
||||
h4 {
|
||||
color: var(--grey-five);
|
||||
font-size: 0.8rem;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.patch-container {
|
||||
background-color: var(--grey-six);
|
||||
padding: 1.5rem;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.things {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
img {
|
||||
height: 1.5rem;
|
||||
}
|
||||
|
||||
.expanded {
|
||||
}
|
||||
</style>
|
165
src/lib/components/atoms/PatchCell.svelte
Normal file
165
src/lib/components/atoms/PatchCell.svelte
Normal file
@ -0,0 +1,165 @@
|
||||
<script lang="ts">
|
||||
import { slide, fade } from 'svelte/transition';
|
||||
import { quintOut } from 'svelte/easing';
|
||||
import type { CompatiblePackage, PatchOption } from '$lib/types';
|
||||
|
||||
export let name: string;
|
||||
export let description: string;
|
||||
export let version: string;
|
||||
export let options: PatchOption[];
|
||||
export let compatiblePackages: CompatiblePackage[];
|
||||
export let hasPatchOptions: boolean;
|
||||
export let current: boolean;
|
||||
|
||||
let expanded: boolean = false;
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div
|
||||
class="patch-container {hasPatchOptions ? 'expanded' : ''}"
|
||||
class:rotate={expanded === true}
|
||||
on:click={() => (expanded = !expanded)}
|
||||
>
|
||||
<div class="things">
|
||||
<div class="title">
|
||||
<h1>
|
||||
{name
|
||||
// im sorry
|
||||
.replace(/-/g, ' ')
|
||||
.replace(/(?:^|\s)\S/g, (x) => x.toUpperCase())
|
||||
.replace(/Microg/g, 'MicroG')
|
||||
.replace(/Hdr/g, 'HDR')
|
||||
.replace(/Sponsorblock/g, 'SponsorBlock')
|
||||
.replace(/Tiktok/g, 'TikTok')}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
{#if hasPatchOptions}
|
||||
<img id="arrow" src="/icons/arrow.svg" alt="dropdown" />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="info-container">
|
||||
{#each compatiblePackages as pkg, i}
|
||||
{#if current === false}
|
||||
<h2>{pkg.name}</h2>
|
||||
{/if}
|
||||
<!-- gets only the last supported version (cant get 'any' to work without duplicates help) -->
|
||||
{#if i < pkg.versions.length - 1}
|
||||
<h2>
|
||||
Target Package Version: {pkg.versions.slice(-1)[0] || 'Any'}
|
||||
</h2>
|
||||
{/if}
|
||||
{/each}
|
||||
<h2>Patch Version: {version}</h2>
|
||||
</div>
|
||||
<h4>{description}</h4>
|
||||
|
||||
{#if expanded && hasPatchOptions}
|
||||
<span transition:fade|local={{ easing: quintOut, duration: 1000 }}>
|
||||
<div class="options" transition:slide|local={{ easing: quintOut, duration: 500 }}>
|
||||
{#each options as option}
|
||||
<div class="option">
|
||||
<h3>{option.title}</h3>
|
||||
<h4>{option.description}</h4>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
h1 {
|
||||
font-weight: 600;
|
||||
margin-right: 0.5rem;
|
||||
font-size: 1.25rem;
|
||||
color: var(--accent-color-two);
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: var(--accent-color);
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
border-radius: 8px;
|
||||
background-color: var(--grey-two);
|
||||
padding: 0.2rem 0.4rem;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.info-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.25rem;
|
||||
margin-bottom: 0.5rem;
|
||||
margin-left: -0.2rem;
|
||||
margin-top: 0.5rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: var(--accent-color);
|
||||
font-size: 0.85rem;
|
||||
margin-bottom: 0.1rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
h4 {
|
||||
color: var(--grey-five);
|
||||
font-size: 0.8rem;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.patch-container {
|
||||
transition: all 2s var(--bezier-one);
|
||||
background-color: var(--grey-six);
|
||||
padding: 1.5rem;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
|
||||
.patch-container:active {
|
||||
background-color: var(--grey-three);
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.things {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
#arrow {
|
||||
height: 1.5rem;
|
||||
transition: all 0.2s var(--bezier-one);
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.rotate #arrow {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.expanded {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.option {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.option + .option {
|
||||
border-top: 1px solid var(--grey-three);
|
||||
}
|
||||
|
||||
.options {
|
||||
border: 1px solid var(--grey-three);
|
||||
overflow: hidden;
|
||||
border-radius: 8px;
|
||||
margin-top: 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
@ -3,7 +3,7 @@
|
||||
export let href = '#';
|
||||
</script>
|
||||
|
||||
<a {href} target="_blank">
|
||||
<a {href} rel="noreferrer" target="_blank">
|
||||
<div>
|
||||
<img src="socials/{src}.svg" alt={src} />
|
||||
</div>
|
||||
|
67
src/lib/components/atoms/TreeMenuButton.svelte
Normal file
67
src/lib/components/atoms/TreeMenuButton.svelte
Normal file
@ -0,0 +1,67 @@
|
||||
<script lang="ts">
|
||||
export let current: string | boolean;
|
||||
export let name: string;
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div
|
||||
class="package"
|
||||
class:selected = {current === name}
|
||||
on:click={() => (current = (current === name) ? false : name) && window.scrollTo({ top: 0, behavior: 'smooth' })}
|
||||
>
|
||||
<h3>{name}</h3>
|
||||
</div>
|
||||
|
||||
|
||||
<style>
|
||||
.package {
|
||||
padding: 0.6rem;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
width: 100%;
|
||||
user-select: none;
|
||||
transition: all 0.4s var(--bezier-one);
|
||||
}
|
||||
|
||||
.package::before {
|
||||
content: '';
|
||||
height: 5px;
|
||||
inline-size: 4px;
|
||||
border-radius: 200px;
|
||||
background-color: var(--accent-color);
|
||||
transition: all 0.2s var(--bezier-one);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.selected::before {
|
||||
height: 20px;
|
||||
transition: all 0.3s var(--bezier-one);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.package > h3 {
|
||||
color: var(--grey-five);
|
||||
transition: all 0.3s var(--bezier-one);
|
||||
}
|
||||
|
||||
.selected > h3 {
|
||||
color: var(--accent-color);
|
||||
transition: all 0.3s var(--bezier-one);
|
||||
}
|
||||
|
||||
.package:hover,
|
||||
.selected {
|
||||
background-color: var(--grey-six);
|
||||
}
|
||||
|
||||
.package:not(.selected):hover > h3 {
|
||||
color: var(--white);
|
||||
}
|
||||
</style>
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import type { Contributor } from '$lib/types';
|
||||
import type { Contributor } from '$lib/types';
|
||||
import ContributorButton from '../atoms/ContributorPerson.svelte';
|
||||
|
||||
export let contribs: Contributor[];
|
||||
@ -17,18 +17,14 @@
|
||||
|
||||
{#if contribs}
|
||||
<div class="container">
|
||||
<a href="https://github.com/{repo}" target="_blank">
|
||||
<a href="https://github.com/{repo}" rel="noreferrer" target="_blank">
|
||||
<h2>{repo_name}</h2>
|
||||
</a>
|
||||
|
||||
<div class="contrib-host">
|
||||
{#each contribs as contrib}
|
||||
{#if !usersIwantToExplodeSoBadly.includes(contrib.login)}
|
||||
<ContributorButton
|
||||
name={contrib.login}
|
||||
pfp={contrib.avatar_url}
|
||||
url={contrib.html_url}
|
||||
/>
|
||||
<ContributorButton name={contrib.login} pfp={contrib.avatar_url} url={contrib.html_url} />
|
||||
{/if}
|
||||
{/each}
|
||||
</div>
|
||||
|
@ -1,4 +1,16 @@
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
import type { ContribData } from '../../../data/ContributorsStore';
|
||||
import { ContributorsStore } from '../../../data/ContributorsStore';
|
||||
|
||||
let data: ContribData;
|
||||
|
||||
onMount(() => {
|
||||
ContributorsStore.subscribe(async (e: Promise<ContribData>) => {
|
||||
data = await e;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<hr />
|
||||
@ -17,31 +29,39 @@
|
||||
<section class="links-container">
|
||||
<div class="link-column">
|
||||
<h5>Pages</h5>
|
||||
<h6>Home</h6>
|
||||
<h6>Download</h6>
|
||||
<h6>Docs</h6>
|
||||
<h6>Patches</h6>
|
||||
<h6>Credits</h6>
|
||||
<a href="/"><h6>Home</h6></a>
|
||||
<a href="/download"><h6>Download</h6></a>
|
||||
<a href="/docs"><h6>Docs</h6></a>
|
||||
<a href="/patches"><h6>Patches</h6></a>
|
||||
<a href="/credits"><h6>Credits</h6></a>
|
||||
</div>
|
||||
<div class="link-column">
|
||||
<h5>Repos</h5>
|
||||
<h6>CLI</h6>
|
||||
<h6>Patcher</h6>
|
||||
<h6>Patches</h6>
|
||||
<h6>Integrations</h6>
|
||||
<h6>Manager</h6>
|
||||
<h6>Website</h6>
|
||||
<h6>API</h6>
|
||||
{#if data}
|
||||
{#each data.repositories as { name }}
|
||||
<a href="https://github.com/{name}" target="_blank" rel="noreferrer">
|
||||
<div>
|
||||
<h6>{name
|
||||
.replace(/-/g, ' ')
|
||||
.replace(/revanced\/revanced/g, '')
|
||||
.replace(/cli/g, 'CLI')
|
||||
.replace(/api/g, 'API')
|
||||
.replace(/(?:^|\s)\S/g, (x) => x.toUpperCase())}
|
||||
</h6>
|
||||
</div>
|
||||
</a>
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
<div class="link-column">
|
||||
<h5>Repos</h5>
|
||||
<h6>CLI</h6>
|
||||
<h6>Patcher</h6>
|
||||
<h6>Patches</h6>
|
||||
<h6>Integrations</h6>
|
||||
<h6>Manager</h6>
|
||||
<h6>Website</h6>
|
||||
<h6>API</h6>
|
||||
<!-- to replace -->
|
||||
<h5>Socials</h5>
|
||||
<a href="/"><h6>Github</h6></a>
|
||||
<a href="/"><h6>Discord</h6></a>
|
||||
<a href="/"><h6>Reddit</h6></a>
|
||||
<a href="/"><h6>Twitter</h6></a>
|
||||
<a href="/"><h6>Telegram</h6></a>
|
||||
<a href="/"><h6>Video Site</h6></a>
|
||||
</div>
|
||||
</section>
|
||||
</footer>
|
||||
@ -74,6 +94,10 @@
|
||||
height: 3rem;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.links-container {
|
||||
display: flex;
|
||||
gap: 5rem;
|
||||
|
48
src/lib/components/molecules/TreeMenu.svelte
Normal file
48
src/lib/components/molecules/TreeMenu.svelte
Normal file
@ -0,0 +1,48 @@
|
||||
<script lang="ts">
|
||||
export let title: string;
|
||||
</script>
|
||||
|
||||
<div class="menu">
|
||||
<h5>{title.toUpperCase()}</h5>
|
||||
<hr />
|
||||
<div class="package-list">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.menu {
|
||||
height: calc(100vh - 7.5rem);
|
||||
width: 100%;
|
||||
padding: 0px 10px 30px 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: sticky;
|
||||
top: 7.5rem;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin-top: 0.75rem;
|
||||
display: block;
|
||||
height: 1px;
|
||||
border: 0;
|
||||
border-top: 1px solid var(--grey-three);
|
||||
}
|
||||
|
||||
.package-list {
|
||||
margin-top: 0.75rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
/* .package-list:has(.loading) {
|
||||
padding-top: 7.5rem;
|
||||
} */
|
||||
</style>
|
Reference in New Issue
Block a user