Merge pull request #38 from barrett-ruth/feat/open-terminal-click-new-tab

feat: open terminal ctrl-click in a new tab
This commit is contained in:
Barrett Ruth 2025-12-30 19:49:57 -06:00 committed by GitHub
commit 5dcf03af9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 6 deletions

View file

@ -1,8 +1,7 @@
name: Deploy to AWS S3
on:
push:
branches:
- main
branches: [main]
jobs:
deploy:

View file

@ -2,9 +2,9 @@ name: CI
on:
pull_request:
branches: [main]
push:
branches:
- main
branches: [main]
jobs:
lint:

View file

@ -11,7 +11,7 @@
"check": "astro check"
},
"lint-staged": {
"*.{js,ts,jsx,tsx,json,css,scss,md,astro,html}": [
"*.{js,ts,jsx,tsx,json,css,scss,md,astro,html,yaml,yml}": [
"prettier --write",
"astro check"
]

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>