git ssb

1+

punkmonk.termux / mvd



forked from ev / mvd

Tree: 793444db02289c9a688dd7301e70f700cedbdd3d

Files: 793444db02289c9a688dd7301e70f700cedbdd3d / index.js

952 bytesRaw
1var h = require('hyperscript')
2var route = require('./views')
3var avatar = require('./avatar')
4
5var id = require('./keys').id
6
7document.head.appendChild(h('style', require('./style.css.json')))
8
9var screen = h('div#screen', {style: {position: 'absolute', top: '35px', bottom: '0px', left: '0px', right: '0px'}})
10
11var nav = h('div.navbar',
12 h('div.internal',
13 h('li', h('a', {href: '#' + id}, h('span.avatar--small', avatar.image(id)))),
14 h('li', h('a', {href: '#' + id}, avatar.name(id))),
15 h('li', h('a', {href: '#'}, 'Public')),
16 h('li.right', h('a', {href: '#about'}, '?'))
17 )
18)
19
20document.body.appendChild(nav)
21document.body.appendChild(screen)
22route()
23
24window.onhashchange = function () {
25 var oldscreen = document.getElementById('screen')
26 var newscreen = h('div#screen', {style: {position: 'absolute', top: '35px', bottom: '0px', left: '0px', right: '0px'}})
27 oldscreen.parentNode.replaceChild(newscreen, oldscreen)
28 route()
29}
30
31

Built with git-ssb-web