readme change

This commit is contained in:
Jorijn van der Graaf 2025-11-12 18:48:36 +01:00
commit 35e44b9ae7
5 changed files with 6 additions and 3 deletions

View file

@ -2,6 +2,8 @@
This sample demonstrates how to use the HtmlElement class in Crafter.CppDOM.
![](https://forgejo.catcrafts.net/Catcrafts/Crafter.CppDOM/src/branch/master/examples/HelloWorld/HelloWorld.png)
## Features
- Shows how to create and manipulate HTML elements

View file

@ -2,6 +2,8 @@
This sample demonstrates a simple hello world application using Crafter.CppDOM.
![](https://forgejo.catcrafts.net/Catcrafts/Crafter.CppDOM/src/branch/master/examples/HelloWorld/HelloWorld.png)
## Usage
```cpp

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View file

@ -22,7 +22,6 @@ HtmlElementView* head = new HtmlElementView("head", R"(
body {
font-family: Arial, sans-serif;
margin: 0 auto;
padding: 20px;
background-color: #121212;
color: #e0e0e0;
width: 100vw;
@ -219,7 +218,6 @@ void RenderNotes() {
}
}
// Main function
int main() {
FetchNotes();
@ -230,7 +228,8 @@ int main() {
std::cout << noteValue << std::endl;
if (!noteValue.empty()) {
loadingIndicator->SetInnerHTML("<p>Saving note...</p>");
Fetch("http://localhost:3000/createNote", noteValue, [&noteValue](std::string content) {
Fetch("http://localhost:3000/createNote", noteValue, [noteValue](std::string content) {
std::cout << noteValue << std::endl;
notes->push_back({static_cast<std::uint32_t>(std::stoi(content)), noteValue});
noteInput->SetValue("");
RenderNotes();