update matrix by swapping canvas buffers

This commit is contained in:
waltem01 2024-02-16 07:22:50 +01:00
parent 6a2e1f48f9
commit 0264a9bd30

View File

@ -10,6 +10,11 @@
let imageURL: string | null, lastImage: File;
let uploadData: UploadData;
async function updateMatrix() {
await fetch('/api/redirect?endpoint=update');
clearInterval(uploadData.interval);
}
async function placeImage() {
const fdata = new FormData();
fdata.append('x', '0');
@ -108,10 +113,15 @@
{#await placeImage()}
<p>Placing image . . .</p>
<p>{uploadData.elapsed} seconds elapsed.</p>
{:then}
{#await updateMatrix()}
<p>Updating matrix . . .</p>
<p>{uploadData.elapsed} seconds elapsed.</p>
{:then}
<p>Done!</p>
<p>{uploadData.elapsed} seconds elapsed.</p>
{/await}
{/await}
{/await}
{/await}
{/if}