on master help sign in
Improved sidebar
45c2363Devine Lu Linvega
links/main.css+5
@@ -14,6 +14,11 @@ body div p.readme { max-width:500px; }
14body #hallway #entries { width: calc(100vw - 300px) !important; }
14body #hallway #entries { width: calc(100vw - 300px) !important; }
15body #hallway #sidebar { position: absolute;top: 0px;right: 0px;padding: 0px 15px;width: 200px; }
15body #hallway #sidebar { position: absolute;top: 0px;right: 0px;padding: 0px 15px;width: 200px; }
16
16
17+body #hallway #sidebar > * { border-bottom: 0px; line-height: 15px; padding-bottom: 0px }
18+body #hallway #sidebar > * li { text-transform: lowercase; }
19+body #hallway #sidebar > * li span.right { color:#555; float:right; }
20+body #hallway #sidebar > * li span.right:after { content: " msgs"; }
21+
17body #hallway .entry { line-height: 16px; display: block; position: relative; padding-left:140px; margin-bottom: 5px;border-bottom: 1px solid #333;padding-bottom: 5px; }
22body #hallway .entry { line-height: 16px; display: block; position: relative; padding-left:140px; margin-bottom: 5px;border-bottom: 1px solid #333;padding-bottom: 5px; }
18body #hallway .entry .date { color: #555;display: block;float:right; margin-left:20px;}
23body #hallway .entry .date { color: #555;display: block;float:right; margin-left:20px;}
19body #hallway .entry .author { font-family: 'input_mono_medium'; position: absolute;left: 0px; }
24body #hallway .entry .author { font-family: 'input_mono_medium'; position: absolute;left: 0px; }
scripts/hallway.js+3−15
@@ -21,21 +21,9 @@ function Hallway (sites) {
21 const channels = this.findChannels(entries)
21 const channels = this.findChannels(entries)
22 const users = this.findUsers(entries)
22 const users = this.findUsers(entries)
23
23
24− let _entries = ''
24+ let _entries = entries.reduce((acc, val, id) => { return acc + this.templateEntry(val) + '\n' }, '')
25− for (const id in entries) {
25+ let _channels = Object.keys(channels).reduce((acc, val, id) => { return acc + `<li>${val} <span class='right'>${channels[val]}</span></li>\n` }, '')
26− const entry = entries[id]
26+ let _users = Object.keys(users).reduce((acc, val, id) => { return acc + `<li>${val} <span class='right'>${users[val]}</span></li>\n` }, '')
27− _entries += `${this.templateEntry(entry)}\n`
28− }
29−
30− let _channels = ''
31− for (const id in channels) {
32− _channels += `<li>${id} ${channels[id]}</li>\n`
33− }
34−
35− let _users = ''
36− for (const id in users) {
37− _users += `<li>${id} ${users[id]}</li>\n`
38− }
39
27
40 this.el.innerHTML = `
28 this.el.innerHTML = `
41 <ul id='entries'>
29 <ul id='entries'>