-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
111 lines (102 loc) · 2.74 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>kefir - UI library</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Noto%20Sans&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto%20Mono&display=swap');
body {
font-family: 'Noto Sans';
font-weight: normal;
}
#code {
font-family: 'Roboto Mono';
}
#root {
border: 2px solid black;
border-radius: 5px;
padding: 10px;
}
#pre {
word-spacing: 10px;
font-family: monospace;
word-break: break-all;
}
</style>
</head>
<body>
<h1>Welcome to <span id="code">kefir</span>!</h1>
<p>The JSON to HTML UI library.</p>
<p>Here is the UI that is all drawn by <span id="code">kefir.js</span></p>
<p>The JSON:</p>
<div id="pre">
[
`css:
button {
background-color: white;
border-radius: 17px;
padding: 10px;
font-family: monospace;
font-weight: bold;
}
button:hover {
transition-property: background-color;
transition-duration: 1s;
transition-timing-function: linear;
transition-delay: 0.5s;
background-color: #A6A6A6;
}
`,
"Hello!",
{
type: "button",
text: "Click me",
action: (e) => {
alert("You clicked me!");
}
},
"br",
"br",
{
type: "link",
text: "Other kefir tests",
href: "./test.html"
},
"br",
{
type: "link",
text: "My Website",
href: "https://nikeedev.stio.studio/"
},
"br",
"br",
"Select an option: ",
{
type: "select",
options: ["me", "you", "world"],
action: (e) => {
let text = document.getElementById("changeme");
text.innerText = "Hello " + e.target.value + "!";
}
},
{
type: "text",
text: "Hello ",
id: "changeme"
},
{
type: "image",
src: "https://letzerland.nikee.dev/Confederation%20of%20Letzerland.svg",
width: 200
}
]
</div>
<p>The HTML:</p>
<div id="root">
</div>
<script type="module" src="script.js"></script>
<script defer type="module" src="https://stats.nikee.dev/script"></script>
</body>
</html>