mirror of
https://github.com/ReVanced/revanced-website.git
synced 2026-01-25 11:51:03 +00:00
feat: improved patches page ui
This commit is contained in:
50
src/lib/components/FilterChip.svelte
Normal file
50
src/lib/components/FilterChip.svelte
Normal file
@@ -0,0 +1,50 @@
|
||||
<script>
|
||||
export let dropdown = false;
|
||||
export let check = false;
|
||||
export let selected = false;
|
||||
</script>
|
||||
|
||||
<button class:selected on:click>
|
||||
{#if check}
|
||||
<img id="check" src="/icons/check.svg" alt="selected" />
|
||||
{/if}
|
||||
<slot />
|
||||
{#if dropdown}
|
||||
<img id="dropdown" src="/icons/arrow.svg" alt="dropdown" />
|
||||
{/if}
|
||||
</button>
|
||||
|
||||
<style>
|
||||
button {
|
||||
font-family: var(--font-two);
|
||||
border: none;
|
||||
border: 1.5px solid var(--grey-three);
|
||||
background-color: transparent;
|
||||
color: var(--grey-five);
|
||||
height: 32px;
|
||||
padding: 0 16px;
|
||||
border-radius: 8px;
|
||||
font-size: 0.85rem;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.selected {
|
||||
background-color: var(--accent-low-opacity);
|
||||
color: var(--accent-color);
|
||||
}
|
||||
|
||||
img {
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
#dropdown {
|
||||
margin-right: -6px;
|
||||
}
|
||||
|
||||
#check {
|
||||
margin-left: -6px;
|
||||
}
|
||||
</style>
|
||||
@@ -17,7 +17,19 @@
|
||||
aria-modal="true"
|
||||
transition:fade={{ easing: quadInOut, duration: 250 }}
|
||||
>
|
||||
<slot />
|
||||
<div class="title">
|
||||
<h3>
|
||||
<slot name="title" />
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
{#if $$slots.description}
|
||||
<p>
|
||||
<slot name="description" />
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
<div class="slot"><slot /></div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -32,13 +44,30 @@
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
h3 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
position: sticky;
|
||||
padding-top: 46px;
|
||||
padding-bottom: 20px;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
background-color: var(--grey-six);
|
||||
}
|
||||
p {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.modal {
|
||||
position: fixed;
|
||||
width: min(85%, 425px);
|
||||
max-height: 75%;
|
||||
overflow-y: scroll;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
padding: 46px 36px;
|
||||
border-radius: 26px;
|
||||
background-color: var(--grey-six);
|
||||
display: flex;
|
||||
@@ -52,4 +81,12 @@
|
||||
box-shadow: 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12),
|
||||
0px 2px 4px -1px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.slot {
|
||||
padding: 0px 28px 36px 28px;
|
||||
}
|
||||
|
||||
.modal::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<div class="search-container">
|
||||
<img src="../icons/search.svg" id="search" alt="Search" />
|
||||
{#if searchTerm}
|
||||
<img
|
||||
@@ -37,50 +37,51 @@
|
||||
/* umm dont ask */
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
left: 23px;
|
||||
top: 52px;
|
||||
left: 16px;
|
||||
top: 14px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
#clear {
|
||||
position: absolute;
|
||||
right: 42px;
|
||||
top: 52px;
|
||||
right: 16px;
|
||||
top: 14px;
|
||||
z-index: 1;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.clear {
|
||||
padding-right: 2.5rem;
|
||||
.search-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
input {
|
||||
position: relative;
|
||||
display: flex;
|
||||
padding: 1rem 3rem;
|
||||
padding: 1rem 3.25rem;
|
||||
width: 100%;
|
||||
color: var(--accent-color-two);
|
||||
font-weight: 500;
|
||||
font-size: 0.92rem;
|
||||
border-radius: 100px;
|
||||
border: none;
|
||||
background-color: var(--grey-ten);
|
||||
}
|
||||
|
||||
|
||||
input::placeholder {
|
||||
color: var(--grey-eight);
|
||||
font-size: 0.9rem;
|
||||
color: var(--grey-five);
|
||||
font-size: 0.92rem;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s var(--bezier-one);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
#search {
|
||||
left: 26px;
|
||||
top: 38px;
|
||||
}
|
||||
input:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#clear {
|
||||
right: 26px;
|
||||
top: 38px;
|
||||
}
|
||||
|
||||
input {
|
||||
background-color: var(--grey-ten);
|
||||
border: none;
|
||||
border-radius: 100px;
|
||||
}
|
||||
input:focus::placeholder {
|
||||
outline: none;
|
||||
color: var(--accent-color)
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<script>
|
||||
import { fade } from "svelte/transition";
|
||||
import { fade } from 'svelte/transition';
|
||||
</script>
|
||||
<div class="spinner" transition:fade={{duration: 250}}/>
|
||||
|
||||
<div class="spinner-container">
|
||||
<div class="spinner" transition:fade={{ duration: 250 }} />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@keyframes spinner {
|
||||
@@ -10,12 +13,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
.spinner:before {
|
||||
content: '';
|
||||
box-sizing: border-box;
|
||||
.spinner-container {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.spinner:before {
|
||||
content: '';
|
||||
box-sizing: border-box;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<div class="menu">
|
||||
<div class="slot">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.menu {
|
||||
height: calc(100vh - 60px);
|
||||
width: 100%;
|
||||
padding: 0px 30px 30px 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: sticky;
|
||||
top: 70px;
|
||||
padding-top: calc(6rem - 70px);
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.menu::-webkit-scrollbar-thumb {
|
||||
background-color: transparent;
|
||||
}
|
||||
.menu:hover::-webkit-scrollbar-thumb {
|
||||
background-color: var(--accent-color);
|
||||
}
|
||||
|
||||
.slot {
|
||||
margin-top: 0.75rem;
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-direction: column;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
|
||||
.menu {
|
||||
padding: 0.75rem;
|
||||
height: unset;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,77 +0,0 @@
|
||||
<script lang="ts">
|
||||
export let selectedPkg: string | boolean;
|
||||
export let name: string;
|
||||
|
||||
function handleClick() {
|
||||
selectedPkg = selectedPkg === name ? false : name
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div
|
||||
class="package"
|
||||
class:selected={selectedPkg === name}
|
||||
on:click={handleClick}
|
||||
>
|
||||
{name}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.package {
|
||||
padding: 0.6rem 1rem;
|
||||
font-size: 0.9rem;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
width: 100%;
|
||||
user-select: none;
|
||||
transition: background-color 0.4s var(--bezier-one);
|
||||
}
|
||||
|
||||
.package{
|
||||
color: var(--grey-five);
|
||||
transition: color 0.3s var(--bezier-one);
|
||||
}
|
||||
|
||||
.selected {
|
||||
color: var(--grey-four);
|
||||
transition: color 0.3s var(--bezier-one);
|
||||
}
|
||||
|
||||
.selected {
|
||||
background-color: var(--accent-color);
|
||||
}
|
||||
.package:hover:not(.selected) {
|
||||
background-color: var(--grey-six);
|
||||
}
|
||||
|
||||
.package:not(.selected):hover {
|
||||
color: var(--white);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.package {
|
||||
border-radius: 12px;
|
||||
padding: 0.5rem 1rem;
|
||||
width: max-content;
|
||||
background-color: transparent;
|
||||
border: 1px solid var(--grey-three);
|
||||
}
|
||||
|
||||
.package{
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: var(--accent-color);
|
||||
}
|
||||
|
||||
.selected {
|
||||
background-color: var(--accent-low-opacity);
|
||||
}
|
||||
.package:not(.selected):hover {
|
||||
color: var(--grey-five);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user