- 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>
51 lines
1.5 KiB
C++
51 lines
1.5 KiB
C++
/*
|
|
catcrafts.net
|
|
Copyright (C) 2026 Catcrafts
|
|
|
|
The source code of this website is made available for viewing purposes only.
|
|
No permission is granted to copy, modify, distribute, or create derivative works.
|
|
*/
|
|
|
|
export module Catcrafts:Views_impl;
|
|
import :Views;
|
|
import Crafter.Graphics;
|
|
import std;
|
|
|
|
using namespace Crafter;
|
|
|
|
namespace Catcrafts {
|
|
namespace {
|
|
// Owning handle for the page-chrome root. `std::optional` lets us
|
|
// defer construction until InitializePage() runs (the CreateInBody
|
|
// call would otherwise fire at static-init time, before main()).
|
|
std::optional<Dom::HtmlElement> root;
|
|
}
|
|
|
|
void InitializePage() {
|
|
root.emplace(Dom::HtmlElement::CreateInBody("div", "catcrafts-root"));
|
|
root->SetInnerHTML(R"(
|
|
<header>
|
|
<div class="nav-container">
|
|
<a href="/" class="logo">🐱 Catcrafts</a>
|
|
<nav>
|
|
<ul>
|
|
<li><a id="blog-nav-button" style="cursor: pointer;" class="active">Blog</a></li>
|
|
<li><a href="https://forgejo.catcrafts.net/Catcrafts/">Forgejo</a></li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</header>
|
|
|
|
<main id="main"></main>
|
|
|
|
<footer>
|
|
<div class="footer-content">
|
|
<div class="footer-links">
|
|
Powered by Crafter.Graphics, Running near native with WASM!
|
|
<a href="https://forgejo.catcrafts.net/Catcrafts/catcrafts.net">View source</a>
|
|
</div>
|
|
<p>© 2026 Catcrafts®. All rights reserved. Crafter® and Catcrafts® are registered trademarks with the EUIPO</p>
|
|
</div>
|
|
</footer>)");
|
|
}
|
|
}
|