feat: terminal text
This commit is contained in:
parent
ac76a4eb16
commit
4339ebe265
4 changed files with 32 additions and 147 deletions
139
_index.html
139
_index.html
|
|
@ -1,139 +0,0 @@
|
||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
<link rel="stylesheet" href="index.css" />
|
|
||||||
<link
|
|
||||||
rel="stylesheet"
|
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
|
|
||||||
/>
|
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
||||||
<link
|
|
||||||
href="https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<title>Barrett Ruth</title>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
|
||||||
<script src="https://d3js.org/d3.v7.min.js"></script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<header>
|
|
||||||
<div class="header-left">
|
|
||||||
<img src="public/logo.webp" alt="Barrett Ruth logo" class="logo" />
|
|
||||||
</div>
|
|
||||||
<div class="header-right">
|
|
||||||
<span>Header Text Here</span>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
<main>
|
|
||||||
<p>Here is an equation: \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)</p>
|
|
||||||
|
|
||||||
<h2>Projects</h2>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<a href="https://trbcap.com" class="project" target="_blank"
|
|
||||||
>TRB Capital Management</a
|
|
||||||
>
|
|
||||||
<span class="description">— quantitative asset management</span>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="https://thecourseforum.com" class="project" target="_blank"
|
|
||||||
>theCourseForum</a
|
|
||||||
>
|
|
||||||
</li>
|
|
||||||
<!-- TODO: tinground -->
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href="https://atlas-devs-atlas.vercel.app/"
|
|
||||||
class="project"
|
|
||||||
target="_blank"
|
|
||||||
>atlas</a
|
|
||||||
>
|
|
||||||
<span class="description">— machine learning research</span>
|
|
||||||
</li>
|
|
||||||
<!-- TODO: no -->
|
|
||||||
<li>
|
|
||||||
<a href="https://github.com/nvimdev" class="project" target="_blank"
|
|
||||||
>nvimdev</a
|
|
||||||
>
|
|
||||||
<span class="description">— open-source neovim plugins</span>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<h2>Resume</h2>
|
|
||||||
<h2>Transcript</h2>
|
|
||||||
</main>
|
|
||||||
<footer>
|
|
||||||
<div>Footer Text Here</div>
|
|
||||||
<div>
|
|
||||||
<a href="https://linkedin.com/in/barrett-ruth" target="_blank">
|
|
||||||
<i class="fab fa-linkedin"></i>
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/barrett-ruth" target="_blank">
|
|
||||||
<i class="fab fa-github"></i>
|
|
||||||
</a>
|
|
||||||
<a href="mailto:br.barrettruth@gmail.com" target="_blank">
|
|
||||||
<i class="fas fa-envelope"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
<svg width="500" height="100"></svg>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// Data for the bar chart
|
|
||||||
const data = [4, 8, 15, 16, 23, 42];
|
|
||||||
|
|
||||||
// Create the bar chart
|
|
||||||
const svg = d3.select("svg");
|
|
||||||
const margin = { top: 20, right: 30, bottom: 30, left: 40 };
|
|
||||||
const width = +svg.attr("width") - margin.left - margin.right;
|
|
||||||
const height = +svg.attr("height") - margin.top - margin.bottom;
|
|
||||||
const barWidth = width / data.length;
|
|
||||||
|
|
||||||
const y = d3
|
|
||||||
.scaleLinear()
|
|
||||||
.domain([0, d3.max(data)])
|
|
||||||
.range([height, 0]);
|
|
||||||
|
|
||||||
const g = svg
|
|
||||||
.append("g")
|
|
||||||
.attr("transform", `translate(${margin.left},${margin.top})`);
|
|
||||||
|
|
||||||
g.selectAll("rect")
|
|
||||||
.data(data)
|
|
||||||
.enter()
|
|
||||||
.append("rect")
|
|
||||||
.attr("class", "bar")
|
|
||||||
.attr("x", (d, i) => i * barWidth)
|
|
||||||
.attr("y", (d) => y(d))
|
|
||||||
.attr("width", barWidth - 1)
|
|
||||||
.attr("height", (d) => height - y(d));
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- <body> -->
|
|
||||||
<!-- TODO: remove this? -->
|
|
||||||
<!-- <h2> -->
|
|
||||||
<!-- <a href="https://swe-interview-prep.vercel.app" target="_blank" -->
|
|
||||||
<!-- >interview preparation</a -->
|
|
||||||
<!-- > -->
|
|
||||||
<!-- </h2> -->
|
|
||||||
<!-- <h2><a target="_blank" href="/public/resume.pdf">resume</a></h2> -->
|
|
||||||
<!-- <h2 style="display: none"> -->
|
|
||||||
<!-- <a target="_blank" href="/public/transcript.pdf">transcript</a> -->
|
|
||||||
<!-- </h2> -->
|
|
||||||
<!-- </body> -->
|
|
||||||
<script>
|
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
|
||||||
document.querySelectorAll(".project").forEach((p) => {
|
|
||||||
p.addEventListener("mouseover", () => {
|
|
||||||
p.nextElementSibling.classList.add("revealed");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</html>
|
|
||||||
15
index.html
15
index.html
|
|
@ -24,20 +24,18 @@
|
||||||
<main class="main">
|
<main class="main">
|
||||||
<ul class="topics">
|
<ul class="topics">
|
||||||
<li class="topic software">
|
<li class="topic software">
|
||||||
<!-- <a href="topics/software">Software</a> -->
|
<a href="/software" onclick="typechars(event)">Software</a>
|
||||||
<a href="/wip.html">Software</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li class="topic economics">
|
<li class="topic economics">
|
||||||
<!-- <a href="topics/economics">Economics</a> -->
|
<a href="/economics" onclick="typechars(event)">Economics</a>
|
||||||
<a href="/wip.html">Economics</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li class="topic trading">
|
<li class="topic trading">
|
||||||
<!-- <a href="topics/trading">Trading</a> -->
|
<a href="/trading" onclick="typechars(event)">Trading</a>
|
||||||
<a href="/wip.html">Trading</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li class="topic interview-problems">
|
<li class="topic interview-problems">
|
||||||
<!-- <a href="topics/interview-problems">Interview Problems</a> -->
|
<a href="/interview-problems" onclick="typechars(event)"
|
||||||
<a href="wip.html">Interview Problems</a>
|
>Interview Problems</a
|
||||||
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</main>
|
</main>
|
||||||
|
|
@ -50,5 +48,6 @@
|
||||||
<a target="_blank" href="mailto:br.barrettruth@gmail.com">Email</a>
|
<a target="_blank" href="mailto:br.barrettruth@gmail.com">Email</a>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
<script src="scripts/index.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
# barrettruth.com
|
# barrettruth.com
|
||||||
|
|
||||||
My portfolio website
|
My portfolio website
|
||||||
|
|
||||||
|
## todo
|
||||||
|
|
||||||
|
- mobile support
|
||||||
|
|
|
||||||
21
scripts/index.js
Normal file
21
scripts/index.js
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
function typechars(e, url = "wip.html") {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const text = ` ${e.target.textContent.toLowerCase()}/`;
|
||||||
|
const terminalPrompt = document.querySelector(".prompt");
|
||||||
|
let i = 0;
|
||||||
|
|
||||||
|
function typechar() {
|
||||||
|
if (i < text.length) {
|
||||||
|
terminalPrompt.innerHTML += text.charAt(i);
|
||||||
|
i++;
|
||||||
|
setTimeout(typechar, 1000 / text.length);
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
window.location.href = url;
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
typechar();
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue