Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/data/RouterEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ function makeStore(): Readable<RouterEvent> {
return derived(page, ($page) => {
return { navigating: false, target_url: $page.url };
});
} else {
// On client.
let current = new URL(location.href);
}

// Return store that responds to navigation events.
// The `navigating` store immediately "pushes" `null`.
// This in turn causes this derived store to immediately "push" the current URL.
return derived(navigating, ($nav) => {
let navigating = false;
// $nav is null when navigation finishes.
if ($nav != null && $nav.to != null) {
current = $nav.to.url;
navigating = true;
}
// On client.
let current = new URL(location.href);

return { navigating, target_url: current };
});
}
// Return store that responds to navigation events.
// The `navigating` store immediately "pushes" `null`.
// This in turn causes this derived store to immediately "push" the current URL.
return derived(navigating, ($nav) => {
let navigating = false;
// $nav is null when navigation finishes.
if ($nav != null && $nav.to != null) {
current = $nav.to.url;
navigating = true;
}

return { navigating, target_url: current };
});
}

// Do not subscribe to it outside of components!
Expand Down
16 changes: 8 additions & 8 deletions src/data/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import type {
DonationPlatform,
CryptoWallet,
Social,
About,
CompatiblePackage
About
} from '$lib/types';

export type ContributorsData = { contributables: Contributable[] };
Expand Down Expand Up @@ -41,20 +40,21 @@ async function patches(): Promise<PatchesData> {
const json = await get_json('v4/patches/list');
const packagesWithCount: { [key: string]: number } = {};

json.forEach((patch) => {
if (!patch.compatiblePackages) return;
for (const patch of json) {
if (!patch.compatiblePackages) continue;

patch.compatiblePackages = Object.keys(patch.compatiblePackages).map((name) => ({
name,
versions: patch.compatiblePackages[name]
}));
});
}

// gets packages and patch count
for (let i = 0; i < json.length; i++) {
json[i].compatiblePackages?.forEach((pkg: CompatiblePackage) => {
for (const { compatiblePackages } of json) {
if (!compatiblePackages) continue;
for (const pkg of compatiblePackages) {
packagesWithCount[pkg.name] = (packagesWithCount[pkg.name] || 0) + 1;
});
}
}

// sort packages by patch count to get most relevant apps on top
Expand Down
2 changes: 1 addition & 1 deletion src/data/api/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function set_status_url(apiUrl: string) {
.then((data) => {
if (data?.status) {
localStorage.setItem(STATUS_KEY, data.status);
console.log('status is now ' + localStorage.getItem(STATUS_KEY));
console.log('Status is now:', localStorage.getItem(STATUS_KEY));
}
});
}
Expand Down
4 changes: 0 additions & 4 deletions src/layout/Hero/HeroSection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
margin-bottom: 2rem;
}

.hero {
padding-bottom: 9rem;
}

.hero-text {
align-items: center;
}
Expand Down
9 changes: 1 addition & 8 deletions src/layout/Navbar/NavHost.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,10 @@
}

#nav-container {
top: 0;
position: sticky;
z-index: 666;
width: 100%;

&:has(.nav-buttons > li:first-child.selected) {
margin-bottom: 2.65rem;

&:has(.banner) {
margin-bottom: 1.5rem;
}
}
}

nav {
Expand Down
5 changes: 4 additions & 1 deletion src/routes/+error.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{#if status == 404}
<p>This page received a cease and desist letter from a multi-billion dollar tech company.</p>
<br />
<Button type="filled" href="/">Return Home</Button>
<Button type="filled" href="/">Return home</Button>
{:else}
<p>
{$page.error?.message}
Expand All @@ -23,6 +23,9 @@

<style>
section {
display: flex;
flex-direction: column;
width: fit-content;
text-align: center;
margin-top: 10rem;
}
Expand Down
15 changes: 7 additions & 8 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,15 @@
</div>

<style lang="scss">
.hide-on-scroll {
transition: opacity 0.5s var(--bezier-one);
z-index: -999;

&.hidden {
height: 0;
opacity: 0;
}
.hide-on-scroll.hidden {
z-index: -2;
height: 0;
opacity: 0;
overflow: hidden;
}

main {
padding-block: 2rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/download/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
{/if}
</Query>
<Button type="tonal" href="https://github.com/revanced/revanced-manager" target="_blank">
View Source
View source
</Button>
</div>
<div class="screenshot">
Expand Down
10 changes: 8 additions & 2 deletions src/routes/patches/PatchItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@
{/if}
{#if patch.compatiblePackages[0].versions.length > 1}
<li class="button">
<Button type="text" on:click={() => (showAllVersions = !showAllVersions)}>
<Button
type="text"
on:click={(e) => {
e.stopPropagation();
showAllVersions = !showAllVersions;
}}
>
<div
class="expand-arrow"
style:transform={showAllVersions ? 'rotate(90deg)' : 'rotate(-90deg)'}
Expand All @@ -93,7 +99,7 @@
<span transition:fade={{ easing: quintOut, duration: 1000 }}>
<div class="options" transition:slide={{ easing: quintOut, duration: 500 }}>
{#each options as option}
<div class="option">
<div class="option" on:click|stopPropagation>
<h5 id="option-title">{option.title}</h5>
<h5>
<pre id="option-description">{option.description}</pre>
Expand Down