🌎☎️ Checkpoint

./scripts/zines2025.json:69682263/9929
./scripts/zines.js:69682263/28460
This commit is contained in:
Glitch (fedizinefest)
2025-05-23 15:39:43 +00:00
parent 07197f43a7
commit a017b32d04
2 changed files with 108 additions and 120 deletions

View File

@ -126,13 +126,6 @@ let zines = [
format: "digital",
blurb: "About severe disability with a bit extra on being a caregiver",
},
{
name: "gup",
site: "https://cyberpunk.gay/@glyph",
format: "physical/digital",
blurb:
"fortune teller/ cootie catcher foldable. prefolded for physical, print and fold yourself for digital. decorated with hand carved stamps. black and white. i need to buy nice paper.",
},
];
function makeZine({ name, blurb, format, site, fedi }) {
@ -162,27 +155,39 @@ function makeZine({ name, blurb, format, site, fedi }) {
return zine;
}
let zineContainer = document.getElementById("zine-container");
function makeZinePage(zines) {
let zineContainer = document.getElementById("zine-container");
for (let i = 0; i < zines.length; i++) {
zineContainer.append(makeZine(zines[i]));
for (let i = 0; i < zines.length; i++) {
zineContainer.append(makeZine(zines[i]));
}
let zineCounter = document.getElementById("zine-count");
let total = zines.length;
let physical = zines.filter(
(zine) => zine.format == "physical" || zine.format == "physical/digital"
).length;
let digital = zines.filter(
(zine) => zine.format == "digital" || zine.format == "physical/digital"
).length;
let p = document.createElement("p");
p.innerHTML =
total +
" artists. " +
physical +
" physical zines. " +
digital +
" digital zines.";
zineCounter.append(p);
}
let zineCounter = document.getElementById("zine-count");
let total = zines.length;
let physical = zines.filter(
(zine) => zine.format == "physical" || zine.format == "physical/digital"
).length;
let digital = zines.filter(
(zine) => zine.format == "digital" || zine.format == "physical/digital"
).length;
let p = document.createElement("p");
p.innerHTML =
total +
" artists. " +
physical +
" physical zines. " +
digital +
" digital zines.";
zineCounter.append(p);
fetch("./zines2025.json")
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json();
})
.then((data) => makeZinePage(data))
.catch((error) => console.error("Failed to fetch data:", error));