Mostly audio stuff

This commit is contained in:
Dan 2025-12-13 15:17:46 +00:00
parent bdd00ec9e8
commit 2f5f4dbea4
28 changed files with 811 additions and 710 deletions

View file

@ -45,17 +45,16 @@ if (window.terminal) {
// PAGE NAVIGATION
window.terminal.registerCommand(
"latest",
"View the latest post, regardles of section",
() => {
let latestPostLink = document.getElementById("latest-post-link");
window.location.href = latestPostLink.textContent;
},
);
// About command
window.terminal.registerCommand("about", "About this site", () => {
window.location.href = "/about/";
});
window.terminal.registerCommand(
"music",
"My music interests and audio gear",
() => {
window.location.href = "/audio/";
},
);
}

View file

@ -19,3 +19,61 @@ if (document.getElementById("starfield")) {
starfield.appendChild(star);
}
}
(function () {
const container = document.querySelector(".record-shelf-container");
// Exit if the record shelf doesn't exist on this page
if (!container) {
return;
}
const recordSlots = container.querySelectorAll(".record-slot");
const albumContents = container.querySelectorAll(".album-content");
// Exit if we don't have the necessary elements
if (!recordSlots.length || !albumContents.length) {
return;
}
// Set first album as active by default
const firstSlot = recordSlots[0];
if (firstSlot) {
const firstSleeve = firstSlot.querySelector(".record-sleeve");
if (firstSleeve) {
firstSleeve.classList.add("active");
}
}
recordSlots.forEach((slot) => {
slot.addEventListener("click", function (e) {
e.preventDefault();
const index = this.getAttribute("data-album-index");
// Hide all content
albumContents.forEach((content) => (content.style.display = "none"));
// Show selected content
const selectedContent = container.querySelector(
`[data-content-index="${index}"]`,
);
if (selectedContent) {
selectedContent.style.display = "block";
}
// Remove active class from all sleeves
recordSlots.forEach((s) => {
const sleeve = s.querySelector(".record-sleeve");
if (sleeve) {
sleeve.classList.remove("active");
}
});
// Add active class to clicked sleeve
const clickedSleeve = this.querySelector(".record-sleeve");
if (clickedSleeve) {
clickedSleeve.classList.add("active");
}
});
});
})();

View file

@ -61,9 +61,9 @@ class TerminalShell {
latestPostDate.innerText +
")",
);
this.printHTML(
"<span class='info'>&nbsp;- Type \"latest\" to view it.</span>",
);
// this.printHTML(
// "<span class='info'>&nbsp;- Type \"latest\" to view it.</span>",
// );
this.printHTML("&nbsp;");
this.printHTML(
@ -71,7 +71,7 @@ class TerminalShell {
);
this.printHTML(
'<span class="warning">This site is under construction. There\'s nothing of interest here yet.</span>',
'<span class="warning">This site is under construction. There\'s not much of interest here yet.</span>',
);
this.inputContainer.classList.remove("hidden");