Migrate to crafter-build project.cpp and restructure views
- Replace project.json + run.sh with a C++ project.cpp build descriptor (crafter-build), targeting wasm32-wasip1 with the Crafter.Graphics dep - Add Catcrafts-Views implementation; drop Catcrafts-Component - Add catcrafts-head.js (sets <title>/<link> tags at runtime) - Update Blog/Root/main modules, README, and favicon Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d87c408712
commit
13a12c2a2c
15 changed files with 227 additions and 126 deletions
24
catcrafts-head.js
Normal file
24
catcrafts-head.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// 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);
|
||||
Loading…
Reference in a new issue