feat: rename class styles, improve js idiomacy

This commit is contained in:
Barrett Ruth 2024-06-26 14:09:06 -05:00
parent 707afe91fa
commit cae425da1a
9 changed files with 12 additions and 14 deletions

View file

@ -10,7 +10,7 @@
<link rel="icon" type="image/webp" href="/public/logo.webp" />
<title>Barrett Ruth</title>
</head>
<body class="graph">
<body class="graph-background">
<header>
<a href="/" onclick="refresh(event)">
<div class="terminal-container">

View file

@ -9,7 +9,7 @@
<link rel="icon" type="image/webp" href="/public/logo.webp" />
<title>Barrett Ruth</title>
</head>
<body class="graph">
<body class="graph-background">
<header>
<a href="/" onclick="refresh(event)">
<div class="terminal-container">

View file

@ -19,7 +19,7 @@
></script>
<title>Barrett Ruth</title>
</head>
<body class="graph">
<body class="graph-background">
<header>
<a
href="/"

View file

@ -9,7 +9,7 @@
<link rel="icon" type="image/webp" href="/public/logo.webp" />
<title>Barrett Ruth</title>
</head>
<body class="graph">
<body class="graph-background">
<header>
<a
href="/"

View file

@ -9,7 +9,7 @@
<link rel="icon" type="image/webp" href="/public/logo.webp" />
<title>Barrett Ruth</title>
</head>
<body class="graph">
<body class="graph-background">
<header>
<a
href="/"

View file

@ -29,7 +29,7 @@ function goHome(e) {
clearPrompt(500, () => (window.location.href = "/"));
}
function getTopicColor(topicName) {
const getTopicColor = (topicName) => {
switch (topicName) {
case "software":
return "#0073e6";
@ -40,4 +40,6 @@ function getTopicColor(topicName) {
case "algorithms":
return "#6a0dad";
}
}
};
const urlToTopic = () => window.location.pathname.split("/")[2];

View file

@ -12,7 +12,7 @@ const postMapping = new Map([
[
{ name: "models of production", link: "models-of-production" },
{ name: "the short run" },
{ name: "to invest or not to invest" },
{ name: "in the aggregate" },
],
],
["Trading", [{ name: "InteractiveBrokers TWS" }, { name: "valuation" }]],
@ -23,7 +23,7 @@ const postMapping = new Map([
]);
function refresh(e) {
e.preventDefault();
if (window.location.pathname !== "/") e.preventDefault();
const topics = document.querySelectorAll(".topic a");

View file

@ -1,7 +1,3 @@
const urlToTopic = () => {
return new URL(window.location.href).pathname.split("/")[2];
};
document.documentElement.style.setProperty(
"--topic-color",
getTopicColor(urlToTopic()),

View file

@ -49,7 +49,7 @@ li {
margin-bottom: 10px;
}
.graph {
.graph-background {
background-image: linear-gradient(
to right,
rgba(200, 200, 200, 0.4) 1px,