feat: misc cleanups

This commit is contained in:
Barrett Ruth 2025-04-02 14:45:33 -04:00
parent 2c617c21c7
commit 255563f267
4 changed files with 21 additions and 10 deletions

View file

@ -12,7 +12,11 @@
</head>
<body class="graph-background">
<header>
<a href="/" onclick="refresh(event)">
<a
href="/"
style="text-decoration: none; color: inherit"
onclick="goHome(event)"
>
<div class="terminal-container">
<span class="terminal-prompt">barrett@ruth:~$ /about</span>
<span class="terminal-cursor"></span>
@ -77,7 +81,8 @@
<a target="_blank" href="mailto:br.barrettruth@gmail.com">Email</a>
</div>
</footer>
<script src="scripts/common.js"></script>
<script src="scripts/index.js"></script>
<script src="/scripts/common.js"></script>
<script src="/scripts/index.js"></script>
<script src="/scripts/post.js"></script>
</body>
</html>

View file

@ -39,7 +39,13 @@ const getTopicColor = (topicName) => {
return "#d50032";
case "algorithms":
return "#6a0dad";
default:
return "#000000";
}
};
const urlToTopic = () => window.location.pathname.split("/")[2];
const urlToTopic = () => {
const pathname = window.location.pathname.split("/");
if (pathname.length < 3) return "DNE";
return pathname[2];
};

View file

@ -1,8 +1,3 @@
document.documentElement.style.setProperty(
"--topic-color",
getTopicColor(urlToTopic()),
);
const tagToHeader = new Map([
["H2", "#"],
["H3", "##"],
@ -17,6 +12,11 @@ const setStyle = (h) => {
};
document.addEventListener("DOMContentLoaded", () => {
document.documentElement.style.setProperty(
"--topic-color",
getTopicColor(urlToTopic()),
);
document.querySelectorAll(".post-article h2").forEach(setStyle);
document.querySelectorAll(".post-article h3").forEach(setStyle);
});

View file

@ -36,9 +36,9 @@ li {
}
.post-meta {
font-style: italic;
/* space between date and title */
margin-left: 100px;
font-size: 1.3em;
}
.post-title {