2023-07-24 04:09:06 +02:00
|
|
|
<script lang="ts">
|
|
|
|
import { createEventDispatcher } from 'svelte';
|
2023-07-27 21:42:27 +02:00
|
|
|
import FullScreenModal from './full-screen-modal.svelte';
|
2024-04-08 21:02:09 +00:00
|
|
|
import { mdiInformationOutline } from '@mdi/js';
|
2024-01-17 20:18:04 +01:00
|
|
|
import Icon from '../elements/icon.svelte';
|
2023-07-24 04:09:06 +02:00
|
|
|
|
2024-01-17 20:18:04 +01:00
|
|
|
interface Shortcuts {
|
|
|
|
general: ExplainedShortcut[];
|
|
|
|
actions: ExplainedShortcut[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ExplainedShortcut {
|
|
|
|
key: string[];
|
|
|
|
action: string;
|
|
|
|
info?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const shortcuts: Shortcuts = {
|
2023-07-24 04:09:06 +02:00
|
|
|
general: [
|
|
|
|
{ key: ['←', '→'], action: 'Previous or next photo' },
|
|
|
|
{ key: ['Esc'], action: 'Back, close, or deselect' },
|
2024-04-08 19:20:24 +02:00
|
|
|
{ key: ['Ctrl', 'k'], action: 'Search your photos' },
|
|
|
|
{ key: ['Ctrl', '⇧', 'k'], action: 'Open the search filters' },
|
2023-07-24 04:09:06 +02:00
|
|
|
],
|
|
|
|
actions: [
|
|
|
|
{ key: ['f'], action: 'Favorite or unfavorite photo' },
|
|
|
|
{ key: ['i'], action: 'Show or hide info' },
|
2024-04-02 09:04:52 -06:00
|
|
|
{ key: ['s'], action: 'Stack selected photos' },
|
2023-07-24 04:09:06 +02:00
|
|
|
{ key: ['⇧', 'a'], action: 'Archive or unarchive photo' },
|
|
|
|
{ key: ['⇧', 'd'], action: 'Download' },
|
|
|
|
{ key: ['Space'], action: 'Play or pause video' },
|
2024-01-17 20:18:04 +01:00
|
|
|
{ key: ['Del'], action: 'Trash/Delete Asset', info: 'press ⇧ to permanently delete asset' },
|
2023-07-24 04:09:06 +02:00
|
|
|
],
|
|
|
|
};
|
2023-12-14 17:55:15 +01:00
|
|
|
const dispatch = createEventDispatcher<{
|
|
|
|
close: void;
|
|
|
|
}>();
|
2023-07-24 04:09:06 +02:00
|
|
|
</script>
|
|
|
|
|
2024-06-01 22:58:35 +00:00
|
|
|
<FullScreenModal title="Keyboard shortcuts" width="auto" onClose={() => dispatch('close')}>
|
2024-04-08 21:02:09 +00:00
|
|
|
<div class="grid grid-cols-1 gap-4 px-4 pb-4 md:grid-cols-2">
|
|
|
|
<div class="p-4">
|
|
|
|
<h2>General</h2>
|
|
|
|
<div class="text-sm">
|
|
|
|
{#each shortcuts.general as shortcut}
|
|
|
|
<div class="grid grid-cols-[30%_70%] items-center gap-4 pt-4 text-sm">
|
|
|
|
<div class="flex justify-self-end">
|
|
|
|
{#each shortcut.key as key}
|
|
|
|
<p class="mr-1 flex items-center justify-center justify-self-end rounded-lg bg-immich-primary/25 p-2">
|
|
|
|
{key}
|
|
|
|
</p>
|
|
|
|
{/each}
|
|
|
|
</div>
|
|
|
|
<p class="mb-1 mt-1 flex">{shortcut.action}</p>
|
2023-07-24 04:09:06 +02:00
|
|
|
</div>
|
2024-04-08 21:02:09 +00:00
|
|
|
{/each}
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-07-24 04:09:06 +02:00
|
|
|
|
2024-04-08 21:02:09 +00:00
|
|
|
<div class="p-4">
|
|
|
|
<h2>Actions</h2>
|
|
|
|
<div class="text-sm">
|
|
|
|
{#each shortcuts.actions as shortcut}
|
|
|
|
<div class="grid grid-cols-[30%_70%] items-center gap-4 pt-4 text-sm">
|
|
|
|
<div class="flex justify-self-end">
|
|
|
|
{#each shortcut.key as key}
|
|
|
|
<p class="mr-1 flex items-center justify-center justify-self-end rounded-lg bg-immich-primary/25 p-2">
|
|
|
|
{key}
|
|
|
|
</p>
|
|
|
|
{/each}
|
|
|
|
</div>
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
<p class="mb-1 mt-1 flex">{shortcut.action}</p>
|
|
|
|
{#if shortcut.info}
|
|
|
|
<Icon path={mdiInformationOutline} title={shortcut.info} />
|
|
|
|
{/if}
|
|
|
|
</div>
|
2023-07-24 04:09:06 +02:00
|
|
|
</div>
|
2024-04-08 21:02:09 +00:00
|
|
|
{/each}
|
2023-07-24 04:09:06 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-07-27 21:42:27 +02:00
|
|
|
</FullScreenModal>
|