chore: VideoViewer preview optimization

feat/type-attributes
Tomáš Mládek 2022-09-05 23:49:31 +02:00
parent 423ec7b03a
commit e9f30c3904
1 changed files with 7 additions and 0 deletions

View File

@ -51,11 +51,15 @@
<div class="player" style="--icon-size: {detail ? 100 : 32}px">
{#if state === State.LOADING}
<Spinner />
{/if}
{#if state === State.LOADING || (!detail && state === State.PREVIEW)}
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
<img
class="thumb"
src="api/thumb/{address}?mime=video"
alt="Preview for {address}"
on:load={() => (state = State.PREVIEW)}
on:mouseover={() => (state = State.PREVIEWING)}
on:error={() => (state = State.ERRORED)}
/>
{:else}
@ -92,6 +96,7 @@
flex-direction: column;
}
img,
video {
width: 100%;
max-height: 100%;
@ -134,7 +139,9 @@
pointer-events: none;
}
&.standby,
&.preview {
img,
video {
filter: brightness(0.75);
}