Compare commits
7 commits
reactivity
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
10a60114b1 | ||
|
690cd76d85 | ||
|
ac75e69f53 | ||
|
1da88ebae2 | ||
|
58f2997449 | ||
|
53fd5eccca | ||
|
9eca9236ea |
4 changed files with 0 additions and 61 deletions
|
@ -1,16 +0,0 @@
|
|||
html, body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #0f0;
|
||||
}
|
BIN
favicon.ico
BIN
favicon.ico
Binary file not shown.
Before Width: | Height: | Size: 127 B |
13
index.html
13
index.html
|
@ -1,13 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/assets/styles/base.css">
|
||||
|
||||
<title>json as html</title>
|
||||
|
||||
<script defer type="module" src="./src/demo.mjs"></script>
|
||||
</head>
|
||||
|
||||
<body></body>
|
32
src/demo.mjs
32
src/demo.mjs
|
@ -1,32 +0,0 @@
|
|||
import { json_as_html } from "./core.mjs";
|
||||
|
||||
|
||||
|
||||
const demo = [
|
||||
"div",
|
||||
[
|
||||
["id", "wrapper"],
|
||||
["class", "demo_div"],
|
||||
],
|
||||
[
|
||||
["h1", [], "header :)"],
|
||||
["p", [], "paragraph! meow"],
|
||||
["p", [], "another paragraph!! this is so cool"],
|
||||
state => ["button", [
|
||||
["onclick", _ => {
|
||||
state.set("clicked", true);
|
||||
render();
|
||||
}]
|
||||
], "it can even do buttons!"],
|
||||
state => ["p", [], state.get("clicked") ? "clicked" : "not clicked"],
|
||||
],
|
||||
];
|
||||
|
||||
const state = new Map();
|
||||
|
||||
function render () {
|
||||
document.body.innerHTML = "";
|
||||
document.body.appendChild(json_as_html(demo, state));
|
||||
}
|
||||
|
||||
render();
|
Loading…
Reference in a new issue