perf: enable lazy loading of images (?)

feat/type-attributes
Tomáš Mládek 2022-12-18 14:08:33 +01:00
parent 2c41cffce0
commit 36b6e51765
2 changed files with 3 additions and 0 deletions

View File

@ -93,6 +93,7 @@
<img
src="{API_URL}/thumb/{address}?mime=audio"
alt="Thumbnail for {address}..."
loading="lazy"
on:load={() => (imageLoaded = address)}
on:error={() => (handled = false)}
/>
@ -116,6 +117,7 @@
? 'raw'
: 'thumb'}/{address}?size=512&quality=75"
alt="Thumbnail for {address}..."
loading="lazy"
on:load={() => (imageLoaded = address)}
on:error={() => (handled = false)}
/>

View File

@ -73,6 +73,7 @@
class="thumb"
src="{API_URL}/thumb/{address}?mime=video"
alt="Preview for {address}"
loading="lazy"
on:load={() => (state = State.PREVIEW)}
on:mouseover={() => (state = State.PREVIEWING)}
on:error={() => (state = State.ERRORED)}