refactor: Component style cleanup

This commit is contained in:
Ushie
2025-06-14 02:45:43 +03:00
parent d29c29361c
commit 32c0bbb3d4
18 changed files with 232 additions and 303 deletions

View File

@@ -22,6 +22,6 @@
</head>
<body>
%sveltekit.body%
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View File

@@ -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;

View File

@@ -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 @@
});
</script>
<Divider horizontalPadding={'15px'} />
<footer in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<svg
aria-hidden="true"
width="100%"
height="8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
in:fly={{ y: 10, easing: quintOut, duration: 750 }}
>
<pattern id="a" width="91" height="8" patternUnits="userSpaceOnUse">
<path
d="M114 4c-5.067 4.667-10.133 4.667-15.2 0S88.667-.667 83.6 4 73.467 8.667 68.4 4 58.267-.667 53.2 4 43.067 8.667 38 4 27.867-.667 22.8 4 12.667 8.667 7.6 4-2.533-.667-7.6 4s-10.133 4.667-15.2 0S-32.933-.667-38 4s-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0"
stroke-linecap="square"
/>
</pattern>
<rect width="100%" height="100%" fill="url(#a)" />
</svg>
<div class="footer-wrapper">
<div class="footer-top">
<section class="main-content">
<img src="/logo.svg" class="logo-image" alt="ReVanced Logo" />
<Query query={aboutQuery} let:data>
{#if data}
<div>
<p>
{data.about.about}
</p>
</div>
{/if}
</Query>
</section>
<section class="links-container">
<FooterSection title="Pages">
<li><a href="/">Home</a></li>
<li><a href="/download">Download</a></li>
<li><a href="/patches">Patches</a></li>
<li><a href="/contributors">Contributors</a></li>
<li><a href="/donate">Donate</a></li>
</FooterSection>
<Query query={aboutQuery} let:data>
{#if data}
<FooterSection title="Socials">
{#each data.about.socials as { name, url }}
<li>
<a href={url} target="_blank" rel="noreferrer">{name}</a>
</li>
{/each}
</FooterSection>
{/if}
</Query>
</section>
</div>
<div class="footer-bottom">
<div id="logo-name"><span>Re</span>Vanced</div>
<a href="/donate"><div>Donate</div></a>
<div class="top">
<section class="main-content">
<img src="/logo.svg" class="logo-image" alt="ReVanced Logo" />
<Query query={aboutQuery} let:data>
{#if data}
<a href="mailto:{data.about.contact.email}"><div>Email</div></a>
<div>
<p>
{data.about.about}
</p>
</div>
{/if}
</Query>
<!-- DMCA Protection Badge -->
<a
href="//www.dmca.com/Protection/Status.aspx?ID={RV_DMCA_GUID}&refurl={location}"
title="DMCA.com Protection Status"
class="dmca-badge"
>
<img
src="https://images.dmca.com/Badges/dmca-badge-w150-5x1-08.png?ID={RV_DMCA_GUID}"
alt="DMCA.com Protection Status"
/></a
>
</div>
</section>
<section class="links-container">
<FooterSection title="Pages">
<li><a href="/">Home</a></li>
<li><a href="/download">Download</a></li>
<li><a href="/patches">Patches</a></li>
<li><a href="/contributors">Contributors</a></li>
<li><a href="/donate">Donate</a></li>
</FooterSection>
<Query query={aboutQuery} let:data>
{#if data}
<FooterSection title="Socials">
{#each data.about.socials as { name, url }}
<li>
<a href={url} target="_blank" rel="noreferrer">{name}</a>
</li>
{/each}
</FooterSection>
{/if}
</Query>
</section>
</div>
<div class="bottom">
<div id="logo-name"><span>Re</span>Vanced</div>
<a href="/donate"><div>Donate</div></a>
<Query query={aboutQuery} let:data>
{#if data}
<a href="mailto:{data.about.contact.email}"><div>Email</div></a>
{/if}
</Query>
<!-- DMCA Protection Badge -->
<a
href="//www.dmca.com/Protection/Status.aspx?ID={RV_DMCA_GUID}&refurl={location}"
title="DMCA.com Protection Status"
class="dmca-badge"
>
<img
src="https://images.dmca.com/Badges/dmca-badge-w150-5x1-08.png?ID={RV_DMCA_GUID}"
alt="DMCA.com Protection Status"
/>
</a>
</div>
</footer>
<style>
<style lang="scss">
footer {
background-color: var(--background-one);
}
.footer-wrapper {
max-width: min(87%, 100rem);
padding: 5rem 0rem;
margin: 0 auto;
}
.footer-top {
display: flex;
gap: 8rem;
justify-content: space-between;
margin-bottom: 4rem;
}
.top {
display: flex;
gap: 8rem;
justify-content: space-between;
margin-bottom: 4rem;
.footer-bottom {
display: flex;
gap: 2rem;
align-items: center;
@media (max-width: 1050px) {
flex-direction: column;
gap: 2rem;
}
}
.bottom {
display: flex;
gap: 2rem;
align-items: center;
a {
text-decoration: none;
color: var(--text-four);
font-weight: 600;
}
@media (max-width: 768px) {
flex-wrap: wrap;
gap: 1rem;
}
}
}
.dmca-badge {
@@ -125,27 +123,14 @@
align-items: center;
}
@media screen and (max-width: 768px) {
.footer-bottom {
flex-wrap: wrap;
gap: 1rem;
}
}
#logo-name {
font-size: 1.4rem;
color: var(--text-one);
font-weight: 600;
}
#logo-name span {
color: var(--primary);
}
.footer-bottom a {
text-decoration: none;
color: var(--text-four);
font-weight: 600;
span {
color: var(--primary);
}
}
li {
@@ -153,12 +138,12 @@
color: var(--text-four);
font-size: 0.9rem;
font-weight: 500;
}
li a {
color: var(--primary);
font-weight: 600;
font-size: 0.95rem;
a {
color: var(--primary);
font-weight: 600;
font-size: 0.95rem;
}
}
path {
@@ -178,42 +163,28 @@
a {
text-decoration: none;
}
a:hover {
text-decoration: underline var(--secondary);
color: var(--text-one);
&:hover {
text-decoration: underline var(--secondary);
color: var(--text-one);
}
}
.links-container {
display: flex;
gap: 10rem;
margin-top: 1rem;
}
@media screen and (max-width: 1050px) {
.footer-top {
flex-direction: column;
gap: 2rem;
}
.links-container {
@media (max-width: 1050px) {
display: grid;
gap: 2rem;
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}
}
@media screen and (max-width: 768px) {
.links-container {
@media (max-width: 768px) {
display: flex;
flex-direction: column;
gap: initial;
}
}
svg {
padding-left: 15px;
padding-right: 15px;
}
</style>

View File

@@ -59,7 +59,7 @@
user-select: none;
}
@media screen and (max-width: 768px) {
@media (max-width: 768px) {
.mobile-only {
display: block;
}

View File

@@ -17,7 +17,7 @@
<p>
Customize your mobile experience through ReVanced <br /> by applying patches to your applications.
</p>
<div class="hero-buttons-container">
<div class="buttons-container">
<div class="hero-buttons internal-buttons">
<Button type="filled" icon={TrayArrowDown} href="download">Download</Button>
<Button type="tonal" icon={FileDocumentOutline} href="patches">View patches</Button>
@@ -34,83 +34,59 @@
</div>
</section>
<style>
h1 {
color: var(--text-one);
}
.hero-buttons-container {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.social-buttons {
max-width: 30rem;
position: absolute;
bottom: 1rem;
transition: opacity 0.1s var(--bezier-one);
}
.hero-buttons {
flex-wrap: wrap;
display: flex;
user-select: none;
gap: 1rem;
}
<style lang="scss">
.hero {
padding-top: 10vh;
display: flex;
flex-direction: column;
gap: 1rem;
}
span {
color: var(--primary);
}
@media screen and (max-width: 1100px) {
.hero {
padding-top: initial;
@media (min-width: 1100px) {
padding-top: 10vh;
}
}
@media screen and (max-width: 450px) {
.internal-buttons {
h1 {
color: var(--text-one);
}
span {
color: var(--primary);
}
.buttons-container {
display: flex;
flex-direction: column;
gap: 1rem;
}
gap: 2.5rem;
.social-buttons {
left: 50%;
transform: translateX(-50%);
justify-content: center;
width: 100%;
}
.social-buttons {
max-width: 30rem;
position: absolute;
bottom: 1rem;
transition: opacity 0.1s var(--bezier-one);
.hero {
height: initial;
}
}
@media (max-width: 450px) {
justify-content: center;
left: 0;
}
@media screen and (max-width: 1100px) or (min-height: 780px) {
.social-buttons {
transform: translateX(-50%);
width: 90%;
position: absolute;
left: initial;
transform: initial;
}
}
@media (max-height: 600px), (max-width: 450px) and (max-height: 780px) {
position: static;
opacity: 100% !important;
}
}
@media screen and (max-height: 780px) {
.social-buttons {
transform: initial;
left: initial;
position: initial;
width: initial;
opacity: 100% !important;
.hero-buttons {
flex-wrap: wrap;
display: flex;
user-select: none;
gap: 1rem;
@media (max-width: 450px) {
&.internal-buttons {
flex-direction: column;
gap: 1rem;
}
}
}
}
}
</style>

View File

@@ -91,13 +91,13 @@
</ul>
</div>
<div id="secondary-navigation">
<button
on:click={() => (modals.settings = !modals.settings)}
class:selected={modals.settings}
aria-label="Settings"
>
<Cog size="20px" color={modals.settings ? 'var(--primary)' : 'var(--surface-six)'} />
</button>
<button
on:click={() => (modals.settings = !modals.settings)}
class:selected={modals.settings}
aria-label="Settings"
>
<Cog size="20px" color={modals.settings ? 'var(--primary)' : 'var(--surface-six)'} />
</button>
</div>
</div>
</div>
@@ -256,7 +256,7 @@
}
}
@media screen and (min-width: 768px) {
@media (min-width: 768px) {
.mobile-only {
display: none !important;
}

View File

@@ -1,4 +1,15 @@
<svg aria-hidden="true" width="100%" height="8" fill="none" xmlns="http://www.w3.org/2000/svg">
<script>
export let horizontalPadding;
</script>
<svg
style:padding-inline={horizontalPadding}
aria-hidden="true"
width="100%"
height="8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<pattern id="a" width="91" height="8" patternUnits="userSpaceOnUse">
<path
d="M114 4c-5.067 4.667-10.133 4.667-15.2 0S88.667-.667 83.6 4 73.467 8.667 68.4 4 58.267-.667 53.2 4 43.067 8.667 38 4 27.867-.667 22.8 4 12.667 8.667 7.6 4-2.533-.667-7.6 4s-10.133 4.667-15.2 0S-32.933-.667-38 4s-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0"

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -17,7 +17,7 @@
{/if}
</button>
<style>
<style lang="scss">
button {
font-family: var(--font-two);
border: none;
@@ -32,18 +32,11 @@
display: flex;
align-items: center;
gap: 8px;
&.selected {
background-color: var(--tertiary);
color: var(--primary);
}
}
.selected {
background-color: var(--tertiary);
color: var(--primary);
}
#dropdown {
margin-right: -6px;
}
#check {
margin-left: -6px;
}
</style>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { slide, fade } from 'svelte/transition';
import { expoOut } from 'svelte/easing';
import { backIn, expoOut } from 'svelte/easing';
import { slide } from 'svelte/transition';
export let open = false;
export let dismissTime = 3000;
@@ -13,47 +13,32 @@
</script>
{#if open}
<div
class="snackbar"
in:slide={{ duration: 400, easing: expoOut }}
out:fade={{ duration: 300, easing: expoOut }}
>
<div class="text">
<slot name="text" />
</div>
<div id="snackbar" in:slide={{ duration: 400, easing: expoOut }} out:slide={{ duration: 300, easing: backIn }}>
<slot name="text" />
</div>
{/if}
<style lang="scss">
.snackbar {
<style>
#snackbar {
display: flex;
box-sizing: border-box;
justify-content: space-between;
padding-top: 0.25rem;
padding-bottom: 0.25rem;
padding-left: 1rem;
padding-right: 0.5rem;
height: 3rem;
gap: 1.5rem;
align-items: center;
position: fixed;
bottom: 2rem;
left: 2rem;
padding: 0.5rem 1rem;
border-radius: 0.25rem;
min-width: 12.5rem;
max-width: 35rem;
position: fixed;
margin-left: 2.25rem;
margin-right: 2.25rem;
z-index: 8;
left: 0;
right: 0;
bottom: 2rem;
background-color: var(--surface-one);
transition: all 0.4s var(--bezier-one);
box-shadow: var(--drop-shadow-one);
}
height: 3rem;
.text {
background: var(--surface-one);
color: var(--text-two);
font-weight: 500;
box-shadow: var(--drop-shadow-one);
font-size: 14px;
font-weight: 500;
z-index: 10;
}
</style>

View File

@@ -1,30 +1,30 @@
<div class="spinner" />
<div id="spinner" />
<style>
<style lang="scss">
@keyframes spinner {
to {
transform: rotate(360deg);
}
}
.spinner {
#spinner {
position: fixed;
top: 50%;
left: 50%;
width: 50px;
height: 50px;
transform: translate(-50%, -50%);
}
.spinner:before {
content: '';
box-sizing: border-box;
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
border: 4.5px solid transparent;
border-top-color: var(--primary);
animation: spinner 0.6s linear infinite;
&:before {
content: '';
box-sizing: border-box;
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
border: 4.5px solid transparent;
border-top-color: var(--primary);
animation: spinner 0.6s linear infinite;
}
}
</style>

View File

@@ -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;
}
}
</style>

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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;

View File

@@ -33,7 +33,7 @@
{name}
</div>
<style>
<style lang="scss">
.package {
padding: 0.75rem 1rem;
font-size: 0.85rem;
@@ -48,19 +48,17 @@
transition: background-color 0.4s var(--bezier-one);
color: var(--text-four);
transition: color 0.3s var(--bezier-one);
}
.selected {
color: var(--primary);
transition: color 0.3s var(--bezier-one);
background-color: var(--tertiary);
}
.package:hover:not(.selected) {
background-color: var(--surface-seven);
}
&.selected {
color: var(--primary);
transition: color 0.3s var(--bezier-one);
background-color: var(--tertiary);
}
.package:not(.selected):hover {
color: var(--text-one);
&:hover:not(.selected) {
background-color: var(--surface-seven);
color: var(--text-one);
}
}
@media (max-width: 767px) {

View File

@@ -6,7 +6,7 @@
</div>
</div>
<style>
<style lang="scss">
.menu {
height: calc(100vh - 60px);
width: 100%;
@@ -17,13 +17,13 @@
top: 60px;
padding-top: calc(6rem - 60px);
overflow-y: scroll;
}
.menu::-webkit-scrollbar-thumb {
background-color: transparent;
}
.menu:hover::-webkit-scrollbar-thumb {
background-color: var(--primary);
&::-webkit-scrollbar-thumb {
background-color: transparent;
}
&:hover::-webkit-scrollbar-thumb {
background-color: var(--primary);
}
}
.slot {

View File

@@ -19,6 +19,7 @@
</script>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="patch-container"
class:expanded={hasPatchOptions}
@@ -99,6 +100,7 @@
<span transition:fade={{ easing: quintOut, duration: 1000 }}>
<div class="options" transition:slide={{ easing: quintOut, duration: 500 }}>
{#each options as option}
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="option" on:click|stopPropagation>
<h5 id="option-title">{option.title}</h5>
<h5>