Files: 3bf3c7aca4c5ebf780ce5daee70c769f82f5ca26 / index.js
902 bytesRaw
1 | var h = require('hyperscript') |
2 | var route = require('./views') |
3 | var avatar = require('./avatar') |
4 | |
5 | var id = require('./keys').id |
6 | |
7 | document.head.appendChild(h('style', require('./style.css.json'))) |
8 | |
9 | var screen = h('div#screen', {style: {position: 'absolute', top: '35px', bottom: '0px', left: '0px', right: '0px'}}) |
10 | |
11 | var 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 | ) |
17 | ) |
18 | |
19 | document.body.appendChild(nav) |
20 | document.body.appendChild(screen) |
21 | route() |
22 | |
23 | window.onhashchange = function () { |
24 | var oldscreen = document.getElementById('screen') |
25 | var newscreen = h('div#screen', {style: {position: 'absolute', top: '35px', bottom: '0px', left: '0px', right: '0px'}}) |
26 | oldscreen.parentNode.replaceChild(newscreen, oldscreen) |
27 | route() |
28 | } |
29 | |
30 |
Built with git-ssb-web