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" />
|
<link rel="icon" type="image/webp" href="/public/logo.webp" />
|
||||||
<title>Barrett Ruth</title>
|
<title>Barrett Ruth</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="graph">
|
<body class="graph-background">
|
||||||
<header>
|
<header>
|
||||||
<a href="/" onclick="refresh(event)">
|
<a href="/" onclick="refresh(event)">
|
||||||
<div class="terminal-container">
|
<div class="terminal-container">
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<link rel="icon" type="image/webp" href="/public/logo.webp" />
|
<link rel="icon" type="image/webp" href="/public/logo.webp" />
|
||||||
<title>Barrett Ruth</title>
|
<title>Barrett Ruth</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="graph">
|
<body class="graph-background">
|
||||||
<header>
|
<header>
|
||||||
<a href="/" onclick="refresh(event)">
|
<a href="/" onclick="refresh(event)">
|
||||||
<div class="terminal-container">
|
<div class="terminal-container">
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
></script>
|
></script>
|
||||||
<title>Barrett Ruth</title>
|
<title>Barrett Ruth</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="graph">
|
<body class="graph-background">
|
||||||
<header>
|
<header>
|
||||||
<a
|
<a
|
||||||
href="/"
|
href="/"
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<link rel="icon" type="image/webp" href="/public/logo.webp" />
|
<link rel="icon" type="image/webp" href="/public/logo.webp" />
|
||||||
<title>Barrett Ruth</title>
|
<title>Barrett Ruth</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="graph">
|
<body class="graph-background">
|
||||||
<header>
|
<header>
|
||||||
<a
|
<a
|
||||||
href="/"
|
href="/"
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<link rel="icon" type="image/webp" href="/public/logo.webp" />
|
<link rel="icon" type="image/webp" href="/public/logo.webp" />
|
||||||
<title>Barrett Ruth</title>
|
<title>Barrett Ruth</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="graph">
|
<body class="graph-background">
|
||||||
<header>
|
<header>
|
||||||
<a
|
<a
|
||||||
href="/"
|
href="/"
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ function goHome(e) {
|
||||||
clearPrompt(500, () => (window.location.href = "/"));
|
clearPrompt(500, () => (window.location.href = "/"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTopicColor(topicName) {
|
const getTopicColor = (topicName) => {
|
||||||
switch (topicName) {
|
switch (topicName) {
|
||||||
case "software":
|
case "software":
|
||||||
return "#0073e6";
|
return "#0073e6";
|
||||||
|
|
@ -40,4 +40,6 @@ function getTopicColor(topicName) {
|
||||||
case "algorithms":
|
case "algorithms":
|
||||||
return "#6a0dad";
|
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: "models of production", link: "models-of-production" },
|
||||||
{ name: "the short run" },
|
{ name: "the short run" },
|
||||||
{ name: "to invest or not to invest" },
|
{ name: "in the aggregate" },
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
["Trading", [{ name: "InteractiveBrokers TWS" }, { name: "valuation" }]],
|
["Trading", [{ name: "InteractiveBrokers TWS" }, { name: "valuation" }]],
|
||||||
|
|
@ -23,7 +23,7 @@ const postMapping = new Map([
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function refresh(e) {
|
function refresh(e) {
|
||||||
e.preventDefault();
|
if (window.location.pathname !== "/") e.preventDefault();
|
||||||
|
|
||||||
const topics = document.querySelectorAll(".topic a");
|
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(
|
document.documentElement.style.setProperty(
|
||||||
"--topic-color",
|
"--topic-color",
|
||||||
getTopicColor(urlToTopic()),
|
getTopicColor(urlToTopic()),
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ li {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.graph {
|
.graph-background {
|
||||||
background-image: linear-gradient(
|
background-image: linear-gradient(
|
||||||
to right,
|
to right,
|
||||||
rgba(200, 200, 200, 0.4) 1px,
|
rgba(200, 200, 200, 0.4) 1px,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue