Skip to content

Commit

Permalink
Fix website
Browse files Browse the repository at this point in the history
  • Loading branch information
connorslade committed Nov 3, 2023
1 parent b9f5a37 commit be9c9fa
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ fetch(`${OFFIMG_PATH}/info.json`)
INFO_TAG.appendChild(item);
}

d.images.sort((a, b) => new Date(b.date) - new Date(a.date));
d.images.sort((a, b) => new Date(b.post.date) - new Date(a.post.date));
IMAGES_TAG.innerHTML = "";
for (let i of d.images) {
let image = document.createElement("div");
image.setAttribute("image", "");

{
let img = document.createElement("img");
img.src = `${OFFIMG_PATH}/${i.id}.bmp`;
img.src = `${OFFIMG_PATH}/${i.uuid}.bmp`;
img.alt = i.alt;
image.appendChild(img);
}
Expand All @@ -32,23 +32,24 @@ fetch(`${OFFIMG_PATH}/info.json`)
foot.setAttribute("foot", "");

let info = document.createElement("div");
info.innerHTML = `${new Date(i.date).toLocaleDateString(
info.innerHTML = `${new Date(i.post.date).toLocaleDateString(
"en-US"
)} • `;

let post = document.createElement("a");
post.href = `https://forum.swissmicros.com/viewtopic.php?t=${i.post}`;
post.innerHTML = `Post ${i.post}`;
post.href = `https://forum.swissmicros.com/viewtopic.php?t=${i.post.post}`;
post.innerHTML = `Post ${i.post.post}`;
post.target = "_blank";
post.rel = "noopener noreferrer";
info.appendChild(post);

info.innerHTML += ` • ${i.alt}`;
if (i.alt) info.innerHTML += ` • ${i.alt}`;

let download = document.createElement("a");
download.href = `${OFFIMG_PATH}/${i.id}.bmp`;
download.innerHTML = `⇓`;
download.download = `${i.alt}${i.alt.endsWith(".bmp") ? "" : ".bmp"}`;
if (i.alt) download.download = `${i.alt}${i.alt.endsWith(".bmp") ? "" : ".bmp"}`;
else download.download = `${i.id}.bmp`;

foot.appendChild(info);
foot.appendChild(download);
Expand Down

0 comments on commit be9c9fa

Please sign in to comment.