aboutsummaryrefslogtreecommitdiff
path: root/static/pages/image-viewer/index.js
blob: 76d720f08209e882262412e4f7be02e0aaa733eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import * as sfw from 'sfw';
const { Div, Img } = sfw.element.native;

const css = await sfw.css(import.meta.url, './index.css')

export default class ImageViewer extends sfw.element.Container {
	#container

	constructor() {
		super({ css });

		this.body.append(
			this.#container = Div.new({ id: 'container' })
		);
	}

	add(url) {
		this.#container.append(Img.new({ src: url }));
	}
}