24 lines
975 B
JavaScript
24 lines
975 B
JavaScript
|
|
// Head-element setup for catcrafts.net. The Crafter.Graphics Dom partition
|
||
|
|
// only exposes element creation under <body>, so anything that has to live in
|
||
|
|
// <head> (title, stylesheet link, favicon link) gets injected from this
|
||
|
|
// loader. EnableWasiBrowserRuntime auto-picks up every *.js in cfg.files and
|
||
|
|
// emits a <script type="module"> tag for it ahead of runtime.js, so this
|
||
|
|
// runs before the wasm module starts and styles are in place by first paint.
|
||
|
|
|
||
|
|
document.title = "Catcrafts.net";
|
||
|
|
|
||
|
|
const styles = document.createElement("link");
|
||
|
|
styles.rel = "stylesheet";
|
||
|
|
styles.href = "styles.css";
|
||
|
|
document.head.appendChild(styles);
|
||
|
|
|
||
|
|
const favicon = document.createElement("link");
|
||
|
|
favicon.rel = "icon";
|
||
|
|
favicon.type = "image/svg+xml";
|
||
|
|
favicon.href = "favicon.svg";
|
||
|
|
document.head.appendChild(favicon);
|
||
|
|
|
||
|
|
const viewport = document.createElement("meta");
|
||
|
|
viewport.name = "viewport";
|
||
|
|
viewport.content = "width=device-width, initial-scale=1.0";
|
||
|
|
document.head.appendChild(viewport);
|