on master help sign in
Added channel UI
commit7e11c4ef1709fbc9a0ea27c8f832f53c52fae366 authorDevine Lu Linvega <aliceffekt@gmail.com> dateTue 2 Jul 2019, 16:38 (7 years ago) parentd322792
2 files changed+6
links/main.css+1 scripts/hallway.js+5
links/main.css+1
@@ -17,6 +17,7 @@ body #hallway .entry .author { font-family: 'input_mono_medium'; position: absol
1717body #hallway .entry .author:after { content:":"; }
1818body #hallway .entry .body { max-width: 400px; }
1919body #hallway .entry .body a { text-decoration: underline; }
20+body #hallway .entry .body .channel { background: white;color: black;display: inline-block;padding: 0px 5px;line-height: 20px;border-radius: 2px; font-family: 'input_mono_medium'; }
2021body #hallway .entry.highlight .author { color:#555; }
2122body #hallway .entry:hover .author { color:#ccc; }
2223body #hallway .entry:hover .date { color:#ccc; }
scripts/hallway.js+5
@@ -49,6 +49,11 @@ function Hallway (sites) {
4949 entry.body = entry.body.replace(`@<${data}>`, `<a href='${path}'>@${name}</a>`)
5050 }
5151
52+ if (entry.body.substr(0, 1) === '/') {
53+ const channel = entry.body.split(' ')[0]
54+ entry.body = entry.body.replace(channel, `<span class='channel'>${channel}</span>`)
55+ }
56+
5257 const filter = window.location.hash.substr(1).replace(/\+/g, ' ').toLowerCase()
5358 const highlight = filter == entry.author.toLowerCase()
5459