Revert "feat: add customizable keyboard navigation"
This commit is contained in:
1 parent
4e7c37bd89
commit
f9a6e775f3
17 files changed
+39
-306
No files matched your search
@@ -34,15 +34,15 @@
|
||||
{@render title?.(open)}
|
||||
</div>
|
||||
{#if icon}
|
||||
<div
|
||||
<Icon
|
||||
src={open ? Minus : Plus}
|
||||
size="16"
|
||||
micro
|
||||
class={[
|
||||
!open && 'rotate-90',
|
||||
'transition-all duration-300 ease-out',
|
||||
'grid place-items-center w-4',
|
||||
'transition-transform duration-300 ease-out',
|
||||
]}
|
||||
>
|
||||
<Icon src={open ? Minus : Plus} size="16" micro />
|
||||
</div>
|
||||
/>
|
||||
{/if}
|
||||
<div
|
||||
class="inset-0 -z-10 opacity-0 absolute bg-slate-200 dark:bg-zinc-900 rounded-full
|
||||
|
||||
@@ -29,21 +29,17 @@
|
||||
let { alt = '', class: clazz = '', children }: Props = $props()
|
||||
</script>
|
||||
|
||||
<svelte:body
|
||||
onkeydown={e => {
|
||||
if (e.key == 'Escape' && (page.state.openImage || '') != '') history.back()
|
||||
}}
|
||||
/>
|
||||
|
||||
{#if page.state.openImage || '' != ''}
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
class="fixed top-0 left-0 w-screen h-svh overflow-auto bg-white/50 dark:bg-black/50
|
||||
flex flex-col z-100 backdrop-blur-xs"
|
||||
transition:fade={{ duration: 150 }}
|
||||
use:focusTrap
|
||||
onclick={() => history.back()}
|
||||
onkeydown={e => {
|
||||
if (e.key == 'Escape') history.back()
|
||||
}}
|
||||
use:focusTrap
|
||||
>
|
||||
<img
|
||||
width={800}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
children?: Snippet
|
||||
animate?: boolean
|
||||
size?: 'lg' | 'md' | 'sm'
|
||||
depth?: 1 | 2
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -22,13 +21,12 @@
|
||||
children,
|
||||
animate = true,
|
||||
size = 'sm',
|
||||
depth = 1,
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<ul class={['space-y-[3px]', depth == 2 && 'secondary']}>
|
||||
<ul class="divide-y-3 divide-slate-50 dark:divide-zinc-925">
|
||||
{#if items}
|
||||
{#each items as item, index}
|
||||
{#each items as item, index (item)}
|
||||
<li
|
||||
class={['group/li', animate && 'animate']}
|
||||
style="--i: {index < 10 ? index * sizeDelay[size] : 0}ms;"
|
||||
@@ -83,22 +81,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
ul.secondary > :global(li) {
|
||||
background-color: var(--color-slate-25);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--color-slate-50);
|
||||
}
|
||||
}
|
||||
|
||||
:global(.dark) ul.secondary > :global(li) {
|
||||
background-color: var(--color-zinc-925);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--color-zinc-800);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes pop-in {
|
||||
from {
|
||||
transform: translateY(16px);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { Modal, Spinner } from 'mono-svelte'
|
||||
|
||||
interface Props {
|
||||
@@ -11,8 +10,8 @@
|
||||
|
||||
function handleKeydown(event: KeyboardEvent) {
|
||||
if (
|
||||
event.key == settings.keybinds.commandPalette.open.key &&
|
||||
document.activeElement == document.body
|
||||
(event.ctrlKey && event.key === 'p') ||
|
||||
(event.key == '/' && document.activeElement == document.body)
|
||||
) {
|
||||
event.preventDefault()
|
||||
open = !open
|
||||
|
||||
Reference in new issue
Block a user