|
1 | 1 | import uvicorn |
2 | 2 | from violetear import App, StyleSheet |
3 | | -from violetear.markup import Document, Element |
| 3 | +from violetear.markup import Document, HTML |
4 | 4 | from violetear.color import Colors |
5 | 5 | from violetear.style import Style |
6 | 6 | from violetear.dom import Event |
@@ -95,18 +95,18 @@ def index(): |
95 | 95 | doc.style(style, href="/style.css") # Link our style |
96 | 96 |
|
97 | 97 | doc.body.add( |
98 | | - Element("div", classes="counter-card").extend( |
99 | | - Element("h2", text="Isomorphic Counter"), |
| 98 | + HTML.div(classes="counter-card").extend( |
| 99 | + HTML.h2(text="Isomorphic Counter"), |
100 | 100 | # The Count |
101 | | - Element("div", id="display", classes="count-display", text="0"), |
| 101 | + HTML.div(id="display", classes="count-display", text="0"), |
102 | 102 | # Controls - Both call the same Python function |
103 | | - Element("button", id="minus", text="-", classes="btn-minus btn").on( |
| 103 | + HTML.button(id="minus", text="-", classes="btn-minus btn").on( |
104 | 104 | "click", handle_change |
105 | 105 | ), |
106 | | - Element("button", id="plus", text="+", classes="btn-plus btn").on( |
| 106 | + HTML.button(id="plus", text="+", classes="btn-plus btn").on( |
107 | 107 | "click", handle_change |
108 | 108 | ), |
109 | | - Element("p", text="Check server console for pings.").style( |
| 109 | + HTML.p(text="Check server console for pings.").style( |
110 | 110 | Style().color(Colors.Gray).margin(top=20) |
111 | 111 | ), |
112 | 112 | ) |
|
0 commit comments