Toggle audio/video playback with spacebar

This commit is contained in:
2024-04-11 20:32:55 +02:00
parent 5f6cc3f90f
commit a0ccbb55be
13 changed files with 67 additions and 28 deletions

View File

@@ -10,10 +10,15 @@ let container
let zoom = false
let x, y = 0
let dragging = false
let container_style = ""
export const update = () => {
container_style = ""
dispatch("loading", true)
}
let swipe_style = ""
const on_load = () => {
dispatch("loading", false)
swipe_style = ""
}
const mousedown = (e) => {
@@ -58,17 +63,20 @@ const mouseup = (e) => {
class="container"
class:zoom
use:swipe_nav={!zoom}
on:style={e => container_style = e.detail}
on:style={e => swipe_style = e.detail}
on:prev={() => dispatch("open_sibling", -1)}
on:next={() => dispatch("open_sibling", 1)}
style={container_style}
>
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
<img
on:dblclick={() => {zoom = !zoom}}
on:doubletap={() => {zoom = !zoom}}
on:mousedown={mousedown}
class="image" class:zoom
on:load={on_load}
on:error={on_load}
class="image"
class:zoom
style={swipe_style}
src={fs_path_url(state.base.path)}
alt="no description available" />
</div>