-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
48 lines (42 loc) · 1017 Bytes
/
app.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
const html = require('nanohtml')
const css = require('sheetify')
const app = require('nanochoo')()
const splashView = require('./views/splashView')
const drsView = require('./views/drsView')
const store = require('./store')
css('tachyons-border-radius')
css('tachyons-borders')
css('tachyons-box-shadow')
css('tachyons-box-sizing')
css('tachyons-flexbox')
css('tachyons-floats')
css('tachyons-font-family')
css('tachyons-font-weight')
css('tachyons-heights')
css('tachyons-hovers')
css('tachyons-links')
css('tachyons-lists')
css('tachyons-overflow')
css('tachyons-skins')
css('tachyons-spacing')
css('tachyons-text-align')
css('tachyons-widths')
if (process.env.NODE_ENV !== 'production') {
app.use(require('choo-devtools')())
}
app.use(store)
app.view(mainView)
function mainView (state, emit) {
let view
if (state.drs) {
view = drsView(state, emit)
} else {
view = splashView(state, emit)
}
return html`
<body class="ma0 sans-serif">
${view}
</body>
`
}
app.mount('body')