feat: fix stuff
This commit is contained in:
parent
c08e4ce9d5
commit
90e139a22f
7 changed files with 26 additions and 17 deletions
|
|
@ -1,5 +1,3 @@
|
||||||
import { getTopicColor } from "../../src/utils/colors.js";
|
|
||||||
|
|
||||||
const TERMINAL_PROMPT = "barrett@ruth:~$ ";
|
const TERMINAL_PROMPT = "barrett@ruth:~$ ";
|
||||||
let typing = false;
|
let typing = false;
|
||||||
let clearing = false;
|
let clearing = false;
|
||||||
|
|
@ -108,7 +106,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
const topicName = topic.dataset.topic;
|
const topicName = topic.dataset.topic;
|
||||||
|
|
||||||
topic.addEventListener("mouseenter", () => {
|
topic.addEventListener("mouseenter", () => {
|
||||||
const color = getTopicColor(topicName);
|
const color = window.getTopicColor(topicName);
|
||||||
topic.style.color = color;
|
topic.style.color = color;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
import { getTopicColor } from "../../src/utils/colors.js";
|
|
||||||
|
|
||||||
function urlToTopic() {
|
function urlToTopic() {
|
||||||
const path = window.location.pathname;
|
const path = window.location.pathname;
|
||||||
const pathParts = path.split("/");
|
const pathParts = path.split("/");
|
||||||
|
|
@ -84,7 +82,7 @@ function drawSolowGraph() {
|
||||||
.append("path")
|
.append("path")
|
||||||
.datum(outputData)
|
.datum(outputData)
|
||||||
.attr("fill", "none")
|
.attr("fill", "none")
|
||||||
.attr("stroke", getTopicColor(urlToTopic()))
|
.attr("stroke", window.getTopicColor(urlToTopic()))
|
||||||
.attr("stroke-width", 2)
|
.attr("stroke-width", 2)
|
||||||
.attr(
|
.attr(
|
||||||
"d",
|
"d",
|
||||||
|
|
@ -267,7 +265,7 @@ function drawRomerGraph() {
|
||||||
.append("path")
|
.append("path")
|
||||||
.datum(romerData)
|
.datum(romerData)
|
||||||
.attr("fill", "none")
|
.attr("fill", "none")
|
||||||
.attr("stroke", getTopicColor(urlToTopic()))
|
.attr("stroke", window.getTopicColor(urlToTopic()))
|
||||||
.attr("stroke-width", 2)
|
.attr("stroke-width", 2)
|
||||||
.attr(
|
.attr(
|
||||||
"d",
|
"d",
|
||||||
|
|
@ -360,7 +358,7 @@ function drawRomerlGraph() {
|
||||||
.append("path")
|
.append("path")
|
||||||
.datum(romerData)
|
.datum(romerData)
|
||||||
.attr("fill", "none")
|
.attr("fill", "none")
|
||||||
.attr("stroke", getTopicColor(urlToTopic()))
|
.attr("stroke", window.getTopicColor(urlToTopic()))
|
||||||
.attr("stroke-width", 2)
|
.attr("stroke-width", 2)
|
||||||
.attr(
|
.attr(
|
||||||
"d",
|
"d",
|
||||||
|
|
@ -506,7 +504,7 @@ function drawRomerSolowGraph() {
|
||||||
.append("path")
|
.append("path")
|
||||||
.datum(romerSolowData)
|
.datum(romerSolowData)
|
||||||
.attr("fill", "none")
|
.attr("fill", "none")
|
||||||
.attr("stroke", getTopicColor(urlToTopic()))
|
.attr("stroke", window.getTopicColor(urlToTopic()))
|
||||||
.attr("stroke-width", 2)
|
.attr("stroke-width", 2)
|
||||||
.attr(
|
.attr(
|
||||||
"d",
|
"d",
|
||||||
|
|
@ -603,7 +601,7 @@ function drawRomerSolowChangeGraph() {
|
||||||
.append("path")
|
.append("path")
|
||||||
.datum(romerSolowData)
|
.datum(romerSolowData)
|
||||||
.attr("fill", "none")
|
.attr("fill", "none")
|
||||||
.attr("stroke", getTopicColor(urlToTopic()))
|
.attr("stroke", window.getTopicColor(urlToTopic()))
|
||||||
.attr("stroke-width", 2)
|
.attr("stroke-width", 2)
|
||||||
.attr(
|
.attr(
|
||||||
"d",
|
"d",
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@ title: "designing this website"
|
||||||
date: "18/06/2024"
|
date: "18/06/2024"
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Update: Port to Astro (<span class="date">22/05/2025</span>)
|
||||||
|
|
||||||
|
hi
|
||||||
|
|
||||||
## HTML, JavaScript, and CSS
|
## HTML, JavaScript, and CSS
|
||||||
|
|
||||||
That's all there is to it.
|
That's all there is to it.
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,20 @@ const {
|
||||||
<slot />
|
<slot />
|
||||||
</main>
|
</main>
|
||||||
<Footer />
|
<Footer />
|
||||||
|
<script is:inline>
|
||||||
|
window.getTopicColor = function(topicName) {
|
||||||
|
switch (topicName) {
|
||||||
|
case "software":
|
||||||
|
return "#0073e6";
|
||||||
|
case "algorithms":
|
||||||
|
return "#d50032";
|
||||||
|
case "meditations":
|
||||||
|
return "#6a0dad";
|
||||||
|
default:
|
||||||
|
return "#000000";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
<slot name="scripts" />
|
<slot name="scripts" />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -91,14 +91,10 @@ const capitalizedCategory =
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script define:vars={{ category }}>
|
<script define:vars={{ category }}>
|
||||||
import { getTopicColor } from "../utils/colors.js";
|
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
document.documentElement.style.setProperty(
|
document.documentElement.style.setProperty(
|
||||||
"--topic-color",
|
"--topic-color",
|
||||||
getTopicColor(category),
|
window.getTopicColor(category),
|
||||||
);
|
);
|
||||||
|
|
||||||
window.getTopicColor = getTopicColor;
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
import BaseLayout from "../layouts/BaseLayout.astro";
|
import BaseLayout from "../layouts/BaseLayout.astro";
|
||||||
import { getCollection } from "astro:content";
|
import { getCollection } from "astro:content";
|
||||||
import { getTopicColor } from "../utils/colors.js";
|
|
||||||
|
|
||||||
const title = "Barrett Ruth";
|
const title = "Barrett Ruth";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue