/* 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. */ import Catcrafts; import Crafter.Graphics; import std; using namespace Catcrafts; using namespace Crafter; int main() { Device::Initialize(); // Window in CRAFTER_GRAPHICS_WINDOW_DOM mode is a page-level event hub // plus the rAF driver; even without subscribing to its events we need // it so StartSync() can keep the wasm module alive past main() (the // bridge stashes a raw pointer, so the storage has to outlive main). static Window window(0, 0, "Catcrafts"); InitializePage(); Router::AddPopStateListener([]{ RenderRoot(Router::GetPath()); }); static Dom::HtmlElementPtr blogButton("blog-nav-button"); blogButton.AddClickListener([](Dom::MouseEvent) { Router::PushState("{}", "", "/blog"); RenderRoot("/blog"); }); RenderRoot(Router::GetPath()); window.StartUpdate(); window.StartSync(); return 0; }