]> Lady’s Gitweb - Status/blob - topic.html
New status @ 2024-01-02T22:55:51-05:00
[Status] / topic.html
1 <!dOcTyPe html>
2 <META Charset=utf-8>
3 <TITLE>Topic Feed</TITLE>
4 <STYLE>
5 html{ Color: #E3E3E3; Background: #700020; Font-Family: UI-Rounded, 'Hiragino Maru Gothic ProN', Quicksand, Comfortaa, Manjari, 'Arial Rounded MT', 'Arial Rounded MT Bold', Calibri, Sans-Serif; Line-Height: 1.5; Text-Shadow: Calc(1EM / 12) Calc(1EM / 12) #000000 }
6 body{ Display: Grid; Box-Sizing: Border-Box; Margin: Auto; Padding-Inline: 1CH; Min-Block-Size: 100VH; Inline-Size: 100%; Max-Inline-Size: 48REM; Align-Content: Center; Justify-Content: Stretch }
7 :Any-Link{ Color: #87E6DD }
8 footer{ Border-Block-Start: Thin Solid; Padding-Block: 1REM; Font-Size: Smaller; Text-Align: End }
9 dd :Any-Link{ Display: Block; Border: Thin Solid; Padding-Inline: .5REM; Border-Radius: .5REM; Min-Inline-Size: Max-Content; Inline-Size: 28CH; Color: #D6B7BF; Background: #1A1A1A; Text-Shadow: None }
10 </STYLE>
11 <H1>Topic Feed</H1>
12 <NAV><P><A HRef=/>Home</A></P><DL></DL></NAV>
13 <FOOTER>
14 <A HRef=https://www.ladys.computer/><IMG Width=88 Height=31 Style="Display: Block; Margin: Auto; Image-Rendering: Pixelated" Src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAMAAABUFvrSAAAAAXNSR0IArs4c6QAAADBQTFRF////AAAAGhoaPj4+aGhok5OTvr6+cAAgmSJEs4qW897jH31jLLONOua1UwB0j2YApwkwfQAAAalJREFUSIm1lgGzgiAQhHM1o3sx/f9/++SOg+OAbJpxx0gxP9blxG7LRbot+xW6JzBmCvtjf/yiZwbPzidweE6Vxh6foVPwXsAVUvZAVME8ig51Di6OAao8KCXv8fkQII0D31ttHkyFwrzDK3cQkfSFZQnSwIHbWd1cFA2lgrk3dYVUYdJ04M1od471rvMXWTAKeJmAa3GvHZgJxHlwS1C7EvFHMPB6yWf1USikoFMshEI+cfyX1TmGcUgmEOSIZfIyd+D4lYUOnBlE1HpXMJdbwg7KLWWcDS8+Cp06WN8aO/QBCclu94BwxuwZGDjWSLXojOqzF/RgUBXJb18V02WqYddBesdZLgogRoeKpieiGboDr0aN43Qpb1EaOTo+0iawjsTtN4+0gGM2JrBYkAXcjvT1WnEC5nuI0g7A29rq1HG1qo71wK/H9/f7WC5X3pr1eASO9f5tFIOMD3BdlAvYRpEnr0TxtDMJM6cevLkgvOOm2mDKW9mQ0Trw9NWkNdW8Ru2B3P8PL9PBpVaAP/n1y7S/9LMy+DH9QQLTLxLwVX+xtkt0gC/SP0CwO6Ncy8sUAAAAAElFTkSuQmCC" Alt="Lady’s Computer"></A>
15 </FOOTER>
16 <SCRIPT Type=module>
17 const nav = document.body.querySelector("nav")
18 const dl = nav.querySelector("dl")
19 const parser = new DOMParser
20 fetch(`${location}.jsonld`)
21 .then($ => $.json())
22 .then(meta => {
23 const topic = meta.subject || meta["@id"].split("/").pop()
24 document.title = topic
25 document.body.querySelector("h1").textContent = "subject" in meta
26 ? `#${topic}`
27 : `@${topic}`
28 if ("subject" in meta) {
29 const a = nav
30 .insertBefore(document.createElement("p"), dl)
31 .appendChild(document.createElement("a"))
32 a.href = "/topics"
33 a.textContent = "Topics" }
34 const { first, prev, next, current, items } = meta
35 if (first && first != location && first != prev) {
36 const a = nav
37 .insertBefore(document.createElement("p"), dl)
38 .appendChild(document.createElement("a"))
39 a.href = first
40 a.textContent = "First Page" }
41 if (prev) {
42 const a = nav
43 .insertBefore(document.createElement("p"), dl)
44 .appendChild(document.createElement("a"))
45 a.href = prev
46 a.textContent = "Previous Page" }
47 let prevDate = undefined
48 for (const status of items) {
49 if (status.created != prevDate) dl.appendChild(document.createElement("dt")).textContent = status.created
50 const a = dl
51 .appendChild(document.createElement("dd"))
52 .appendChild(document.createElement("a"))
53 a.href = status["@id"]
54 const { title } = status
55 if (title) a.textContent = title.length > 28
56 ? "".concat(...title.slice(0, 27), "…")
57 : title
58 else {
59 const summaryText = (() => {
60 try {
61 const d = parser.parseFromString(status.content, "application/xhtml+xml")
62 const div = document.createElement("div")
63 div.appendChild(document.importNode(d.documentElement, true))
64 Object.assign(div.style,
65 { position: "absolute"
66 , top: "-2px"
67 , height: "1px"
68 , width: "1px"
69 , overflow: "hidden" })
70 document.body.appendChild(div)
71 const text = div.innerText
72 document.body.removeChild(div)
73 return text }
74 catch { } })() || "";
75 const chars = Array.from(summaryText.trim().replaceAll(/\s+/gu, " "))
76 a.textContent = chars.length > 28
77 ? "".concat(...chars.slice(0, 27), "…")
78 : summaryText || status.identifier } }
79 if (next) {
80 const a = nav
81 .appendChild(document.createElement("p"))
82 .appendChild(document.createElement("a"))
83 a.href = next
84 a.textContent = "Next Page" }
85 if (current && current != location && current != next) {
86 const a = nav
87 .appendChild(document.createElement("p"))
88 .appendChild(document.createElement("a"))
89 a.href = current
90 a.textContent = "Latest Page" } })
91 </SCRIPT>
This page took 0.103161 seconds and 5 git commands to generate.