diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-11-19 18:58:54 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-11-19 18:58:54 +0100 |
| commit | 25228df6d13b5e8541672c4cdd84e200ff56a4c4 (patch) | |
| tree | 924cc6bdc00440c6bf592b04602261cdab17d60a /static/pages/image-viewer/index.js | |
| parent | 4c06eb64cbed3562e428ce59857d1763098638f3 (diff) | |
add profile settings to backend and add image loader
Diffstat (limited to 'static/pages/image-viewer/index.js')
| -rw-r--r-- | static/pages/image-viewer/index.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/static/pages/image-viewer/index.js b/static/pages/image-viewer/index.js index d28b3e1..0cf8598 100644 --- a/static/pages/image-viewer/index.js +++ b/static/pages/image-viewer/index.js @@ -1,6 +1,8 @@ import * as sfw from 'sfw'; const { Div, Img } = sfw.element.native; +import Image from '../../widgets/image/index.js'; + const css = await sfw.css(import.meta.url, './index.css') export default class ImageViewer extends sfw.element.Container { @@ -9,19 +11,16 @@ export default class ImageViewer extends sfw.element.Container { constructor() { super({ css }); + this.onnewer = () => {} + this.onolder = () => {} + this.body.append( this.#container = Div.new({ id: 'container' }) ); } - add(url) { - let image; - this.#container.append( - image = Img.new({ - className: 'hidden', - src: url, - onload: () => image.classList.remove('hidden') - })); + add(id) { + this.#container.append(Image.new({ id })) } clear() { |