mirror of
https://github.com/revanced/revanced-website.git
synced 2025-05-08 10:24:28 +02:00
chore: remove autscroll and name from modal
This commit is contained in:
parent
a8645caf6f
commit
44ae5c73e4
@ -7,7 +7,6 @@
|
|||||||
import previous from '$lib/assets/icons/previous.svg';
|
import previous from '$lib/assets/icons/previous.svg';
|
||||||
import type { APILogo } from '$lib/types';
|
import type { APILogo } from '$lib/types';
|
||||||
|
|
||||||
export let name = '';
|
|
||||||
export let selected: string[];
|
export let selected: string[];
|
||||||
export let variants: APILogo[];
|
export let variants: APILogo[];
|
||||||
export let clicked = false;
|
export let clicked = false;
|
||||||
@ -23,15 +22,6 @@
|
|||||||
if (!hasVariants) {
|
if (!hasVariants) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
interval = setInterval(() => {
|
|
||||||
if (i === variants.length - 1) {
|
|
||||||
i = 0;
|
|
||||||
} else {
|
|
||||||
i += 1;
|
|
||||||
}
|
|
||||||
}, 2500) as unknown as number; // stfu typescript
|
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function select_logo(id: string) {
|
function select_logo(id: string) {
|
||||||
@ -62,10 +52,6 @@
|
|||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopAutoScroll() {
|
|
||||||
clearInterval(interval);
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
if (!hasVariants) {
|
if (!hasVariants) {
|
||||||
select_logo(current.id);
|
select_logo(current.id);
|
||||||
@ -79,7 +65,7 @@
|
|||||||
|
|
||||||
{#if hasVariants}
|
{#if hasVariants}
|
||||||
<Modal bind:modalOpen>
|
<Modal bind:modalOpen>
|
||||||
<svelte:fragment slot="title">{name}</svelte:fragment>
|
<svelte:fragment slot="title">Select a variant</svelte:fragment>
|
||||||
<div class="variants">
|
<div class="variants">
|
||||||
{#each variants as variant}
|
{#each variants as variant}
|
||||||
<!-- Mega Trolley -->
|
<!-- Mega Trolley -->
|
||||||
@ -98,7 +84,7 @@
|
|||||||
<!-- SHUT UP -->
|
<!-- SHUT UP -->
|
||||||
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
||||||
<div class="option" tabindex="0" class:clicked>
|
<div class="option" tabindex="0" class:clicked>
|
||||||
<div class="row" on:click={handleClick} on:keypress={handleClick}>
|
<div class="row" on:click|stopPropagation={handleClick} on:keypress={handleClick}>
|
||||||
<!-- Screenreader compatibility does not make sense in this context. -->
|
<!-- Screenreader compatibility does not make sense in this context. -->
|
||||||
<img src={current.gdrive_direct_url} alt="" />
|
<img src={current.gdrive_direct_url} alt="" />
|
||||||
</div>
|
</div>
|
||||||
@ -108,7 +94,6 @@
|
|||||||
<div class="action-buttons">
|
<div class="action-buttons">
|
||||||
<Button
|
<Button
|
||||||
on:click={prevVariant}
|
on:click={prevVariant}
|
||||||
on:click={stopAutoScroll}
|
|
||||||
unclickable={i <= 0}
|
unclickable={i <= 0}
|
||||||
icon={previous}
|
icon={previous}
|
||||||
alt="previous"
|
alt="previous"
|
||||||
@ -116,7 +101,6 @@
|
|||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
on:click={nextVariant}
|
on:click={nextVariant}
|
||||||
on:click={stopAutoScroll}
|
|
||||||
unclickable={i + 1 >= variants.length}
|
unclickable={i + 1 >= variants.length}
|
||||||
icon={next}
|
icon={next}
|
||||||
alt="next"
|
alt="next"
|
||||||
@ -136,6 +120,7 @@
|
|||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
background-color: var(--grey-six);
|
background-color: var(--grey-six);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
@ -156,7 +141,7 @@
|
|||||||
border-radius: 0 0 16px 16px;
|
border-radius: 0 0 16px 16px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-buttons {
|
.action-buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -171,31 +156,9 @@
|
|||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: 500;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4 {
|
|
||||||
font-weight: 800;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text {
|
|
||||||
width: 100%;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.clicked {
|
.clicked {
|
||||||
background-color: var(--accent-low-opacity);
|
background-color: var(--accent-low-opacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
.clicked h2 {
|
|
||||||
color: var(--white);
|
|
||||||
}
|
|
||||||
|
|
||||||
.option:hover {
|
.option:hover {
|
||||||
filter: brightness(0.85);
|
filter: brightness(0.85);
|
||||||
}
|
}
|
||||||
@ -204,19 +167,7 @@
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
height: 125px;
|
height: 125px;
|
||||||
width: 125px;
|
width: 125px;
|
||||||
/* background-color: var(--grey-two); */
|
|
||||||
transition: transform 0.4s var(--bezier-one);
|
transition: transform 0.4s var(--bezier-one);
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 768px) {
|
|
||||||
|
|
||||||
.text {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.variants {
|
|
||||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -345,12 +345,6 @@
|
|||||||
margin-bottom: -0.5rem;
|
margin-bottom: -0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* "How does this work?" Modal */
|
|
||||||
h6 {
|
|
||||||
color: var(--white);
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttons-container {
|
.buttons-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
@ -387,17 +381,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
|
||||||
background-color: transparent;
|
|
||||||
border: none;
|
|
||||||
border: 1px solid #9e8c90;
|
|
||||||
color: #ece0e1;
|
|
||||||
padding: 0.5rem 1.25rem;
|
|
||||||
border-radius: 8px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-container {
|
.top-container {
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
background-color: var(--accent-color);
|
background-color: var(--accent-color);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user