catcrafts.net/implementations/main.cpp

30 lines
714 B
C++
Raw Normal View History

2025-11-12 20:58:07 +01:00
/*
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;
2025-11-12 21:24:23 +01:00
int main() {
AddPopStateListener([]() {
RenderRoot(GetPathNameString());
});
2025-11-12 20:58:07 +01:00
blogButton = new HtmlElementView("blog-nav-button");
blogButton->AddClickListener([](Crafter::MouseEvent e) {
PushState("{}", "", "/blog");
2025-11-12 21:56:18 +01:00
RenderRoot("/blog");
2025-11-12 20:58:07 +01:00
});
2025-11-12 23:33:48 +01:00
RenderRoot(GetPathNameString());
2025-11-12 20:58:07 +01:00
}