git ssb

2+

ev / mvd



Tree: 89cf08bfb8188db7034674567177d7f6e0f0ae2f

Files: 89cf08bfb8188db7034674567177d7f6e0f0ae2f / index.js

1158 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: '#compose' }, 'Compose')),
16 h('li', h('a', {href: '#'}, 'Public')),
17 h('li', h('a', {href: '#private' }, 'Private')),
18 h('li', h('a', {href: '#mentions' }, 'Mentions')),
19 h('li', h('a', {href: '#key' }, 'Key')),
20 h('li.right', h('a', {href: '#about'}, '?'))
21 )
22)
23
24document.body.appendChild(nav)
25document.body.appendChild(screen)
26route()
27
28window.onhashchange = function () {
29 var oldscreen = document.getElementById('screen')
30 var newscreen = h('div#screen', {style: {position: 'absolute', top: '35px', bottom: '0px', left: '0px', right: '0px'}})
31 oldscreen.parentNode.replaceChild(newscreen, oldscreen)
32 route()
33}
34
35

Built with git-ssb-web