Compare commits
16
Commits
36716f29d0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
809e51bae0
|
||
|
|
70bf783ca8
|
||
|
|
e21219aba6
|
||
|
|
a2dea4b210
|
||
|
|
2001963035
|
||
|
|
57c906082f
|
||
|
|
af8f99feb0
|
||
|
|
70af555189
|
||
|
|
a346bd8064
|
||
|
|
da65d52319
|
||
|
|
4624fe722b
|
||
|
|
f5d2b417e6
|
||
|
|
b75f17e604
|
||
|
|
3b702a1399
|
||
|
|
433b84ea8f
|
||
|
|
e22a4dc112
|
No files matched your search
@@ -0,0 +1,7 @@
|
||||
# Copy to `.env` and fill in real values. Never commit `.env`.
|
||||
EMAIL_HOST=smtp.example.com
|
||||
EMAIL_PORT=587
|
||||
EMAIL_SECURE=false
|
||||
EMAIL_USER=user@example.com
|
||||
EMAIL_PASS=change-me
|
||||
EMAIL_FROM=noreply@example.com
|
||||
@@ -22,7 +22,9 @@ jobs:
|
||||
path: |
|
||||
node_modules/.astro/
|
||||
node_modules/.vite/
|
||||
key: ${{ runner.os }}-buildcache
|
||||
key: ${{ runner.os }}-buildcache-${{ hashFiles('package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildcache-
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v5
|
||||
@@ -33,11 +35,15 @@ jobs:
|
||||
- name: Install
|
||||
shell: "bash"
|
||||
working-directory: .
|
||||
run: npm install
|
||||
run: npm ci
|
||||
|
||||
- name: Build
|
||||
shell: "bash"
|
||||
working-directory: .
|
||||
env:
|
||||
# Bound libuv/sharp thread usage: the builder is small and
|
||||
# full parallelism OOMs it. Raise if the host grows.
|
||||
UV_THREADPOOLSIZE: 4
|
||||
run: npm run build
|
||||
|
||||
- name: Set up SSH
|
||||
|
||||
@@ -7,7 +7,7 @@ below, unless otherwise indicated in a specific file's header.
|
||||
|
||||
## MIT License
|
||||
|
||||
Copyright (c) 2025 Nathan Cummins
|
||||
Copyright (c) 2026 Nathan Cummins
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -32,7 +32,7 @@ SOFTWARE.
|
||||
All non-code content in this repository — including, but not limited to, music
|
||||
(including melodies, harmonies, arrangements, lyrics, sound recordings, and
|
||||
other musical elements), audio recordings, images, photographs, written
|
||||
biographies, descriptive texts, and project documentation — is copyright © 2025
|
||||
biographies, descriptive texts, and project documentation — is copyright © 2026
|
||||
Nathan Cummins, all rights reserved, unless otherwise stated in the file itself.
|
||||
|
||||
Such non-code content may not be copied, modified, distributed, or otherwise
|
||||
|
||||
@@ -10,7 +10,7 @@ Thanks for checking it out!
|
||||
## TL;DR
|
||||
|
||||
- **Code:** All source code in this repository is licensed under the [MIT License](LICENSE). You are welcome to fork, clone, modify, or otherwise use the code in your own projects, provided you give appropriate credit.
|
||||
- **Non-code content:** All other materials — including music and audio (melodies, harmonies, arrangements, lyrics, sound recordings, and other musical elements and audio), images, photographs, written biographies, project descriptions, and any other creative works — are copyright © 2025 Nathan Cummins, **all rights reserved**. These may not be copied, modified, distributed, or otherwise used without prior written permission.
|
||||
- **Non-code content:** All other materials — including music and audio (melodies, harmonies, arrangements, lyrics, sound recordings, and other musical elements and audio), images, photographs, written biographies, project descriptions, and any other creative works — are copyright © 2026 Nathan Cummins, **all rights reserved**. These may not be copied, modified, distributed, or otherwise used without prior written permission.
|
||||
|
||||
If you use the code, I would appreciate proper credit by linking back to my [website](https://www.nathancummins.com.au) or including my name and email ([nathan@nathancummins.com.au](https://www.nathancummins.com.au)).
|
||||
|
||||
|
||||
+14
-1
@@ -32,7 +32,20 @@ export default defineConfig({
|
||||
}
|
||||
},
|
||||
|
||||
integrations: [icon(), mdx(), sitemap(), robotsTxt()],
|
||||
integrations: [
|
||||
icon(),
|
||||
mdx(),
|
||||
sitemap(),
|
||||
robotsTxt({
|
||||
policy: [
|
||||
{
|
||||
userAgent: "*",
|
||||
allow: "/",
|
||||
disallow: "/api/"
|
||||
}
|
||||
]
|
||||
})
|
||||
],
|
||||
|
||||
markdown: {
|
||||
shikiConfig: {
|
||||
|
||||
Generated
+2494
-6494
File diff suppressed because it is too large.
Load diff
+6
-6
@@ -9,19 +9,19 @@
|
||||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/mdx": "^4.3.1",
|
||||
"@astrojs/node": "^9.4.3",
|
||||
"@astrojs/sitemap": "^3.4.2",
|
||||
"@astrojs/mdx": "^8.0.3",
|
||||
"@astrojs/node": "^11.1.7",
|
||||
"@astrojs/sitemap": "^3.7.4",
|
||||
"@iconify-json/fa": "^1.2.1",
|
||||
"@iconify-json/fa7-brands": "^1.2.0",
|
||||
"@iconify-json/fa7-solid": "^1.2.0",
|
||||
"@iconify-json/mdi": "^1.2.3",
|
||||
"@iconify-json/simple-icons": "^1.2.44",
|
||||
"@tailwindcss/vite": "^4.1.11",
|
||||
"astro": "^5.18.2",
|
||||
"astro": "^7.3.8",
|
||||
"astro-icon": "^1.1.5",
|
||||
"astro-robots-txt": "^1.0.0",
|
||||
"astro-seo-schema": "^5.1.0",
|
||||
"astro-seo-schema": "^7.0.1",
|
||||
"get-audio-duration": "^4.0.1",
|
||||
"nodemailer": "^7.0.5",
|
||||
"schema-dts": "^1.1.5",
|
||||
@@ -29,7 +29,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cspell/dict-en-au": "^1.1.4",
|
||||
"@shikijs/transformers": "^3.9.2",
|
||||
"@shikijs/transformers": "^4.5.0",
|
||||
"@types/howler": "^2.2.12",
|
||||
"@types/nodemailer": "^7.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
||||
|
||||
@@ -77,7 +77,8 @@ const { id: ID = "contact-form" } = Astro.props;
|
||||
<script define:vars={{ ID }}>
|
||||
function init() {
|
||||
const form = document.getElementById(ID);
|
||||
if (!form) return;
|
||||
if (!form || form.dataset.initialised) return;
|
||||
form.dataset.initialised = "true";
|
||||
const responseMsg = form.querySelector(
|
||||
`#${CSS.escape(ID + "-response-message")}`
|
||||
);
|
||||
@@ -85,6 +86,7 @@ const { id: ID = "contact-form" } = Astro.props;
|
||||
const loadingIcon = form.querySelector(
|
||||
`#${CSS.escape(ID + "-loading-icon")}`
|
||||
);
|
||||
if (!responseMsg || !button || !loadingIcon) return;
|
||||
|
||||
form.addEventListener("submit", async function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
@@ -62,5 +62,8 @@ import TextLink from "@components/TextLink.astro";
|
||||
</footer>
|
||||
|
||||
<script is:inline data-astro-rerun>
|
||||
document.getElementById("footer-year").innerText = new Date().getFullYear();
|
||||
{
|
||||
const year = document.getElementById("footer-year");
|
||||
if (year) year.innerText = new Date().getFullYear();
|
||||
}
|
||||
</script>
|
||||
@@ -6,6 +6,7 @@ import { shuffleArray } from "@lib/utils";
|
||||
|
||||
interface Props {
|
||||
images: Array<ImageMetadata>;
|
||||
id?: string;
|
||||
class: string;
|
||||
altText?: string | ((index: number) => string);
|
||||
interval?: number;
|
||||
@@ -19,10 +20,12 @@ interface Props {
|
||||
quality?: number;
|
||||
height?: number;
|
||||
shuffle?: boolean;
|
||||
eagerCount?: number;
|
||||
}
|
||||
|
||||
const {
|
||||
images,
|
||||
id = "carousel",
|
||||
class: className,
|
||||
altText = null,
|
||||
interval = 5000,
|
||||
@@ -35,12 +38,14 @@ const {
|
||||
foregroundOpacity = "opacity-50",
|
||||
quality = "80",
|
||||
height,
|
||||
shuffle = false
|
||||
shuffle = false,
|
||||
eagerCount = 2
|
||||
} = Astro.props as Props;
|
||||
|
||||
const IDs: string[] = [];
|
||||
|
||||
const imagesArray = shuffle ? shuffleArray(images) : images;
|
||||
|
||||
// Slides kept in the layout (first visible, rest preloaded) so their eager loads actually fire; anything past this stays hidden until its turn.
|
||||
const preloadCount = Math.max(eagerCount, 2);
|
||||
---
|
||||
|
||||
<div class:list={[className, "relative overflow-hidden"]}>
|
||||
@@ -50,24 +55,21 @@ const imagesArray = shuffle ? shuffleArray(images) : images;
|
||||
|
||||
{
|
||||
imagesArray.map((image, index) => {
|
||||
const ID = `image-carousel-${Math.random().toString(36)}`;
|
||||
IDs.push(ID);
|
||||
|
||||
return (
|
||||
<Image
|
||||
data-id={`${ID}`}
|
||||
data-id={`${id}-${index}`}
|
||||
class:list={[
|
||||
"absolute !h-full w-full object-cover object-center transition-opacity",
|
||||
transitionStyle,
|
||||
transitionDuration,
|
||||
index > 0 ? "opacity-0" : "",
|
||||
index < 2 ? "" : "hidden"
|
||||
index < preloadCount ? "" : "hidden"
|
||||
]}
|
||||
src={image}
|
||||
alt={
|
||||
typeof altText === "function" ? altText(index) : (altText ?? "")
|
||||
}
|
||||
loading={index < 2 ? "eager" : "lazy"}
|
||||
loading={index < eagerCount ? "eager" : "lazy"}
|
||||
aria-hidden={index === 0 ? "false" : "true"}
|
||||
layout="full-width"
|
||||
fit="cover"
|
||||
@@ -89,36 +91,75 @@ const imagesArray = shuffle ? shuffleArray(images) : images;
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
<script define:vars={{ imagesArray, interval, IDs }}>
|
||||
let currentIndex = 0;
|
||||
<script
|
||||
define:vars={{
|
||||
imageCount: imagesArray.length,
|
||||
carouselId: id,
|
||||
interval,
|
||||
preloadCount
|
||||
}}
|
||||
>
|
||||
window.__carousels = window.__carousels || {};
|
||||
|
||||
setInterval(() => {
|
||||
const total = imagesArray.length;
|
||||
const current = document.querySelectorAll(
|
||||
`[data-id="${IDs[currentIndex]}"]`
|
||||
)[0];
|
||||
const nextIndex = (currentIndex + 1) % total;
|
||||
const next = document.querySelectorAll(`[data-id="${IDs[nextIndex]}"]`)[0];
|
||||
|
||||
if (!current || !next) return;
|
||||
|
||||
// Fade out current, fade in next
|
||||
current.classList.add("opacity-0");
|
||||
current.setAttribute("aria-hidden", "true");
|
||||
|
||||
next.classList.remove("opacity-0", "hidden");
|
||||
next.setAttribute("aria-hidden", "false");
|
||||
|
||||
const preloadIndex = (nextIndex + 1) % total;
|
||||
const preloadImage = document.querySelectorAll(
|
||||
`[data-id="${IDs[preloadIndex]}"]`
|
||||
)[0];
|
||||
if (preloadImage) {
|
||||
preloadImage.classList.add("opacity-0");
|
||||
preloadImage.classList.remove("hidden");
|
||||
preloadImage.setAttribute("aria-hidden", "true");
|
||||
// Reset the carousel and (re)start it. Runs on initial load and after
|
||||
// every page transition, so navigation always restarts the fade sequence.
|
||||
function initCarousel() {
|
||||
const state = (window.__carousels[carouselId] = window.__carousels[
|
||||
carouselId
|
||||
] || { index: 0, timer: null });
|
||||
state.index = 0;
|
||||
if (state.timer) {
|
||||
clearInterval(state.timer);
|
||||
state.timer = null;
|
||||
}
|
||||
|
||||
currentIndex = nextIndex;
|
||||
}, interval);
|
||||
const slides = Array.from(
|
||||
document.querySelectorAll(`[data-id^="${carouselId}-"]`)
|
||||
);
|
||||
slides.forEach((slide, index) => {
|
||||
slide.classList.toggle("opacity-0", index !== 0);
|
||||
slide.classList.toggle("hidden", index >= preloadCount);
|
||||
slide.setAttribute("aria-hidden", index === 0 ? "false" : "true");
|
||||
});
|
||||
|
||||
// Honour reduced-motion: leave the first image showing, no rotation.
|
||||
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
||||
|
||||
state.timer = setInterval(() => {
|
||||
const current = document.querySelectorAll(
|
||||
`[data-id="${carouselId}-${state.index}"]`
|
||||
)[0];
|
||||
const nextIndex = (state.index + 1) % imageCount;
|
||||
const next = document.querySelectorAll(
|
||||
`[data-id="${carouselId}-${nextIndex}"]`
|
||||
)[0];
|
||||
|
||||
if (!current || !next) return;
|
||||
|
||||
// Wait until the incoming image has loaded, or the fade pops in.
|
||||
if (next.tagName === "IMG" && !next.complete) return;
|
||||
|
||||
// Fade out current, fade in next
|
||||
current.classList.add("opacity-0");
|
||||
current.setAttribute("aria-hidden", "true");
|
||||
|
||||
next.classList.remove("opacity-0", "hidden");
|
||||
next.setAttribute("aria-hidden", "false");
|
||||
|
||||
const preloadIndex = (nextIndex + 1) % imageCount;
|
||||
const preloadImage = document.querySelectorAll(
|
||||
`[data-id="${carouselId}-${preloadIndex}"]`
|
||||
)[0];
|
||||
if (preloadImage) {
|
||||
preloadImage.classList.add("opacity-0");
|
||||
preloadImage.classList.remove("hidden");
|
||||
preloadImage.setAttribute("aria-hidden", "true");
|
||||
}
|
||||
|
||||
state.index = nextIndex;
|
||||
}, interval);
|
||||
}
|
||||
|
||||
document.addEventListener("astro:page-load", initCarousel);
|
||||
initCarousel();
|
||||
</script>
|
||||
@@ -50,8 +50,12 @@ const copyID = Math.random().toString(36);
|
||||
}
|
||||
{title && <p>{title}</p>}
|
||||
</div>
|
||||
<button class="font-bold" id=`copy-${copyID}`>
|
||||
Copy <Icon name="mdi:content-copy" class="ml-0.5 inline-block" />
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Copy code to clipboard"
|
||||
class="font-bold"
|
||||
id=`copy-${copyID}`
|
||||
>Copy <Icon name="mdi:content-copy" class="ml-0.5 inline-block" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -11,14 +11,14 @@ const image = getImageByPath(src);
|
||||
|
||||
{
|
||||
image && (
|
||||
<div class="my-8">
|
||||
<span class="my-8 block">
|
||||
<Image
|
||||
src={image}
|
||||
alt={alt}
|
||||
width={1344}
|
||||
class="transition ease-in-out lg:hover:scale-150"
|
||||
/>
|
||||
<div class="mt-2 block w-full text-center text-sm italic">{alt}</div>
|
||||
</div>
|
||||
<span class="mt-2 block w-full text-center text-sm italic">{alt}</span>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
+23
-12
@@ -64,7 +64,7 @@ const { navbarDisplay = "normal" } = Astro.props as Props;
|
||||
<div class="md:hidden">
|
||||
<button
|
||||
id="menu-toggle"
|
||||
class="text-2xl focus:outline-none"
|
||||
class="focus-visible:ring-primary text-2xl focus:outline-none focus-visible:ring-2"
|
||||
aria-label="Toggle navigation menu"
|
||||
aria-expanded="false"
|
||||
aria-controls="mobile-menu"
|
||||
@@ -139,7 +139,12 @@ const { navbarDisplay = "normal" } = Astro.props as Props;
|
||||
nav = document.getElementById("nav");
|
||||
toggle = document.getElementById("menu-toggle");
|
||||
|
||||
if (toggle) {
|
||||
// The nav persists across transitions: always start with a closed menu.
|
||||
nav?.setAttribute("data-mobile-menu", "hidden");
|
||||
toggle?.setAttribute("aria-expanded", "false");
|
||||
|
||||
if (toggle && !toggle.dataset.bound) {
|
||||
toggle.dataset.bound = "true";
|
||||
toggle.addEventListener("click", () => {
|
||||
if (nav) {
|
||||
const visible = nav.getAttribute("data-mobile-menu") === "visible";
|
||||
@@ -151,18 +156,24 @@ const { navbarDisplay = "normal" } = Astro.props as Props;
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (
|
||||
e.key === "Escape" &&
|
||||
nav?.getAttribute("data-mobile-menu") === "visible"
|
||||
) {
|
||||
nav.setAttribute("data-mobile-menu", "hidden");
|
||||
toggle?.setAttribute("aria-expanded", "false");
|
||||
}
|
||||
});
|
||||
if (!document.documentElement.dataset.navbarKeydownBound) {
|
||||
document.documentElement.dataset.navbarKeydownBound = "true";
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (
|
||||
e.key === "Escape" &&
|
||||
nav?.getAttribute("data-mobile-menu") === "visible"
|
||||
) {
|
||||
nav.setAttribute("data-mobile-menu", "hidden");
|
||||
toggle?.setAttribute("aria-expanded", "false");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
checkScroll();
|
||||
});
|
||||
|
||||
window.addEventListener("scroll", checkScroll);
|
||||
if (!document.documentElement.dataset.navbarScrollBound) {
|
||||
document.documentElement.dataset.navbarScrollBound = "true";
|
||||
window.addEventListener("scroll", checkScroll, { passive: true });
|
||||
}
|
||||
</script>
|
||||
+304
-51
@@ -35,7 +35,7 @@ const initialQueue = await Promise.all(
|
||||
})
|
||||
);
|
||||
|
||||
const playerArtworkBlur = "10px";
|
||||
const playerArtworkBlur = "15px";
|
||||
const playerArtworkOpacity = 0.4;
|
||||
---
|
||||
|
||||
@@ -62,6 +62,12 @@ const playerArtworkOpacity = 0.4;
|
||||
</div>
|
||||
<div
|
||||
id="player:time:progress"
|
||||
role="slider"
|
||||
tabindex="0"
|
||||
aria-label="Seek"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
aria-valuenow="0"
|
||||
class="relative top-0 right-0 left-0 m-0 h-2 w-full rounded-t p-0 hover:cursor-pointer"
|
||||
>
|
||||
<div
|
||||
@@ -89,8 +95,7 @@ const playerArtworkOpacity = 0.4;
|
||||
title="Minimise player"
|
||||
aria-label="Minimise player"
|
||||
class="col-span-1 rounded-full px-3 py-1 text-gray-400 hover:cursor-pointer hover:text-white"
|
||||
>
|
||||
<Icon name="fa7-solid:chevron-down" class="pointer-events-none" />
|
||||
><Icon name="fa7-solid:chevron-down" class="pointer-events-none" />
|
||||
</button>
|
||||
<span id="player:times:duration" class="col-span-1 text-right"
|
||||
>0:00</span
|
||||
@@ -99,28 +104,81 @@ const playerArtworkOpacity = 0.4;
|
||||
<div
|
||||
class="flex h-full flex-row items-center justify-center align-middle"
|
||||
>
|
||||
<div class="m-0 flex grow-0 flex-row space-x-2 p-0 text-3xl">
|
||||
<span>
|
||||
<Icon name="fa7-solid:backward" id="player:controls:previous" />
|
||||
</span>
|
||||
<span>
|
||||
<Icon name="fa7-solid:play" id="player:controls:play" />
|
||||
<Icon
|
||||
name="fa7-solid:pause"
|
||||
<div class="m-0 flex grow-0 flex-col p-0">
|
||||
<div class="mt-2 flex flex-row items-center space-x-4 text-2xl">
|
||||
<button
|
||||
type="button"
|
||||
id="player:controls:previous"
|
||||
aria-label="Previous track"
|
||||
class="rounded-full bg-transparent p-0 hover:cursor-pointer"
|
||||
><Icon name="fa7-solid:backward" class="pointer-events-none" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
id="player:controls:play"
|
||||
aria-label="Play"
|
||||
class="rounded-full bg-transparent p-0 hover:cursor-pointer"
|
||||
><Icon name="fa7-solid:play" class="pointer-events-none" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
id="player:controls:pause"
|
||||
class="hidden"
|
||||
/>
|
||||
</span>
|
||||
<span>
|
||||
<Icon name="fa7-solid:forward" id="player:controls:next" />
|
||||
</span>
|
||||
aria-label="Pause"
|
||||
class="hidden rounded-full bg-transparent p-0 hover:cursor-pointer"
|
||||
><Icon name="fa7-solid:pause" class="pointer-events-none" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
id="player:controls:next"
|
||||
aria-label="Next track"
|
||||
class="rounded-full bg-transparent p-0 hover:cursor-pointer"
|
||||
><Icon name="fa7-solid:forward" class="pointer-events-none" />
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
class="mt-3 hidden flex-row items-center space-x-2 pt-1 text-sm md:flex"
|
||||
>
|
||||
<span class="flex w-9 items-center justify-center">
|
||||
<button
|
||||
type="button"
|
||||
id="player:controls:mute"
|
||||
aria-label="Mute"
|
||||
aria-pressed="false"
|
||||
class="rounded-full bg-transparent p-0 hover:cursor-pointer"
|
||||
>
|
||||
<Icon
|
||||
name="fa7-solid:volume-high"
|
||||
id="player:controls:volume-on"
|
||||
class="pointer-events-none"
|
||||
/>
|
||||
<Icon
|
||||
name="fa7-solid:volume-xmark"
|
||||
id="player:controls:volume-off"
|
||||
class="pointer-events-none hidden"
|
||||
/>
|
||||
</button>
|
||||
</span>
|
||||
<span class="flex w-14 items-center md:w-16">
|
||||
<input
|
||||
type="range"
|
||||
id="player:controls:volume"
|
||||
aria-label="Volume"
|
||||
min="0"
|
||||
max="100"
|
||||
value="100"
|
||||
class="accent-primary w-full cursor-pointer"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-grow flex-col text-sm">
|
||||
<div class="flex min-w-0 flex-grow flex-col text-sm">
|
||||
<span
|
||||
id="player:metadata:title"
|
||||
class="w-full text-right font-semibold"></span>
|
||||
<span id="player:metadata:subtitle" class="w-full text-right"></span>
|
||||
<span id="player:metadata:extra" class="w-full text-right"></span>
|
||||
class="w-full truncate text-right font-semibold"></span>
|
||||
<span id="player:metadata:subtitle" class="w-full truncate text-right"
|
||||
></span>
|
||||
<span id="player:metadata:extra" class="w-full truncate text-right"
|
||||
></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -176,21 +234,26 @@ const playerArtworkOpacity = 0.4;
|
||||
<button
|
||||
id="player:face:controls:toggle"
|
||||
type="button"
|
||||
title="Play / pause"
|
||||
aria-label="Play / pause"
|
||||
title="Play"
|
||||
aria-label="Play"
|
||||
class="absolute top-1/2 left-1/2 flex h-8 w-8 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full bg-black/55 text-white opacity-100 backdrop-blur-sm hover:cursor-pointer hover:bg-black/70 md:h-9 md:w-9 md:opacity-0 md:group-focus-within:opacity-100 md:group-hover:opacity-100"
|
||||
>
|
||||
<Icon
|
||||
><Icon
|
||||
name="fa7-solid:play"
|
||||
id="player:face:controls:play"
|
||||
class="pointer-events-none text-sm drop-shadow"
|
||||
/>
|
||||
<Icon
|
||||
/><Icon
|
||||
name="fa7-solid:pause"
|
||||
id="player:face:controls:pause"
|
||||
class="pointer-events-none hidden text-sm drop-shadow"
|
||||
/>
|
||||
</button>
|
||||
<button
|
||||
id="player:face:controls:expand"
|
||||
type="button"
|
||||
aria-label="Expand player"
|
||||
class="sr-only"
|
||||
>Expand player
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="player:spacer" class:list={[height, "bg-gray-900"]}></div>
|
||||
@@ -237,6 +300,40 @@ const playerArtworkOpacity = 0.4;
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Slim volume slider */
|
||||
#player\:controls\:volume {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
background: transparent;
|
||||
height: 12px;
|
||||
}
|
||||
#player\:controls\:volume::-webkit-slider-runnable-track {
|
||||
height: 3px;
|
||||
border-radius: 9999px;
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
#player\:controls\:volume::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-top: -3.5px;
|
||||
border-radius: 9999px;
|
||||
background: #ff2d00;
|
||||
}
|
||||
#player\:controls\:volume::-moz-range-track {
|
||||
height: 3px;
|
||||
border-radius: 9999px;
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
#player\:controls\:volume::-moz-range-thumb {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border: none;
|
||||
border-radius: 9999px;
|
||||
background: #ff2d00;
|
||||
}
|
||||
|
||||
/* Outgoing layer fades fast, incoming fades in late */
|
||||
.player-full {
|
||||
transition:
|
||||
@@ -301,9 +398,21 @@ const playerArtworkOpacity = 0.4;
|
||||
this.playlist = window.player?.playlist ?? playlist;
|
||||
this.index = window.player?.index ?? 0;
|
||||
this.minimised = window.player?.minimised ?? false;
|
||||
// Seek fraction requested before anything was loaded.
|
||||
this.pendingSeek = null;
|
||||
// Playback volume (0-1); restored from storage below.
|
||||
this.volume = 1;
|
||||
this.lastVolume = 1;
|
||||
|
||||
this.RING_C = 182.2; // 2 * PI * 29, must match dasharray in markup
|
||||
|
||||
if (!this.playlist.length) {
|
||||
// Nothing to play: hide the shell instead of crashing below.
|
||||
$("player-shell")?.style.setProperty("display", "none");
|
||||
$("player:spacer")?.style.setProperty("display", "none");
|
||||
return;
|
||||
}
|
||||
|
||||
this.UI = {
|
||||
root: $("player-shell"),
|
||||
spacer: $("player:spacer"),
|
||||
@@ -314,7 +423,11 @@ const playerArtworkOpacity = 0.4;
|
||||
pause: $("player:controls:pause"),
|
||||
previous: $("player:controls:previous"),
|
||||
next: $("player:controls:next"),
|
||||
minimise: $("player:controls:minimise")
|
||||
minimise: $("player:controls:minimise"),
|
||||
mute: $("player:controls:mute"),
|
||||
volumeOn: $("player:controls:volume-on"),
|
||||
volumeOff: $("player:controls:volume-off"),
|
||||
volume: $("player:controls:volume")
|
||||
},
|
||||
times: {
|
||||
current: $("player:times:current"),
|
||||
@@ -344,7 +457,8 @@ const playerArtworkOpacity = 0.4;
|
||||
faceControls: {
|
||||
toggle: $("player:face:controls:toggle"),
|
||||
play: $("player:face:controls:play"),
|
||||
pause: $("player:face:controls:pause")
|
||||
pause: $("player:face:controls:pause"),
|
||||
expand: $("player:face:controls:expand")
|
||||
}
|
||||
};
|
||||
|
||||
@@ -396,6 +510,25 @@ const playerArtworkOpacity = 0.4;
|
||||
e.stopPropagation();
|
||||
window.player.setminimised(true);
|
||||
});
|
||||
this.UI.controls.mute.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
window.player.toggleMute();
|
||||
});
|
||||
this.UI.controls.volume.addEventListener("input", (e) => {
|
||||
e.stopPropagation();
|
||||
window.player.setVolume(e.target.value / 100);
|
||||
});
|
||||
|
||||
try {
|
||||
const stored = parseFloat(localStorage.getItem("player-volume"));
|
||||
if (Number.isFinite(stored)) {
|
||||
this.volume = Math.min(Math.max(stored, 0), 1);
|
||||
this.lastVolume = this.volume > 0 ? this.volume : 1;
|
||||
}
|
||||
} catch (e) {
|
||||
/* ignore */
|
||||
}
|
||||
this.syncVolumeUI();
|
||||
|
||||
this.UI.progress.bar.addEventListener("click", function (event) {
|
||||
event.stopPropagation();
|
||||
@@ -405,6 +538,34 @@ const playerArtworkOpacity = 0.4;
|
||||
window.player.seek(Math.min(Math.max(per, 0), 1));
|
||||
});
|
||||
|
||||
this.UI.progress.bar.addEventListener("keydown", (event) => {
|
||||
if (
|
||||
event.key !== "ArrowLeft" &&
|
||||
event.key !== "ArrowRight" &&
|
||||
event.key !== "Home" &&
|
||||
event.key !== "End"
|
||||
) {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const player = window.player;
|
||||
const current = player.playlist[player.index];
|
||||
if (!current) return;
|
||||
const sound = current.howl;
|
||||
const duration = sound?.duration() || 0 || current.duration || 0;
|
||||
if (duration <= 0) return;
|
||||
const position = sound
|
||||
? sound.seek() || 0
|
||||
: (player.pendingSeek ?? 0) * duration;
|
||||
let target = position;
|
||||
if (event.key === "ArrowLeft") target = position - 5;
|
||||
if (event.key === "ArrowRight") target = position + 5;
|
||||
if (event.key === "Home") target = 0;
|
||||
if (event.key === "End") target = duration;
|
||||
window.player.seek(duration > 0 ? target / duration : 0);
|
||||
});
|
||||
|
||||
// Tap the circle to expand (not the play button).
|
||||
const expand = (e) => {
|
||||
if (!window.player.minimised) return;
|
||||
@@ -414,12 +575,14 @@ const playerArtworkOpacity = 0.4;
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (e.type === "keydown" && e.key !== "Enter" && e.key !== " ") return;
|
||||
e.preventDefault();
|
||||
window.player.setminimised(false);
|
||||
};
|
||||
this.UI.root.addEventListener("click", expand);
|
||||
this.UI.root.addEventListener("keydown", expand);
|
||||
this.UI.faceControls.expand.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
window.player.setminimised(false);
|
||||
});
|
||||
this.UI.faceControls.toggle.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
const sound = window.player.playlist[window.player.index].howl;
|
||||
@@ -433,6 +596,38 @@ const playerArtworkOpacity = 0.4;
|
||||
window.playerIsInitialised = true;
|
||||
}
|
||||
|
||||
syncVolumeUI() {
|
||||
Howler.volume(this.volume);
|
||||
this.UI.controls.volume.value = String(Math.round(this.volume * 100));
|
||||
const muted = this.volume <= 0;
|
||||
this.UI.controls.volumeOn.classList.toggle("hidden", muted);
|
||||
this.UI.controls.volumeOff.classList.toggle("hidden", !muted);
|
||||
this.UI.controls.mute.setAttribute(
|
||||
"aria-label",
|
||||
muted ? "Unmute" : "Mute"
|
||||
);
|
||||
this.UI.controls.mute.setAttribute(
|
||||
"aria-pressed",
|
||||
muted ? "true" : "false"
|
||||
);
|
||||
try {
|
||||
localStorage.setItem("player-volume", String(this.volume));
|
||||
} catch (e) {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
setVolume(volume) {
|
||||
if (!Number.isFinite(volume)) return;
|
||||
this.volume = Math.min(Math.max(volume, 0), 1);
|
||||
if (this.volume > 0) this.lastVolume = this.volume;
|
||||
this.syncVolumeUI();
|
||||
}
|
||||
|
||||
toggleMute() {
|
||||
this.setVolume(this.volume > 0 ? 0 : this.lastVolume || 1);
|
||||
}
|
||||
|
||||
setminimised(minimised) {
|
||||
this.minimised = minimised;
|
||||
try {
|
||||
@@ -444,29 +639,17 @@ const playerArtworkOpacity = 0.4;
|
||||
}
|
||||
|
||||
// One class drives the morph; re-applying is a no-op.
|
||||
// Note: the shell stays a plain div so the face buttons inside it are
|
||||
// never nested interactives; keyboard users get dedicated buttons.
|
||||
applyminimised() {
|
||||
if (!this.UI.root) return;
|
||||
if (this.minimised) {
|
||||
this.UI.root.classList.add("player--minimised");
|
||||
this.UI.root.setAttribute("role", "button");
|
||||
this.UI.root.setAttribute("tabindex", "0");
|
||||
this.UI.root.setAttribute(
|
||||
"title",
|
||||
"Expand player — click to restore full size"
|
||||
);
|
||||
this.UI.root.setAttribute(
|
||||
"aria-label",
|
||||
"Expand player — click to restore full size"
|
||||
);
|
||||
this.UI.spacer?.classList.add("player-spacer--hidden");
|
||||
this.UI.full?.setAttribute("aria-hidden", "true");
|
||||
this.UI.face?.setAttribute("aria-hidden", "false");
|
||||
} else {
|
||||
this.UI.root.classList.remove("player--minimised");
|
||||
this.UI.root.removeAttribute("role");
|
||||
this.UI.root.removeAttribute("tabindex");
|
||||
this.UI.root.removeAttribute("title");
|
||||
this.UI.root.removeAttribute("aria-label");
|
||||
this.UI.spacer?.classList.remove("player-spacer--hidden");
|
||||
this.UI.full?.removeAttribute("aria-hidden");
|
||||
this.UI.face?.setAttribute("aria-hidden", "true");
|
||||
@@ -506,6 +689,14 @@ const playerArtworkOpacity = 0.4;
|
||||
set.pause.classList.toggle("hidden", !isPlaying);
|
||||
set.play.classList.toggle("hidden", isPlaying);
|
||||
}
|
||||
this.UI.faceControls.toggle?.setAttribute(
|
||||
"aria-label",
|
||||
isPlaying ? "Pause" : "Play"
|
||||
);
|
||||
this.UI.faceControls.toggle?.setAttribute(
|
||||
"title",
|
||||
isPlaying ? "Pause" : "Play"
|
||||
);
|
||||
}
|
||||
|
||||
setRingProgress(el, per) {
|
||||
@@ -559,6 +750,17 @@ const playerArtworkOpacity = 0.4;
|
||||
// Begin playing the sound.
|
||||
sound.play();
|
||||
|
||||
// Apply a seek requested before anything was loaded.
|
||||
if (this.pendingSeek != null) {
|
||||
const target = data.duration * this.pendingSeek;
|
||||
this.pendingSeek = null;
|
||||
if (sound.state() === "loaded") {
|
||||
sound.seek(target);
|
||||
} else {
|
||||
sound.once("load", () => sound.seek(target));
|
||||
}
|
||||
}
|
||||
|
||||
// Update the track display.
|
||||
this.UI.metadata.title.textContent = data.metadata.title;
|
||||
this.UI.metadata.subtitle.textContent = data.metadata.subtitle;
|
||||
@@ -618,6 +820,9 @@ const playerArtworkOpacity = 0.4;
|
||||
* @param {Number} index Index in the playlist.
|
||||
*/
|
||||
skipTo(index) {
|
||||
// A pre-play seek belongs to the old track: drop it.
|
||||
this.pendingSeek = null;
|
||||
|
||||
// Stop the current track.
|
||||
if (this.playlist[this.index].howl) {
|
||||
this.playlist[this.index].howl.stop();
|
||||
@@ -637,13 +842,30 @@ const playerArtworkOpacity = 0.4;
|
||||
* @param {Number} per Percentage through the song to skip.
|
||||
*/
|
||||
seek(per) {
|
||||
// Get the Howl we want to manipulate.
|
||||
var sound = this.playlist[this.index].howl;
|
||||
const entry = this.playlist[this.index];
|
||||
if (!entry) return;
|
||||
const clamped = Math.min(Math.max(per, 0), 1);
|
||||
const total = entry.duration || 0;
|
||||
const target = total * clamped;
|
||||
|
||||
if (sound.playing()) {
|
||||
// Convert the percent into a seek position.
|
||||
sound.seek(sound.duration() * per);
|
||||
var sound = entry.howl;
|
||||
if (!sound) {
|
||||
// Nothing loaded yet: remember the request for play().
|
||||
this.pendingSeek = clamped;
|
||||
} else {
|
||||
this.pendingSeek = null;
|
||||
sound.seek((sound.duration() || total) * clamped);
|
||||
}
|
||||
|
||||
// Refresh the position display even when paused or unloaded.
|
||||
this.UI.times.current.textContent = this.formatTime(Math.round(target));
|
||||
const playedPer = total > 0 ? clamped : 0;
|
||||
this.UI.progress.played.style.width = playedPer * 100 + "%";
|
||||
this.UI.progress.bar.setAttribute(
|
||||
"aria-valuenow",
|
||||
String(Math.round(playedPer * 100))
|
||||
);
|
||||
this.setRingProgress(this.UI.faceProgress.played, playedPer);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -657,6 +879,10 @@ const playerArtworkOpacity = 0.4;
|
||||
this.UI.times.current.textContent = this.formatTime(Math.round(seek));
|
||||
const playedPer = seek / sound.duration() || 0;
|
||||
this.UI.progress.played.style.width = playedPer * 100 + "%";
|
||||
this.UI.progress.bar.setAttribute(
|
||||
"aria-valuenow",
|
||||
String(Math.round(playedPer * 100))
|
||||
);
|
||||
this.setRingProgress(this.UI.faceProgress.played, playedPer);
|
||||
|
||||
const bufferedPercent = this.getBufferedAmount(sound).bufferedPercent;
|
||||
@@ -708,6 +934,7 @@ const playerArtworkOpacity = 0.4;
|
||||
}
|
||||
|
||||
addToQueue(track, immediatePlay = false) {
|
||||
if (!this.playlist.length) return;
|
||||
var current = this.playlist[this.index];
|
||||
|
||||
if (
|
||||
@@ -729,13 +956,39 @@ const playerArtworkOpacity = 0.4;
|
||||
if (!window.playerIsInitialised) {
|
||||
window.player = new Player(initialQueue);
|
||||
} else {
|
||||
// View-transition restore: re-grab nodes and re-apply.
|
||||
// View-transition restore: re-grab every node without re-binding listeners (they persist with the shell), then re-apply.
|
||||
try {
|
||||
const p = window.player;
|
||||
p.UI.root = $("player-shell");
|
||||
p.UI.spacer = $("player:spacer");
|
||||
p.UI.full = document.querySelector("#player-shell .player-full");
|
||||
p.UI.face = document.querySelector("#player-shell .player-face");
|
||||
p.UI.controls.play = $("player:controls:play");
|
||||
p.UI.controls.pause = $("player:controls:pause");
|
||||
p.UI.controls.previous = $("player:controls:previous");
|
||||
p.UI.controls.next = $("player:controls:next");
|
||||
p.UI.controls.minimise = $("player:controls:minimise");
|
||||
p.UI.controls.mute = $("player:controls:mute");
|
||||
p.UI.controls.volumeOn = $("player:controls:volume-on");
|
||||
p.UI.controls.volumeOff = $("player:controls:volume-off");
|
||||
p.UI.controls.volume = $("player:controls:volume");
|
||||
p.UI.times.current = $("player:times:current");
|
||||
p.UI.times.duration = $("player:times:duration");
|
||||
p.UI.metadata.title = $("player:metadata:title");
|
||||
p.UI.metadata.subtitle = $("player:metadata:subtitle");
|
||||
p.UI.metadata.extra = $("player:metadata:extra");
|
||||
p.UI.progress.bar = $("player:time:progress");
|
||||
p.UI.progress.buffered = $("player:time:progress:buffered");
|
||||
p.UI.progress.played = $("player:time:progress:played");
|
||||
p.UI.artwork.background = $("player:artwork:background");
|
||||
p.UI.faceArtwork.img = $("player:face:artwork");
|
||||
p.UI.faceArtwork.fallback = $("player:face:fallback");
|
||||
p.UI.faceProgress.buffered = $("player:face:progress:buffered");
|
||||
p.UI.faceProgress.played = $("player:face:progress:played");
|
||||
p.UI.faceControls.toggle = $("player:face:controls:toggle");
|
||||
p.UI.faceControls.play = $("player:face:controls:play");
|
||||
p.UI.faceControls.pause = $("player:face:controls:pause");
|
||||
p.UI.faceControls.expand = $("player:face:controls:expand");
|
||||
p.applyminimised();
|
||||
} catch (e) {
|
||||
/* ignore */
|
||||
|
||||
@@ -171,7 +171,7 @@ const link = `/projects/${slugify(project.data.type)}/${slugify(project.data.slu
|
||||
{project.data.keyFigure.map((figure) => {
|
||||
return (
|
||||
<div>
|
||||
<span class="font-bold">{figure.title}:</span>
|
||||
<span class="font-bold">{figure.title}: </span>
|
||||
<span>
|
||||
{figure.href && (
|
||||
<TextLink href={figure.href}>{figure.name}</TextLink>
|
||||
|
||||
@@ -7,6 +7,7 @@ interface Props {
|
||||
}
|
||||
|
||||
const { title, description, url = Astro.url, image } = Astro.props;
|
||||
const canonicalUrl = url.toString();
|
||||
|
||||
import person from "@data/person";
|
||||
import site from "@data/site";
|
||||
@@ -15,7 +16,7 @@ import { Schema } from "astro-seo-schema";
|
||||
---
|
||||
|
||||
<!-- SEO -->
|
||||
<link rel="canonical" href={url} />
|
||||
<link rel="canonical" href={canonicalUrl} />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<Schema
|
||||
item={{
|
||||
@@ -65,7 +66,8 @@ import { Schema } from "astro-seo-schema";
|
||||
<meta property="og:site_name" content={site.title} />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:url" content={url} />
|
||||
<meta property="og:url" content={canonicalUrl} />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta
|
||||
property="og:image"
|
||||
content={image !== undefined && image.externalURL !== undefined
|
||||
@@ -98,7 +100,7 @@ import { Schema } from "astro-seo-schema";
|
||||
<meta name="twitter:description" content={description} />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta
|
||||
name="twitter:image:src"
|
||||
name="twitter:image"
|
||||
content={image !== undefined && image.externalURL !== undefined
|
||||
? image.externalURL
|
||||
: site.image.externalURL}
|
||||
|
||||
@@ -9,7 +9,7 @@ interface Props {
|
||||
const {
|
||||
Tag = "h2",
|
||||
lineColour = "border-primary",
|
||||
lineColourDark = "dark:text-primary",
|
||||
lineColourDark = "dark:border-primary",
|
||||
class: className
|
||||
} = Astro.props;
|
||||
---
|
||||
|
||||
@@ -28,7 +28,7 @@ const linkIsExternal: boolean =
|
||||
{...attrs}
|
||||
><span class="group-hover:text-primary-600"><slot /></span>{
|
||||
includeExternalLinkIcon && linkIsExternal && (
|
||||
<sup class="ml-0.5 inline-block">
|
||||
<sup class="ml-0.5 inline-block" aria-hidden="true">
|
||||
<Icon
|
||||
name="mdi:external-link"
|
||||
class:list={[
|
||||
|
||||
@@ -6,6 +6,7 @@ interface Props extends HTMLAttributes<"span"> {
|
||||
textColour?: String;
|
||||
size?: String;
|
||||
hover?: String;
|
||||
as?: "span" | "button";
|
||||
}
|
||||
|
||||
const {
|
||||
@@ -14,11 +15,13 @@ const {
|
||||
size = "text-xs",
|
||||
hover = "hover:bg-white hover:text-primary hover:ring-primary hover:ring-2",
|
||||
class: className,
|
||||
as: Tag = "span",
|
||||
...attrs
|
||||
} = Astro.props as Props;
|
||||
---
|
||||
|
||||
<span
|
||||
<Tag
|
||||
type={Tag === "button" ? "button" : undefined}
|
||||
class:list={[
|
||||
"inline-block rounded px-2 py-1 font-bold uppercase",
|
||||
colour,
|
||||
@@ -27,5 +30,5 @@ const {
|
||||
size,
|
||||
hover
|
||||
]}
|
||||
{...attrs}><slot /></span
|
||||
{...attrs}><slot /></Tag
|
||||
>
|
||||
@@ -20,7 +20,9 @@ if (!track.data.card) {
|
||||
}
|
||||
---
|
||||
|
||||
<div
|
||||
<button
|
||||
type="button"
|
||||
aria-label={`Play ${track.data.card.text.primary}`}
|
||||
class:list={[
|
||||
"relative flex min-h-42 flex-auto hover:cursor-pointer",
|
||||
index < 2 ? "lg:w-1/2" : "sm:w-1/2 md:w-1/3 lg:w-1/4"
|
||||
@@ -33,8 +35,8 @@ if (!track.data.card) {
|
||||
class="h-full w-full object-cover"
|
||||
/>
|
||||
|
||||
<div
|
||||
class="bg-primary absolute inset-0 z-10 flex h-full w-full flex-col items-center justify-center p-16 text-center opacity-0 transition duration-300 hover:opacity-90"
|
||||
<span
|
||||
class="bg-primary absolute inset-0 z-10 flex h-full w-full flex-col items-center justify-center p-16 text-center opacity-0 transition duration-300 hover:opacity-90 focus-visible:opacity-90"
|
||||
>
|
||||
<span class="text-md md:text-l block font-bold text-gray-100"
|
||||
>{track.data.card.text.secondary}</span
|
||||
@@ -42,5 +44,5 @@ if (!track.data.card) {
|
||||
<span class="block text-xl font-extrabold uppercase md:text-2xl"
|
||||
>{track.data.card.text.primary}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</button>
|
||||
@@ -21,7 +21,9 @@ const fullFilePath = join(process.cwd(), "public", track.data.src);
|
||||
const duration = await getAudioDurationInSeconds(fullFilePath);
|
||||
---
|
||||
|
||||
<div
|
||||
<button
|
||||
type="button"
|
||||
aria-label={`Play ${track.data.metadata.title}`}
|
||||
class:list={[
|
||||
"text-primary flex items-center transition hover:cursor-pointer hover:text-gray-300",
|
||||
className
|
||||
@@ -31,4 +33,4 @@ const duration = await getAudioDurationInSeconds(fullFilePath);
|
||||
>
|
||||
<Icon name="fa7-solid:play-circle" class="mr-2 inline-block" />
|
||||
<span class="inline-block">{track.data.metadata.title}</span>
|
||||
</div>
|
||||
</button>
|
||||
@@ -1,5 +1,6 @@
|
||||
import { glob } from "astro/loaders";
|
||||
import { defineCollection, z } from "astro:content";
|
||||
import { z } from "astro/zod";
|
||||
import { defineCollection } from "astro:content";
|
||||
|
||||
const projects = defineCollection({
|
||||
loader: glob({ pattern: "**/*.mdx", base: "./projects" }),
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ export default {
|
||||
"Nathan Cummins is an award-winning composer, orchestrator, sound designer, and conductor known for his vibrant music across video games, film, and live performance. Based in Adelaide, he brings classical craft, bold creativity, and technical innovation to every project.",
|
||||
tagline: "Composer, Orchestrator, Conductor, Sound Designer",
|
||||
image: {
|
||||
externalURL: `${import.meta.env.SITE}/nathan-cummins-composer-orchestrator-conductor.jpg`,
|
||||
externalURL: `${import.meta.env.SITE ?? "https://www.nathancummins.com.au"}/nathan-cummins-composer-orchestrator-conductor.jpg`,
|
||||
src: "nathan-cummins-composer-orchestrator-conductor.jpg",
|
||||
alt: "Picture of Nathan Cummins, Adelaide composer, orchestrator, and conductor"
|
||||
} as SiteImage
|
||||
|
||||
Vendored
+2
-3
@@ -1,4 +1,4 @@
|
||||
/// <reference types="@astrojs/image/client" />
|
||||
/// <reference types="astro/client" />
|
||||
/// <reference types="./types/SiteImage" />
|
||||
|
||||
interface Window {
|
||||
@@ -14,10 +14,9 @@ interface Window {
|
||||
}
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly SITE?: string;
|
||||
readonly EMAIL_USER: string;
|
||||
readonly EMAIL_PASS: string;
|
||||
readonly EMAIL_PORT: number;
|
||||
readonly EMAIL_PORT: string;
|
||||
readonly EMAIL_SECURE: "true" | "false";
|
||||
readonly EMAIL_HOST: string;
|
||||
readonly EMAIL_FROM: string;
|
||||
|
||||
@@ -26,7 +26,7 @@ import MainHead from "@layouts/MainHead.astro";
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<MainHead {title} {subtitle} {description} {image} />
|
||||
<body class="flex min-h-svh flex-col">
|
||||
<body class="flex min-h-svh flex-col overflow-x-clip">
|
||||
<Navbar {navbarDisplay} />
|
||||
<main class="grow bg-white dark:bg-gray-950">
|
||||
<slot />
|
||||
|
||||
+50
-16
@@ -1,4 +1,4 @@
|
||||
import { createTransport } from "nodemailer";
|
||||
import { createTransport, type Transporter } from "nodemailer";
|
||||
import SMTPTransport from "nodemailer/lib/smtp-transport";
|
||||
|
||||
import type { Options } from "nodemailer/lib/mailer";
|
||||
@@ -11,29 +11,63 @@ interface Email {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export function constructEmailHtml(props: Email) {
|
||||
return `<div>${props.message}</div>`;
|
||||
export function escapeHtml(input: string): string {
|
||||
return input
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
|
||||
export default async function (props: Email) {
|
||||
const transporter = createTransport({
|
||||
host: process.env.EMAIL_HOST || import.meta.env.EMAIL_HOST,
|
||||
port: process.env.EMAIL_PORT || import.meta.env.EMAIL_PORT,
|
||||
secure:
|
||||
process.env.EMAIL_SECURE === "true" ||
|
||||
import.meta.env.EMAIL_SECURE === "true",
|
||||
auth: {
|
||||
user: process.env.EMAIL_USER || import.meta.env.EMAIL_USER,
|
||||
pass: process.env.EMAIL_PASS || import.meta.env.EMAIL_PASS
|
||||
}
|
||||
} as SMTPTransport.Options);
|
||||
export function constructEmailHtml(props: Email) {
|
||||
return `<div>${escapeHtml(props.message)}</div>`;
|
||||
}
|
||||
|
||||
// Cached for the process lifetime: config comes from the environment and
|
||||
// does not change between requests.
|
||||
let cachedTransporter: Transporter | null = null;
|
||||
|
||||
function getTransporter(port: number, secure: boolean): Transporter {
|
||||
if (!cachedTransporter) {
|
||||
cachedTransporter = createTransport({
|
||||
host: process.env.EMAIL_HOST || import.meta.env.EMAIL_HOST,
|
||||
port,
|
||||
secure,
|
||||
// Refuse plaintext fallback on submission ports (e.g. 587, 2525).
|
||||
requireTLS: !secure,
|
||||
auth: {
|
||||
user: process.env.EMAIL_USER || import.meta.env.EMAIL_USER,
|
||||
pass: process.env.EMAIL_PASS || import.meta.env.EMAIL_PASS
|
||||
}
|
||||
} as SMTPTransport.Options);
|
||||
}
|
||||
return cachedTransporter;
|
||||
}
|
||||
|
||||
export default async function sendContactEmail(props: Email) {
|
||||
const port = parseInt(
|
||||
process.env.EMAIL_PORT || import.meta.env.EMAIL_PORT || "",
|
||||
10
|
||||
);
|
||||
const fromMailbox =
|
||||
process.env.EMAIL_FROM || import.meta.env.EMAIL_FROM || "";
|
||||
if (!Number.isFinite(port) || !fromMailbox) {
|
||||
throw new Error("Email transport is not configured.");
|
||||
}
|
||||
|
||||
const secure =
|
||||
process.env.EMAIL_SECURE === "true" ||
|
||||
import.meta.env.EMAIL_SECURE === "true";
|
||||
|
||||
const transporter = getTransporter(port, secure);
|
||||
|
||||
if (!props.html) {
|
||||
props.html = constructEmailHtml(props);
|
||||
}
|
||||
|
||||
const message: Options = {
|
||||
from: `${props.name} (Website) <${process.env.EMAIL_FROM || import.meta.env.EMAIL_FROM}>`,
|
||||
from: `Website Contact <${fromMailbox}>`,
|
||||
to: "nathan@nathancummins.com.au",
|
||||
replyTo: props.email,
|
||||
subject: props.subject,
|
||||
|
||||
@@ -14,6 +14,7 @@ const heroImagesArray = await convertEagerImagesImportGlobToArray(heroImages);
|
||||
<MainLayout title="Oops! 404" navbarDisplay="transparent">
|
||||
<div class="absolute inset-0 h-full w-full bg-black">
|
||||
<ImageCarousel
|
||||
id="not-found"
|
||||
images={heroImagesArray}
|
||||
class="h-full w-full"
|
||||
foreground={true}
|
||||
|
||||
@@ -67,10 +67,8 @@ import { Image } from "astro:assets";
|
||||
<ul>
|
||||
<LI>
|
||||
<span class="font-bold"
|
||||
><TextLink
|
||||
href="/projects/video-game/dungeons-and-dining-tables/"
|
||||
>
|
||||
Dungeons and Dining Tables</TextLink
|
||||
><TextLink href="/projects/video-game/dungeons-and-dining-tables/"
|
||||
>Dungeons and Dining Tables</TextLink
|
||||
>:</span
|
||||
> a cosy, highly orchestral score full of warmth and colour.
|
||||
</LI>
|
||||
@@ -124,7 +122,7 @@ import { Image } from "astro:assets";
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
<section id="Conducting">
|
||||
<section id="conducting">
|
||||
<div class="mx-auto max-w-4xl px-8 text-left">
|
||||
<H2>Conducting</H2>
|
||||
<Paragraph
|
||||
|
||||
@@ -1,52 +1,115 @@
|
||||
import sendEmail from "@lib/email";
|
||||
import sendEmail, { escapeHtml } from "@lib/email";
|
||||
import type { APIRoute } from "astro";
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const POST: APIRoute = async ({ request }) => {
|
||||
const data = await request.formData();
|
||||
const email = data.get("email") as string | null;
|
||||
const subject = data.get("subject") as string | null;
|
||||
const message = data.get("message") as string | null;
|
||||
const name = data.get("name") as string | null;
|
||||
const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
const MAX_NAME = 100;
|
||||
const MAX_EMAIL = 254;
|
||||
const MAX_SUBJECT = 150;
|
||||
const MAX_MESSAGE = 5000;
|
||||
|
||||
// Minimal in-memory throttle (single instance): 5 sends per IP per 10 min.
|
||||
const RATE_WINDOW_MS = 10 * 60 * 1000;
|
||||
const RATE_MAX = 5;
|
||||
const recentSends = new Map<string, number[]>();
|
||||
|
||||
function isRateLimited(ip: string): boolean {
|
||||
const now = Date.now();
|
||||
const history = (recentSends.get(ip) ?? []).filter(
|
||||
(t) => now - t < RATE_WINDOW_MS
|
||||
);
|
||||
if (history.length >= RATE_MAX) {
|
||||
recentSends.set(ip, history);
|
||||
return true;
|
||||
}
|
||||
history.push(now);
|
||||
recentSends.set(ip, history);
|
||||
// Prune expired entries so the map cannot grow without bound.
|
||||
if (recentSends.size > 500) {
|
||||
for (const [key, times] of recentSends) {
|
||||
if (!times.some((t) => now - t < RATE_WINDOW_MS)) {
|
||||
recentSends.delete(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function json(message: string, status: number, statusText: string): Response {
|
||||
return new Response(JSON.stringify({ message }), {
|
||||
status,
|
||||
statusText,
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
}
|
||||
|
||||
export const POST: APIRoute = async ({ request, clientAddress }) => {
|
||||
// Prefer the socket address: x-forwarded-for is client-controlled.
|
||||
const ip = clientAddress || "unknown";
|
||||
if (isRateLimited(ip)) {
|
||||
return json(
|
||||
"Too many messages sent. Please try again later.",
|
||||
429,
|
||||
"Too Many Requests"
|
||||
);
|
||||
}
|
||||
|
||||
let data: FormData;
|
||||
try {
|
||||
data = await request.formData();
|
||||
} catch (error) {
|
||||
console.error("Contact form parse failed:", error);
|
||||
return json("Invalid request.", 400, "Bad Request");
|
||||
}
|
||||
const email = (data.get("email") as string | null)?.trim() ?? "";
|
||||
const subject = (data.get("subject") as string | null)?.trim() ?? "";
|
||||
const message = (data.get("message") as string | null)?.trim() ?? "";
|
||||
const name = (data.get("name") as string | null)?.trim() ?? "";
|
||||
|
||||
if (!email || !subject || !message || !name) {
|
||||
return new Response(
|
||||
JSON.stringify({ message: "Required field missing." }),
|
||||
{
|
||||
status: 400,
|
||||
statusText: "Missing required fields."
|
||||
}
|
||||
);
|
||||
return json("Required field missing.", 400, "Bad Request");
|
||||
}
|
||||
|
||||
if (
|
||||
!EMAIL_RE.test(email) ||
|
||||
email.length > MAX_EMAIL ||
|
||||
subject.length > MAX_SUBJECT ||
|
||||
message.length > MAX_MESSAGE ||
|
||||
name.length > MAX_NAME
|
||||
) {
|
||||
return json("Invalid field value.", 400, "Bad Request");
|
||||
}
|
||||
|
||||
// Strip line breaks so values can never smuggle SMTP headers.
|
||||
const safeSubject = subject.replace(/[\r\n]+/g, " ");
|
||||
const safeName = name.replace(/[\r\n]+/g, " ");
|
||||
|
||||
const html = `<h1>Message Received via Contact Form</h1><br>
|
||||
<b>Name</b>: ${name}<br>
|
||||
<b>Email</b>: ${email}<br>
|
||||
<b>Message</b>: ${message}`;
|
||||
<b>Name</b>: ${escapeHtml(safeName)}<br>
|
||||
<b>Email</b>: ${escapeHtml(email)}<br>
|
||||
<b>Message</b>: ${escapeHtml(message).replace(/\n/g, "<br>")}`;
|
||||
|
||||
try {
|
||||
await sendEmail({ email, subject, message, name, html });
|
||||
await sendEmail({
|
||||
email,
|
||||
subject: safeSubject,
|
||||
message,
|
||||
name: safeName,
|
||||
html
|
||||
});
|
||||
} catch (error) {
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
message: `Message failed to send with an internal server error. Please contact me directly via a method below.`
|
||||
}),
|
||||
{
|
||||
status: 500,
|
||||
statusText: `Message failed to send with an internal server error. Please contact me directly via a method below.`
|
||||
}
|
||||
console.error("Contact email failed to send:", error);
|
||||
return json(
|
||||
`Message failed to send with an internal server error. Please contact me directly via a method below.`,
|
||||
500,
|
||||
"Internal Server Error"
|
||||
);
|
||||
}
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
message:
|
||||
"Thanks for getting in touch! I will try to get back to you as soon as I can."
|
||||
}),
|
||||
{
|
||||
status: 200,
|
||||
statusText: "OK"
|
||||
}
|
||||
return json(
|
||||
"Thanks for getting in touch! I will try to get back to you as soon as I can.",
|
||||
200,
|
||||
"OK"
|
||||
);
|
||||
};
|
||||
+11
-4
@@ -11,8 +11,11 @@ import { Icon } from "astro-icon/components";
|
||||
<div class="w-full">
|
||||
<section id="contact" class="bg-primary dark:bg-gray-800">
|
||||
<div class="mx-auto max-w-4xl px-8 py-16 text-center">
|
||||
<SectionTitle Tag="h1" class="text-white" lineColour="text-white"
|
||||
>Let's get in touch!</SectionTitle
|
||||
<SectionTitle
|
||||
Tag="h1"
|
||||
class="text-white"
|
||||
lineColour="border-white"
|
||||
lineColourDark="dark:border-white">Let's get in touch!</SectionTitle
|
||||
>
|
||||
<ContactForm />
|
||||
</div>
|
||||
@@ -22,13 +25,17 @@ import { Icon } from "astro-icon/components";
|
||||
<SectionTitle>Other ways to reach me</SectionTitle>
|
||||
<div class="grid grid-cols-1 text-lg md:grid-cols-2">
|
||||
<div class="col-span-1 flex flex-col items-center justify-center p-4">
|
||||
<Icon name="fa7-solid:at" class="text-4xl" />
|
||||
<Icon name="fa7-solid:at" class="text-4xl" aria-hidden="true" />
|
||||
<TextLink href="mailto:nathan@nathancummins.com.au" class="mt-4"
|
||||
>nathan@nathancummins.com.au</TextLink
|
||||
>
|
||||
</div>
|
||||
<div class="col-span-1 flex flex-col items-center justify-center p-4">
|
||||
<Icon name="fa7-solid:envelope" class="text-4xl" />
|
||||
<Icon
|
||||
name="fa7-solid:envelope"
|
||||
class="text-4xl"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<Paragraph class="my-0 mt-4"
|
||||
>PO Box 2112 Regency Park SA 5942</Paragraph
|
||||
>
|
||||
|
||||
+37
-20
@@ -17,28 +17,28 @@ import { Image } from "astro:assets";
|
||||
|
||||
import { Icon } from "astro-icon/components";
|
||||
|
||||
import { convertEagerImagesImportGlobToArray } from "@lib/utils";
|
||||
import {
|
||||
convertEagerImagesImportGlobToArray,
|
||||
getProjectHero
|
||||
} from "@lib/utils";
|
||||
|
||||
const heroImages = import.meta.glob<{ default: ImageMetadata; eager: true }>(
|
||||
"../assets/img/hero/*"
|
||||
);
|
||||
const heroImagesArray = await convertEagerImagesImportGlobToArray(heroImages);
|
||||
|
||||
const imagesForCTA = import.meta.glob<{ default: ImageMetadata; eager: true }>([
|
||||
"../assets/img/hero/*",
|
||||
"../assets/img/project-heros/*",
|
||||
"../assets/img/projects/**"
|
||||
]);
|
||||
|
||||
const imagesForCTAArray =
|
||||
await convertEagerImagesImportGlobToArray(imagesForCTA);
|
||||
|
||||
const projects = (
|
||||
await getCollection("projects", ({ data }) => data.frontPage)
|
||||
).sort(
|
||||
(a, b) => (a.data.frontPage?.order || 0) - (b.data.frontPage?.order || 1)
|
||||
);
|
||||
|
||||
// Curated carousel set: site heroes + heroes of featured projects only, instead of every image in the repo. Shared by both CTA carousels.
|
||||
const imagesForCTAArray = [
|
||||
...heroImagesArray,
|
||||
...projects.map((project) => getProjectHero(project))
|
||||
];
|
||||
|
||||
const awards = (await getCollection("awards")).sort(
|
||||
(a, b) => b.data.date.valueOf() - a.data.date.valueOf()
|
||||
);
|
||||
@@ -53,9 +53,10 @@ const tracks = (
|
||||
---
|
||||
|
||||
<MainLayout navbarDisplay="transparent">
|
||||
<div class="h-screen w-full flex-row">
|
||||
<div class="min-h-svh w-full flex-row">
|
||||
<div class="absolute inset-0 h-full w-full bg-black">
|
||||
<ImageCarousel
|
||||
id="hero"
|
||||
images={heroImagesArray}
|
||||
class="h-full w-full"
|
||||
foreground={true}
|
||||
@@ -67,8 +68,7 @@ const tracks = (
|
||||
<h1
|
||||
class="font-header pb-8 text-5xl font-medium text-white uppercase text-shadow-lg/75 md:text-7xl lg:text-9xl"
|
||||
>
|
||||
{person.names.first}
|
||||
{person.names.last}
|
||||
{person.names.first}{" "}{person.names.last}
|
||||
</h1>
|
||||
<h2
|
||||
class="font-header text-2xl font-medium text-gray-300 uppercase text-shadow-lg/75 md:text-2xl lg:text-4xl"
|
||||
@@ -108,6 +108,7 @@ const tracks = (
|
||||
<section id="cta" class="text-white">
|
||||
<div class="flex h-48 w-full items-center justify-center">
|
||||
<ImageCarousel
|
||||
id="cta"
|
||||
images={imagesForCTAArray}
|
||||
class="h-full w-full"
|
||||
foreground={true}
|
||||
@@ -118,6 +119,7 @@ const tracks = (
|
||||
quality={5}
|
||||
height={192}
|
||||
shuffle={true}
|
||||
eagerCount={4}
|
||||
><div class="flex h-full w-full items-center">
|
||||
<a
|
||||
href="/contact/"
|
||||
@@ -159,8 +161,10 @@ const tracks = (
|
||||
<section id="listen" class="bg-primary text-white dark:bg-gray-800">
|
||||
<div class="w-full overflow-hidden">
|
||||
<div class="pt-16 text-center">
|
||||
<SectionTitle lineColour="text-white">Listen</SectionTitle>
|
||||
|
||||
<SectionTitle
|
||||
lineColour="border-white"
|
||||
lineColourDark="dark:border-white">Listen</SectionTitle
|
||||
>
|
||||
<Paragraph
|
||||
>Click or tap on an image below to listen to the work.</Paragraph
|
||||
>
|
||||
@@ -176,13 +180,20 @@ const tracks = (
|
||||
<Paragraph
|
||||
>I am very grateful to have been recognised and awarded for my work.</Paragraph
|
||||
>
|
||||
<div class="md-8 h-48 overflow-hidden scroll-smooth p-0">
|
||||
<div class="mb-8 h-48 overflow-hidden scroll-smooth p-0">
|
||||
<div
|
||||
class="animate-scrolling-awards m-0 mx-auto flex max-w-md flex-col space-y-8 p-0"
|
||||
>
|
||||
{
|
||||
awardsDoubled.map((award) => {
|
||||
return <AwardCard award={award} />;
|
||||
awardsDoubled.map((award, index) => {
|
||||
// Second copy only feeds the scrolling loop: hide it from assistive tech so awards are not announced twice.
|
||||
return index < awards.length ? (
|
||||
<AwardCard award={award} />
|
||||
) : (
|
||||
<span aria-hidden="true" class="block">
|
||||
<AwardCard award={award} />
|
||||
</span>
|
||||
);
|
||||
})
|
||||
}
|
||||
</div>
|
||||
@@ -192,6 +203,7 @@ const tracks = (
|
||||
<section id="fillerUntilServicesIsComplete" class="text-white">
|
||||
<div class="flex h-96 w-full items-center justify-center">
|
||||
<ImageCarousel
|
||||
id="filler"
|
||||
images={imagesForCTAArray}
|
||||
class="h-full w-full"
|
||||
foreground={true}
|
||||
@@ -202,6 +214,7 @@ const tracks = (
|
||||
quality={5}
|
||||
height={384}
|
||||
shuffle={true}
|
||||
eagerCount={4}
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
@@ -210,13 +223,17 @@ const tracks = (
|
||||
<SectionTitle>Let's get in touch!</SectionTitle>
|
||||
<div class="grid grid-cols-1 text-lg md:grid-cols-2">
|
||||
<div class="col-span-1 flex flex-col items-center justify-center p-4">
|
||||
<Icon name="fa7-solid:at" class="text-4xl" />
|
||||
<Icon name="fa7-solid:at" class="text-4xl" aria-hidden="true" />
|
||||
<TextLink href="mailto:nathan@nathancummins.com.au" class="mt-4"
|
||||
>nathan@nathancummins.com.au</TextLink
|
||||
>
|
||||
</div>
|
||||
<div class="col-span-1 flex flex-col items-center justify-center p-4">
|
||||
<Icon name="fa7-solid:envelope" class="text-4xl" />
|
||||
<Icon
|
||||
name="fa7-solid:envelope"
|
||||
class="text-4xl"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<Paragraph class="my-0 mt-4"
|
||||
>PO Box 2112 Regency Park SA 5942</Paragraph
|
||||
>
|
||||
|
||||
@@ -23,12 +23,16 @@ const types = [...new Set(projects.map((project) => project.data.type))];
|
||||
<SectionTitle Tag="h1">Recent Projects</SectionTitle>
|
||||
<div id="filter-tokens" class="my-8 space-y-2 space-x-2">
|
||||
<Token
|
||||
as="button"
|
||||
aria-pressed="true"
|
||||
class="filter-token !text-primary ring-primary bg-white ring-2 hover:cursor-pointer"
|
||||
data-type="all">All</Token
|
||||
>
|
||||
{
|
||||
types.map((type) => (
|
||||
<Token
|
||||
as="button"
|
||||
aria-pressed="false"
|
||||
class="filter-token hover:cursor-pointer"
|
||||
data-type={slugify(type)}
|
||||
>
|
||||
@@ -70,14 +74,15 @@ const types = [...new Set(projects.map((project) => project.data.type))];
|
||||
const token = (e.target as Element).closest<HTMLElement>(".filter-token");
|
||||
if (!token) return;
|
||||
|
||||
tokens.forEach((t) =>
|
||||
tokens.forEach((t) => {
|
||||
t.classList.remove(
|
||||
"bg-white",
|
||||
"!text-primary",
|
||||
"ring-primary",
|
||||
"ring-2"
|
||||
)
|
||||
);
|
||||
);
|
||||
t.setAttribute("aria-pressed", "false");
|
||||
});
|
||||
|
||||
token.classList.add(
|
||||
"bg-white",
|
||||
@@ -85,6 +90,7 @@ const types = [...new Set(projects.map((project) => project.data.type))];
|
||||
"ring-primary",
|
||||
"ring-2"
|
||||
);
|
||||
token.setAttribute("aria-pressed", "true");
|
||||
|
||||
const type = token.dataset.type;
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ import P from "@components/MDX/P.astro";
|
||||
<section id="title" class="text-white">
|
||||
<div class="flex h-100 w-full items-center justify-center">
|
||||
<ImageCarousel
|
||||
id="project-hero"
|
||||
images={images}
|
||||
class="h-full w-full"
|
||||
foreground={true}
|
||||
@@ -93,7 +94,7 @@ import P from "@components/MDX/P.astro";
|
||||
{project.data.keyFigure.map((figure) => {
|
||||
return (
|
||||
<div>
|
||||
<span class="font-bold">{figure.title}:</span>
|
||||
<span class="font-bold">{figure.title}: </span>
|
||||
<span>
|
||||
{figure.href && (
|
||||
<TextLink href={figure.href}>
|
||||
|
||||
+6
-7
@@ -8,25 +8,24 @@
|
||||
"dist"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
"./src/*"
|
||||
],
|
||||
"@layouts/*": [
|
||||
"src/layouts/*"
|
||||
"./src/layouts/*"
|
||||
],
|
||||
"@components/*": [
|
||||
"src/components/*"
|
||||
"./src/components/*"
|
||||
],
|
||||
"@assets/*": [
|
||||
"src/assets/*"
|
||||
"./src/assets/*"
|
||||
],
|
||||
"@lib/*": [
|
||||
"src/lib/*"
|
||||
"./src/lib/*"
|
||||
],
|
||||
"@data/*": [
|
||||
"src/data/*"
|
||||
"./src/data/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user