From 32c0bbb3d4c3ae9c284ad1ac8cea0b2f85e0a6e1 Mon Sep 17 00:00:00 2001 From: Ushie Date: Sat, 14 Jun 2025 02:45:43 +0300 Subject: [PATCH 01/13] refactor: Component style cleanup --- src/app.html | 2 +- src/app.scss | 2 +- src/layout/Footer/FooterHost.svelte | 219 +++++++++++-------------- src/layout/Footer/FooterSection.svelte | 2 +- src/layout/Hero/HeroSection.svelte | 108 +++++------- src/layout/Navbar/NavHost.svelte | 16 +- src/lib/components/Divider.svelte | 13 +- src/lib/components/FilterChip.svelte | 19 +-- src/lib/components/Snackbar.svelte | 51 ++---- src/lib/components/Spinner.svelte | 28 ++-- src/routes/+page.svelte | 15 +- src/routes/announcements/+page.svelte | 5 +- src/routes/contributors/+page.svelte | 2 +- src/routes/donate/+page.svelte | 11 +- src/routes/donate/TeamMember.svelte | 4 +- src/routes/patches/Package.svelte | 22 ++- src/routes/patches/PackageMenu.svelte | 14 +- src/routes/patches/PatchItem.svelte | 2 + 18 files changed, 232 insertions(+), 303 deletions(-) diff --git a/src/app.html b/src/app.html index 197516e..5266886 100644 --- a/src/app.html +++ b/src/app.html @@ -22,6 +22,6 @@ - %sveltekit.body% +
%sveltekit.body%
diff --git a/src/app.scss b/src/app.scss index c7a850d..a2ed6c1 100644 --- a/src/app.scss +++ b/src/app.scss @@ -143,7 +143,7 @@ p { line-height: 1.75rem; } -@media screen and (max-width: 767px) { +@media (max-width: 767px) { h1 { font-size: 2.6rem; line-height: 3.75rem; diff --git a/src/layout/Footer/FooterHost.svelte b/src/layout/Footer/FooterHost.svelte index 46efef7..aa7981a 100644 --- a/src/layout/Footer/FooterHost.svelte +++ b/src/layout/Footer/FooterHost.svelte @@ -9,6 +9,7 @@ import FooterSection from './FooterSection.svelte'; import { RV_DMCA_GUID } from '$env/static/public'; import { onMount } from 'svelte'; + import Divider from '$lib/components/Divider.svelte'; const aboutQuery = createQuery(queries.about()); @@ -20,104 +21,101 @@ }); + - diff --git a/src/layout/Footer/FooterSection.svelte b/src/layout/Footer/FooterSection.svelte index 2c39b6a..a67679e 100644 --- a/src/layout/Footer/FooterSection.svelte +++ b/src/layout/Footer/FooterSection.svelte @@ -59,7 +59,7 @@ user-select: none; } - @media screen and (max-width: 768px) { + @media (max-width: 768px) { .mobile-only { display: block; } diff --git a/src/layout/Hero/HeroSection.svelte b/src/layout/Hero/HeroSection.svelte index 69ebb12..a5f4d9a 100644 --- a/src/layout/Hero/HeroSection.svelte +++ b/src/layout/Hero/HeroSection.svelte @@ -17,7 +17,7 @@

Customize your mobile experience through ReVanced
by applying patches to your applications.

-
+
@@ -34,83 +34,59 @@
- diff --git a/src/layout/Navbar/NavHost.svelte b/src/layout/Navbar/NavHost.svelte index eea1433..d10fce6 100644 --- a/src/layout/Navbar/NavHost.svelte +++ b/src/layout/Navbar/NavHost.svelte @@ -91,13 +91,13 @@
- +
@@ -256,7 +256,7 @@ } } - @media screen and (min-width: 768px) { + @media (min-width: 768px) { .mobile-only { display: none !important; } diff --git a/src/lib/components/Divider.svelte b/src/lib/components/Divider.svelte index acf4464..c2bf716 100644 --- a/src/lib/components/Divider.svelte +++ b/src/lib/components/Divider.svelte @@ -1,4 +1,15 @@ -
-
- -
+
+
{/if} - diff --git a/src/lib/components/Spinner.svelte b/src/lib/components/Spinner.svelte index 286768e..ec7f601 100644 --- a/src/lib/components/Spinner.svelte +++ b/src/lib/components/Spinner.svelte @@ -1,30 +1,30 @@ -
+
- diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index a9d4683..5c02968 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -160,21 +160,18 @@ display: flex; flex-direction: column; align-items: center; + + @media (max-width: 335px) { + padding: 2rem 0 !important; + } + } .hero-img-container { z-index: 0; - } - @media screen and (max-width: 1100px) { - .hero-img-container { + @media (max-width: 1100px) { display: none; } } - - @media screen and (max-width: 335px) { - main { - padding: 2rem 0 !important; - } - } diff --git a/src/routes/announcements/+page.svelte b/src/routes/announcements/+page.svelte index 0aae855..459b830 100644 --- a/src/routes/announcements/+page.svelte +++ b/src/routes/announcements/+page.svelte @@ -175,13 +175,10 @@ display: grid; grid-template-columns: repeat(3, 1fr); padding: 16px 0; - min-width: 0; width: 100%; gap: 16px; - } - @media (max-width: 767px) { - .cards { + @media (max-width: 767px) { display: flex; flex-direction: column; } diff --git a/src/routes/contributors/+page.svelte b/src/routes/contributors/+page.svelte index 660b14d..73db3bd 100644 --- a/src/routes/contributors/+page.svelte +++ b/src/routes/contributors/+page.svelte @@ -109,7 +109,7 @@ a:hover::after { transform: translateX(5px); } - @media screen and (max-width: 767px) { + @media (max-width: 767px) { .text-container { padding: 2rem 1.75rem; } diff --git a/src/routes/donate/+page.svelte b/src/routes/donate/+page.svelte index 20e6aaa..5101d55 100644 --- a/src/routes/donate/+page.svelte +++ b/src/routes/donate/+page.svelte @@ -215,7 +215,7 @@ justify-content: center; align-items: center; - @media screen and (max-width: 768px) { + @media (max-width: 768px) { flex-direction: column-reverse; } } @@ -234,17 +234,16 @@ margin-bottom: 2rem; width: 60%; - @media screen and (max-width: 1200px) { + @media (max-width: 1200px) { width: 90%; } - @media screen and (max-width: 768px) { + @media (max-width: 768px) { width: 100%; } } - // COPEEEE - @media screen and (max-width: 768px) { + @media (max-width: 768px) { #heart { display: none; } @@ -255,7 +254,7 @@ gap: 1rem; margin-bottom: 3rem; - @media screen and (max-width: 768px) { + @media (max-width: 768px) { flex-direction: column; } } diff --git a/src/routes/donate/TeamMember.svelte b/src/routes/donate/TeamMember.svelte index 8906019..a28b293 100644 --- a/src/routes/donate/TeamMember.svelte +++ b/src/routes/donate/TeamMember.svelte @@ -93,7 +93,7 @@ .mobile { display: none; } - @media screen and (width <= 768px) { + @media (max-width: 768px) { .desktop { display: none; } @@ -117,7 +117,7 @@ user-select: none; margin-bottom: 1rem; - @media screen and (max-width: 768px) { + @media (max-width: 768px) { margin-bottom: 0; height: 48px; width: 48px; diff --git a/src/routes/patches/Package.svelte b/src/routes/patches/Package.svelte index 89adaff..d2330db 100644 --- a/src/routes/patches/Package.svelte +++ b/src/routes/patches/Package.svelte @@ -33,7 +33,7 @@ {name}
- diff --git a/src/lib/components/Dialogue.svelte b/src/layout/Dialogs/Dialog.svelte similarity index 52% rename from src/lib/components/Dialogue.svelte rename to src/layout/Dialogs/Dialog.svelte index c9ed5e1..52b65f8 100644 --- a/src/lib/components/Dialogue.svelte +++ b/src/layout/Dialogs/Dialog.svelte @@ -4,7 +4,7 @@ import ArrowLeft from 'svelte-material-icons/ArrowLeft.svelte'; - export let modalOpen = false; + export let dialogOpen = false; export let fullscreen = false; export let notDismissible = false; @@ -16,20 +16,20 @@ } -{#if modalOpen} +{#if dialogOpen} +
{ - if (!notDismissible) modalOpen = !modalOpen; + if (!notDismissible) dialogOpen = !dialogOpen; }} on:keypress={() => { - if (!notDismissible) modalOpen = !modalOpen; + if (!notDismissible) dialogOpen = !dialogOpen; }} transition:fade={{ easing: quadInOut, duration: 150 }} /> 10} aria-modal="true" @@ -37,41 +37,39 @@ on:scroll={parseScroll} transition:fade={{ easing: quadInOut, duration: 150 }} > -
-
- {#if fullscreen} - - {/if} - {#if $$slots.icon} - - {/if} - {#if $$slots.title} -

- -

- {/if} -
- - {#if $$slots.description} -

- -

+
+ {#if fullscreen} + {/if} - -
- - {#if $$slots.buttons} -
- -
+ {#if $$slots.icon} + + {/if} + {#if $$slots.title} +

+ +

{/if}
+ + {#if $$slots.description} +

+ +

+ {/if} + +
+ + {#if $$slots.buttons} +
+ +
+ {/if}
{/if} - diff --git a/src/layout/Dialogs/DownloadCompatibilityWarningDialog.svelte b/src/layout/Dialogs/DownloadCompatibilityWarningDialog.svelte new file mode 100644 index 0000000..658221d --- /dev/null +++ b/src/layout/Dialogs/DownloadCompatibilityWarningDialog.svelte @@ -0,0 +1,25 @@ + + + + Warning + {warning} Do you still want to download? + + + + + + + diff --git a/src/lib/components/ImageModal.svelte b/src/layout/Dialogs/ImageDialog.svelte similarity index 77% rename from src/lib/components/ImageModal.svelte rename to src/layout/Dialogs/ImageDialog.svelte index 987a973..3d7806d 100644 --- a/src/lib/components/ImageModal.svelte +++ b/src/layout/Dialogs/ImageDialog.svelte @@ -7,12 +7,12 @@ const dispatch = createEventDispatcher(); - function closeModal() { + function closeDialog() { dispatch('close'); } function handleKeydown(event: KeyboardEvent) { - if (event.key === 'Escape') closeModal(); + if (event.key === 'Escape') closeDialog(); } @@ -20,16 +20,16 @@ - - + diff --git a/src/routes/download/+page.svelte b/src/routes/download/+page.svelte index b57668b..536bcf0 100644 --- a/src/routes/download/+page.svelte +++ b/src/routes/download/+page.svelte @@ -13,7 +13,7 @@ import Query from '$lib/components/Query.svelte'; import Button from '$lib/components/Button.svelte'; import Picture from '$lib/components/Picture.svelte'; - import Dialogue from '$lib/components/Dialogue.svelte'; + import DownloadCompatibilityWarningDialog from '$layout/Dialogs/DownloadCompatibilityWarningDialog.svelte'; import { onMount } from 'svelte'; const query = createQuery(queries.manager()); @@ -69,21 +69,6 @@ ]} /> - - Warning - {warning} Do you still want to download? - - - - - - - -

ReVanced Manager

Patch your favourite apps, right on your device.

@@ -113,6 +98,8 @@
+ + diff --git a/src/layout/Hero/HeroImage.svelte b/src/layout/Hero/HeroImage.svelte index faa47fd..de88dab 100644 --- a/src/layout/Hero/HeroImage.svelte +++ b/src/layout/Hero/HeroImage.svelte @@ -7,17 +7,17 @@
- diff --git a/src/layout/Hero/SocialButton.svelte b/src/layout/Hero/SocialButton.svelte index a97f645..46f75c0 100644 --- a/src/layout/Hero/SocialButton.svelte +++ b/src/layout/Hero/SocialButton.svelte @@ -1,5 +1,6 @@ @@ -7,8 +8,11 @@ {social.name} - diff --git a/src/routes/announcements/TagsHost.svelte b/src/routes/announcements/TagsHost.svelte index daebbaa..b446f55 100644 --- a/src/routes/announcements/TagsHost.svelte +++ b/src/routes/announcements/TagsHost.svelte @@ -49,19 +49,9 @@ /> {/each} - {#if expandable && tags.length > 1} -
  • - -
  • - {/if} -
    + {#if expandable && tags.length > 1} +
  • + +
  • + {/if} +