Add responsive and lazy image loading
This commit is contained in:
26
src/routes/[slug]/[[timestamp]]/i/[...item]/+page.svelte
Normal file
26
src/routes/[slug]/[[timestamp]]/i/[...item]/+page.svelte
Normal file
@ -0,0 +1,26 @@
|
||||
<script>
|
||||
import { strf } from '$lib/data/language';
|
||||
|
||||
/** @type {import('./$types').PageData} */
|
||||
export let data;
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
{#if data.item}
|
||||
<img class="image" src="{data.filename}/t/full" alt={(data.item.title ? $strf(data.item.title) : null) || (data.item.description ? $strf(data.item.description) : null) || data.filename} />
|
||||
{:else}
|
||||
Deine Mudda
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
.image {
|
||||
max-width: 100%;
|
||||
max-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user