mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-12-26 12:01:45 +00:00
initialize image page
This commit is contained in:
parent
cd31c576ec
commit
d75b74965b
28
Webserver/src/routes/image/+page.svelte
Normal file
28
Webserver/src/routes/image/+page.svelte
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import type { APIResponse } from '$lib/interfaces';
|
||||||
|
|
||||||
|
interface UploadData {
|
||||||
|
start: number;
|
||||||
|
elapsed: string;
|
||||||
|
interval: NodeJS.Timeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
let imageURL: string, uploadData: UploadData;
|
||||||
|
|
||||||
|
async function loadImage(url: string) {}
|
||||||
|
|
||||||
|
function uploadImage(event: Event) {}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input type="file" name="image" accept="image/*" on:change={uploadImage} />
|
||||||
|
{#if imageURL}
|
||||||
|
<img src={imageURL} alt="User uploaded" />
|
||||||
|
{#await loadImage(imageURL)}
|
||||||
|
<p>Loading image . . .</p>
|
||||||
|
<p>{uploadData.elapsed} seconds elapsed.</p>
|
||||||
|
{:then imageData}
|
||||||
|
<p>Done!</p>
|
||||||
|
<p>{uploadData.elapsed} seconds elapsed.</p>
|
||||||
|
{clearInterval(uploadData.interval)}
|
||||||
|
{/await}
|
||||||
|
{/if}
|
Loading…
Reference in New Issue
Block a user