feat: dynamically style each post

This commit is contained in:
Barrett Ruth 2024-06-22 13:53:26 -05:00
parent 8655cd7097
commit d3811df2ce
4 changed files with 27 additions and 18 deletions

View file

@ -10,7 +10,7 @@ const postMapping = new Map([
[
"Economics",
[
{ name: "romer-solow model" },
{ name: "romer-solow model", link: "romer-solow-model" },
{ name: "the short run" },
{ name: "to invest or not to invest" },
],
@ -93,19 +93,6 @@ window.addEventListener("beforeunload", () => {
document.querySelector(".terminal-prompt").innerHTML = TERMINAL_PROMPT;
});
function getTopicColor(topicName) {
switch (topicName) {
case "software":
return "#0073e6";
case "economics":
return "#009975";
case "trading":
return "#d50032";
case "algorithms":
return "#6a0dad";
}
}
document.addEventListener("DOMContentLoaded", function () {
const topics = document.querySelectorAll(".topic a");