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 { #container #subtitle constructor() { super({ css }); this.onnewer = () => {} this.onolder = () => {} this.body.append( this.#container = Div.new({ id: 'container', children: [ this.#subtitle = Div.new({ id: 'subtitle', innerHTML: 'Powered by Memora' }) ], }) ); } add(id) { this.#container.insertBefore(Image.new({ id }), this.#subtitle); } clear() { this.#container.innerHTML = ''; this.#container.append(this.#subtitle); } }