feat: misc cleanups
This commit is contained in:
parent
2c617c21c7
commit
255563f267
4 changed files with 21 additions and 10 deletions
11
about.html
11
about.html
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ li {
|
|||
}
|
||||
|
||||
.post-meta {
|
||||
font-style: italic;
|
||||
/* space between date and title */
|
||||
margin-left: 100px;
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.post-title {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue