Skip to content

Commit 21edcb0

Browse files
committed
live user count for federated nexus
1 parent 2ee6b28 commit 21edcb0

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/pages/index.astro

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ import CallToAction from "../components/CallToAction.astro"
7676
<p>
7777
I run <a href="https://federated.nexus"
7878
>Federated Nexus</a
79-
>, a community resource hosted on Nix with over 250
80-
users. We host many FOSS (especially federated)
81-
services, including Matrix, LaSuite Docs, and
82-
Forgejo.
79+
>, a community resource hosted on Nix with <span
80+
id="user-count">over 450</span
81+
> users. We host many FOSS (especially federated) services,
82+
including Matrix, LaSuite Docs, and Forgejo.
8383
</p>
8484
</article>
8585
<aside>
@@ -275,3 +275,13 @@ import CallToAction from "../components/CallToAction.astro"
275275
</mdui-card>
276276
<BottomBar slot="navbar" />
277277
</Layout>
278+
279+
<script>
280+
;(async () => {
281+
const response = await fetch(
282+
"https://matrix.federated.nexus/_continuwuity/local_user_count"
283+
)
284+
const json = await response.json()
285+
document.querySelector("#user-count")!.innerHTML = json["count"]
286+
})()
287+
</script>

src/styles/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ main > * > section {
5353
justify-content: center;
5454
flex-wrap: wrap;
5555
& article {
56-
& span {
56+
& > span {
5757
color: hsl(0, 0%, 60%);
5858
}
5959
& h3 {

0 commit comments

Comments
 (0)