-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
70 lines (63 loc) · 1.4 KB
/
script.js
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
import { Kefir } from "./kefir.js";
const ui = [
`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: "My Website",
href: "https://nikee.dev/"
},
"br",
"br",
{
type: "link",
text: "Other kefir tests",
href: "./test.html"
},
"br",
"Select an option: ",
{
type: "select",
options: ["just hello", "me", "you", "world"],
action: (e) => {
let text = document.getElementById("changeme");
text.innerText = "Hello" + (e.target.value != "just hello" ? " " + e.target.value : "") + "!";
}
},
{
type: "text",
text: "Hello ",
id: "changeme"
},
{
type: "image",
src: "https://letzerland.nikee.dev/Confederation%20of%20Letzerland.svg",
width: 200
}
];
const kefir = new Kefir(ui);
kefir.run();