aboutsummaryrefslogtreecommitdiff
path: root/static/pages/image-viewer/index.js
blob: 0cf8598520434548750501d9cd9f9910acfb5c67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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

	constructor() {
		super({ css });

		this.onnewer = () => {}
		this.onolder = () => {}

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

	add(id) {
		this.#container.append(Image.new({ id }))
	}

	clear() {
		this.#container.innerHTML = '';
	}
}