mirror of
https://github.com/Phantop/phantop.github.io
synced 2025-12-08 05:05:15 +00:00
fluxwidget: per feed links
This commit is contained in:
parent
58270467c7
commit
e8bd5793c6
|
|
@ -20,13 +20,16 @@ window.onload = async function run() {
|
||||||
for (const [id, count] of unreads) {
|
for (const [id, count] of unreads) {
|
||||||
const icon = await api(url, key, `feeds/${id}/icon`)
|
const icon = await api(url, key, `feeds/${id}/icon`)
|
||||||
const container = document.createElement("div")
|
const container = document.createElement("div")
|
||||||
|
const feedLink = document.createElement("a")
|
||||||
|
feedLink.href = `${url}/feed/${id}/entries`
|
||||||
const img = document.createElement("img")
|
const img = document.createElement("img")
|
||||||
const num = document.createElement("b")
|
const num = document.createElement("b")
|
||||||
img.src = `data:${icon.data}`
|
img.src = `data:${icon.data}`
|
||||||
if (count < 10) { num.textContent = count }
|
if (count < 10) { num.textContent = count }
|
||||||
else { num.textContent = String.fromCharCode(count + 55) }
|
else { num.textContent = String.fromCharCode(count + 55) }
|
||||||
container.appendChild(img)
|
feedLink.appendChild(img)
|
||||||
container.appendChild(num)
|
feedLink.appendChild(num)
|
||||||
|
container.appendChild(feedLink)
|
||||||
link.appendChild(container)
|
link.appendChild(container)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,31 @@
|
||||||
div {
|
body {
|
||||||
border-radius: 1.5em;
|
|
||||||
border: mediumpurple solid;
|
|
||||||
display: inline-flex;
|
|
||||||
margin-bottom: 1em;
|
|
||||||
margin-right: .6em;
|
|
||||||
}
|
|
||||||
div * {
|
|
||||||
font-size: 4em;
|
|
||||||
height: 1em;
|
|
||||||
padding: .3em;
|
|
||||||
}
|
|
||||||
a, html, body {
|
|
||||||
background-color: black;
|
background-color: black;
|
||||||
color: white;
|
|
||||||
font-family: monospace;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
a {
|
body > a {
|
||||||
display: block;
|
display: block;
|
||||||
padding-left: 1em;
|
height: 100%;
|
||||||
padding-top: 2em;
|
margin-top: 1em;
|
||||||
|
margin-left: .6em;
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
display: inline-flex;
|
||||||
|
margin-top: 1em;
|
||||||
|
margin-left: .6em;
|
||||||
|
}
|
||||||
|
div > a {
|
||||||
|
border-radius: 1.5em;
|
||||||
|
border: mediumpurple solid;
|
||||||
|
color: white;
|
||||||
|
font-family: monospace;
|
||||||
|
display: inherit;
|
||||||
text-decoration: inherit;
|
text-decoration: inherit;
|
||||||
}
|
}
|
||||||
|
div > a * {
|
||||||
|
font-size: 4em;
|
||||||
|
height: 1em;
|
||||||
|
padding: .3em;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue