-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.js
More file actions
62 lines (48 loc) · 1.07 KB
/
style.js
File metadata and controls
62 lines (48 loc) · 1.07 KB
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
import { h, app } from "hyperapp"
const state = {
count: 0
}
const actions = {
down: () => state => ({ count: state.count - 1 }),
up: () => state => ({ count: state.count + 1 })
}
const mainStyle = {
"background-color": "#111",
"font-family": "Helvetica Neue, sans-serif",
height: "100vh",
margin: 0,
padding: 0,
"justify-content": "center",
"align-items": "center",
"text-align": "center",
display: "flex"
}
const countStyle = {
color: "#00caff",
margin: 0,
"font-weight": 100,
"font-size": "8em"
}
const buttonStyle = {
background: "#111",
"border-radius": "0px",
border: "1px solid #00caff",
color: "#00caff",
"font-size": "2em",
"font-weight": 100,
margin: "2rem",
outline: "none",
padding: "5px 15px"
}
const view = (state, actions) => (
<main style={mainStyle}>
<button style={buttonStyle} onclick={actions.down}>
-
</button>
<h1 style={countStyle}>{state.count}</h1>
<button style={buttonStyle} onclick={actions.up}>
+
</button>
</main>
)
const main = app(state, actions, view, document.body)