// SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
// For more information, please refer to <https://unlicense.org/>
// SPDX-License-Identifier: Unlicense
// dam-plus-widgets-0.2.js and art-restoration-simulator.js should be loaded before this.
// After this is loaded, call launch() to start the gewgaw.
function launch(config) {
var div=DAM.maker('div'), p=DAM.maker('p'), a=DAM.maker('a'), canvas=DAM.maker('canvas');
var WIDTH = 500;
var HEIGHT = 310;
// width and height of these elements should be set absolutely in CSS.
var panel = div({ id: "panel" });
panel.style.position = 'relative';
panel.style.margin = "auto";
panel.style.marginTop = "0";
config.container.appendChild(panel);
var filthCanvas = canvas({ width: WIDTH, height: HEIGHT });
filthCanvas.style.position = 'absolute';
filthCanvas.style.left = "0";
filthCanvas.style.top = "0";
filthCanvas.style.zIndex = "100";
filthCanvas.style.background = 'transparent';
filthCanvas.style.cursor = "pointer";
var artCanvas = canvas({ width: WIDTH, height: HEIGHT });
artCanvas.style.position = 'absolute';
artCanvas.style.left = "0";
artCanvas.style.top = "0";
artCanvas.style.zIndex = "0";
panel.appendChild(artCanvas);
panel.appendChild(filthCanvas);
var instructions = p(
'When you are finished, see ',
a({ href: "https://static.catseye.tc/archive/feldmangallery.com/media/pdfs/Ukeles_MANIFESTO.pdf" }, "(Ukeles, 1969)"),
' for further instructions'
)
instructions.style.marginTop = "20px";
config.container.appendChild(instructions);
var gewgaw = new ArtRestorationSimulator();
gewgaw.init({
filthCanvas: filthCanvas,
artCanvas: artCanvas,
artUrl: config.artURL || 'art.jpg'
});
}