feat: open terminal ctrl-click in a new tab

This commit is contained in:
Barrett Ruth 2025-12-30 19:39:24 -06:00
parent 617c2e69ea
commit e0936be05b

View file

@ -15,7 +15,12 @@ const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$";
---
<header>
<a href="/" class="home-link" style="text-decoration: none; color: inherit">
<a
href="/"
id="home-link"
class="home-link"
style="text-decoration: none; color: inherit"
>
<div class="terminal-container">
<span class="terminal-prompt">{promptText}</span>
<span class="terminal-cursor"></span>
@ -49,4 +54,15 @@ const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$";
}
</style>
<script is:inline>
const homeLink = document.getElementById("home-link");
homeLink.addEventListener("click", (e) => {
if (e.ctrlKey || e.metaKey) {
e.preventDefault();
window.open("/", "_blank", "noopener");
}
});
</script>
<script src="/scripts/index.js" is:inline></script>