Skip to content

Commit

Permalink
keyboard shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhorner committed Sep 21, 2024
1 parent f249b85 commit c3f68ff
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/frontend/src/lib/components/SequenceViewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,24 @@
link.click()
}
function handleKeyboardShortcuts(
event: KeyboardEvent & { currentTarget: EventTarget & Window }
) {
if (event.key === "ArrowLeft" && hasPrevious) {
dispatch("previous")
} else if (event.key === "ArrowRight" && hasNext) {
dispatch("next")
}
}
$: projection = new EquirectProjection({ src: imageUrl })
</script>

<div bind:this={el} class="sequence-viewer" transition:fly|global={{ duration: 500, y: 500 }}>
<div
bind:this={el}
class="sequence-viewer"
transition:fly|global={{ duration: 500, y: 500 }}
>
<button
title="Close Image Viewer"
class="close"
Expand Down Expand Up @@ -83,6 +97,8 @@
/>
</div>

<svelte:window on:keydown={handleKeyboardShortcuts} />

<style>
.sequence-viewer {
height: 100%;
Expand Down

0 comments on commit c3f68ff

Please sign in to comment.