catcrafts.net/implementations/main.cpp
2025-11-12 23:33:48 +01:00

30 lines
No EOL
714 B
C++

/*
catcrafts.net
Copyright (C) 2025 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.CppDOM;
import std;
using namespace Catcrafts;
using namespace Crafter;
using namespace Crafter::CppDOMBindings;
HtmlElementView* blogButton;
int main() {
AddPopStateListener([]() {
RenderRoot(GetPathNameString());
});
blogButton = new HtmlElementView("blog-nav-button");
blogButton->AddClickListener([](Crafter::MouseEvent e) {
PushState("{}", "", "/blog");
RenderRoot("/blog");
});
RenderRoot(GetPathNameString());
}