feat: rename class styles, improve js idiomacy
This commit is contained in:
parent
707afe91fa
commit
cae425da1a
9 changed files with 12 additions and 14 deletions
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
></script>
|
||||
<title>Barrett Ruth</title>
|
||||
</head>
|
||||
<body class="graph">
|
||||
<body class="graph-background">
|
||||
<header>
|
||||
<a
|
||||
href="/"
|
||||
|
|
|
|||
|
|
@ -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="/"
|
||||
|
|
|
|||
|
|
@ -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="/"
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,3 @@
|
|||
const urlToTopic = () => {
|
||||
return new URL(window.location.href).pathname.split("/")[2];
|
||||
};
|
||||
|
||||
document.documentElement.style.setProperty(
|
||||
"--topic-color",
|
||||
getTopicColor(urlToTopic()),
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ li {
|
|||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.graph {
|
||||
.graph-background {
|
||||
background-image: linear-gradient(
|
||||
to right,
|
||||
rgba(200, 200, 200, 0.4) 1px,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue