mirror of
https://github.com/revanced/revanced-website.git
synced 2025-05-25 11:02:17 +02:00
feat: add mobile dropdown
This commit is contained in:
parent
0ab6b7e466
commit
ef9bf6ba0c
@ -1,5 +1,9 @@
|
||||
<script lang="ts">
|
||||
import type { Snippet } from 'svelte';
|
||||
import { slide } from 'svelte/transition';
|
||||
import { quintOut } from 'svelte/easing';
|
||||
|
||||
import ChevronDown from '~icons/mdi/chevron-down';
|
||||
|
||||
type Props = { title: string; children: Snippet };
|
||||
let { title, children }: Props = $props();
|
||||
@ -13,3 +17,19 @@
|
||||
{@render children()}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="mobile-only">
|
||||
<button class="title" onclick={() => (expanded = !expanded)}>
|
||||
<span>
|
||||
{title}
|
||||
</span>
|
||||
<div class="arrow" style:transform={expanded ? 'rotate(180deg)' : 'rotate(0deg)'}>
|
||||
<ChevronDown color="var(--surface-six)" />
|
||||
</div>
|
||||
</button>
|
||||
{#if expanded}
|
||||
<ul transition:slide={{ easing: quintOut, duration: 500 }}>
|
||||
{@render children()}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user