pdufour commited on
Commit
4492c02
1 Parent(s): bfdabe3

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +4 -3
index.js CHANGED
@@ -19,6 +19,7 @@ const promptInput = document.querySelector('input[type="text"]');
19
  const status = document.getElementById('status');
20
  const imageContainer = document.getElementById('container');
21
  const example = document.getElementById('example');
 
22
  const uploadInput = document.getElementById('upload');
23
  const form = document.getElementById('form');
24
 
@@ -357,9 +358,9 @@ async function updatePreview(url) {
357
  const image = await RawImage.fromURL(url);
358
  const ar = image.width / image.height;
359
  const [cw, ch] = (ar > 1) ? [640, 640 / ar] : [640 * ar, 640];
360
- imageContainer.style.width = `${cw}px`;
361
- imageContainer.style.height = `${ch}px`;
362
- imageContainer.style.backgroundImage = `url(${url})`;
363
  }
364
 
365
  await initializeSessions();
 
19
  const status = document.getElementById('status');
20
  const imageContainer = document.getElementById('container');
21
  const example = document.getElementById('example');
22
+ const thumb = document.getElementById('thumb');
23
  const uploadInput = document.getElementById('upload');
24
  const form = document.getElementById('form');
25
 
 
358
  const image = await RawImage.fromURL(url);
359
  const ar = image.width / image.height;
360
  const [cw, ch] = (ar > 1) ? [640, 640 / ar] : [640 * ar, 640];
361
+ thumb.style.width = `${cw}px`;
362
+ thumb.style.height = `${ch}px`;
363
+ thumb.style.backgroundImage = `url(${url})`;
364
  }
365
 
366
  await initializeSessions();