Compare commits
5
Commits
70af555189
...
e21219aba6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e21219aba6
|
||
|
|
a2dea4b210
|
||
|
|
2001963035
|
||
|
|
57c906082f
|
||
|
|
af8f99feb0
|
No files matched your search
@@ -86,6 +86,7 @@ const { id: ID = "contact-form" } = Astro.props;
|
|||||||
const loadingIcon = form.querySelector(
|
const loadingIcon = form.querySelector(
|
||||||
`#${CSS.escape(ID + "-loading-icon")}`
|
`#${CSS.escape(ID + "-loading-icon")}`
|
||||||
);
|
);
|
||||||
|
if (!responseMsg || !button || !loadingIcon) return;
|
||||||
|
|
||||||
form.addEventListener("submit", async function (event) {
|
form.addEventListener("submit", async function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|||||||
@@ -62,5 +62,6 @@ import TextLink from "@components/TextLink.astro";
|
|||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script is:inline data-astro-rerun>
|
<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>
|
</script>
|
||||||
@@ -20,6 +20,7 @@ interface Props {
|
|||||||
quality?: number;
|
quality?: number;
|
||||||
height?: number;
|
height?: number;
|
||||||
shuffle?: boolean;
|
shuffle?: boolean;
|
||||||
|
eagerCount?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -37,10 +38,14 @@ const {
|
|||||||
foregroundOpacity = "opacity-50",
|
foregroundOpacity = "opacity-50",
|
||||||
quality = "80",
|
quality = "80",
|
||||||
height,
|
height,
|
||||||
shuffle = false
|
shuffle = false,
|
||||||
|
eagerCount = 2
|
||||||
} = Astro.props as Props;
|
} = Astro.props as Props;
|
||||||
|
|
||||||
const imagesArray = shuffle ? shuffleArray(images) : images;
|
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"]}>
|
<div class:list={[className, "relative overflow-hidden"]}>
|
||||||
@@ -58,13 +63,13 @@ const imagesArray = shuffle ? shuffleArray(images) : images;
|
|||||||
transitionStyle,
|
transitionStyle,
|
||||||
transitionDuration,
|
transitionDuration,
|
||||||
index > 0 ? "opacity-0" : "",
|
index > 0 ? "opacity-0" : "",
|
||||||
index < 2 ? "" : "hidden"
|
index < preloadCount ? "" : "hidden"
|
||||||
]}
|
]}
|
||||||
src={image}
|
src={image}
|
||||||
alt={
|
alt={
|
||||||
typeof altText === "function" ? altText(index) : (altText ?? "")
|
typeof altText === "function" ? altText(index) : (altText ?? "")
|
||||||
}
|
}
|
||||||
loading={index < 2 ? "eager" : "lazy"}
|
loading={index < eagerCount ? "eager" : "lazy"}
|
||||||
aria-hidden={index === 0 ? "false" : "true"}
|
aria-hidden={index === 0 ? "false" : "true"}
|
||||||
layout="full-width"
|
layout="full-width"
|
||||||
fit="cover"
|
fit="cover"
|
||||||
@@ -87,38 +92,74 @@ const imagesArray = shuffle ? shuffleArray(images) : images;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script
|
<script
|
||||||
define:vars={{ imageCount: imagesArray.length, carouselId: id, interval }}
|
define:vars={{
|
||||||
|
imageCount: imagesArray.length,
|
||||||
|
carouselId: id,
|
||||||
|
interval,
|
||||||
|
preloadCount
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
let currentIndex = 0;
|
window.__carousels = window.__carousels || {};
|
||||||
|
|
||||||
setInterval(() => {
|
// Reset the carousel and (re)start it. Runs on initial load and after
|
||||||
const current = document.querySelectorAll(
|
// every page transition, so navigation always restarts the fade sequence.
|
||||||
`[data-id="${carouselId}-${currentIndex}"]`
|
function initCarousel() {
|
||||||
)[0];
|
const state = (window.__carousels[carouselId] = window.__carousels[
|
||||||
const nextIndex = (currentIndex + 1) % imageCount;
|
carouselId
|
||||||
const next = document.querySelectorAll(
|
] || { index: 0, timer: null });
|
||||||
`[data-id="${carouselId}-${nextIndex}"]`
|
state.index = 0;
|
||||||
)[0];
|
if (state.timer) {
|
||||||
|
clearInterval(state.timer);
|
||||||
if (!current || !next) return;
|
state.timer = null;
|
||||||
|
|
||||||
// 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");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
currentIndex = nextIndex;
|
const slides = Array.from(
|
||||||
}, interval);
|
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>
|
</script>
|
||||||
@@ -64,7 +64,7 @@ const { navbarDisplay = "normal" } = Astro.props as Props;
|
|||||||
<div class="md:hidden">
|
<div class="md:hidden">
|
||||||
<button
|
<button
|
||||||
id="menu-toggle"
|
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-label="Toggle navigation menu"
|
||||||
aria-expanded="false"
|
aria-expanded="false"
|
||||||
aria-controls="mobile-menu"
|
aria-controls="mobile-menu"
|
||||||
@@ -139,6 +139,10 @@ const { navbarDisplay = "normal" } = Astro.props as Props;
|
|||||||
nav = document.getElementById("nav");
|
nav = document.getElementById("nav");
|
||||||
toggle = document.getElementById("menu-toggle");
|
toggle = document.getElementById("menu-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) {
|
if (toggle && !toggle.dataset.bound) {
|
||||||
toggle.dataset.bound = "true";
|
toggle.dataset.bound = "true";
|
||||||
toggle.addEventListener("click", () => {
|
toggle.addEventListener("click", () => {
|
||||||
|
|||||||
@@ -404,6 +404,13 @@ const playerArtworkOpacity = 0.4;
|
|||||||
|
|
||||||
this.RING_C = 182.2; // 2 * PI * 29, must match dasharray in markup
|
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 = {
|
this.UI = {
|
||||||
root: $("player-shell"),
|
root: $("player-shell"),
|
||||||
spacer: $("player:spacer"),
|
spacer: $("player:spacer"),
|
||||||
@@ -925,6 +932,7 @@ const playerArtworkOpacity = 0.4;
|
|||||||
}
|
}
|
||||||
|
|
||||||
addToQueue(track, immediatePlay = false) {
|
addToQueue(track, immediatePlay = false) {
|
||||||
|
if (!this.playlist.length) return;
|
||||||
var current = this.playlist[this.index];
|
var current = this.playlist[this.index];
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -946,13 +954,39 @@ const playerArtworkOpacity = 0.4;
|
|||||||
if (!window.playerIsInitialised) {
|
if (!window.playerIsInitialised) {
|
||||||
window.player = new Player(initialQueue);
|
window.player = new Player(initialQueue);
|
||||||
} else {
|
} 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 {
|
try {
|
||||||
const p = window.player;
|
const p = window.player;
|
||||||
p.UI.root = $("player-shell");
|
p.UI.root = $("player-shell");
|
||||||
p.UI.spacer = $("player:spacer");
|
p.UI.spacer = $("player:spacer");
|
||||||
p.UI.full = document.querySelector("#player-shell .player-full");
|
p.UI.full = document.querySelector("#player-shell .player-full");
|
||||||
p.UI.face = document.querySelector("#player-shell .player-face");
|
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();
|
p.applyminimised();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
/* ignore */
|
/* ignore */
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { title, description, url = Astro.url, image } = Astro.props;
|
const { title, description, url = Astro.url, image } = Astro.props;
|
||||||
|
const canonicalUrl = url.toString();
|
||||||
|
|
||||||
import person from "@data/person";
|
import person from "@data/person";
|
||||||
import site from "@data/site";
|
import site from "@data/site";
|
||||||
@@ -15,7 +16,7 @@ import { Schema } from "astro-seo-schema";
|
|||||||
---
|
---
|
||||||
|
|
||||||
<!-- SEO -->
|
<!-- SEO -->
|
||||||
<link rel="canonical" href={url} />
|
<link rel="canonical" href={canonicalUrl} />
|
||||||
<meta name="robots" content="index, follow" />
|
<meta name="robots" content="index, follow" />
|
||||||
<Schema
|
<Schema
|
||||||
item={{
|
item={{
|
||||||
@@ -65,7 +66,7 @@ import { Schema } from "astro-seo-schema";
|
|||||||
<meta property="og:site_name" content={site.title} />
|
<meta property="og:site_name" content={site.title} />
|
||||||
<meta property="og:title" content={title} />
|
<meta property="og:title" content={title} />
|
||||||
<meta property="og:description" content={description} />
|
<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:type" content="website" />
|
||||||
<meta
|
<meta
|
||||||
property="og:image"
|
property="og:image"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const linkIsExternal: boolean =
|
|||||||
{...attrs}
|
{...attrs}
|
||||||
><span class="group-hover:text-primary-600"><slot /></span>{
|
><span class="group-hover:text-primary-600"><slot /></span>{
|
||||||
includeExternalLinkIcon && linkIsExternal && (
|
includeExternalLinkIcon && linkIsExternal && (
|
||||||
<sup class="ml-0.5 inline-block">
|
<sup class="ml-0.5 inline-block" aria-hidden="true">
|
||||||
<Icon
|
<Icon
|
||||||
name="mdi:external-link"
|
name="mdi:external-link"
|
||||||
class:list={[
|
class:list={[
|
||||||
|
|||||||
+27
-12
@@ -1,4 +1,4 @@
|
|||||||
import { createTransport } from "nodemailer";
|
import { createTransport, type Transporter } from "nodemailer";
|
||||||
import SMTPTransport from "nodemailer/lib/smtp-transport";
|
import SMTPTransport from "nodemailer/lib/smtp-transport";
|
||||||
|
|
||||||
import type { Options } from "nodemailer/lib/mailer";
|
import type { Options } from "nodemailer/lib/mailer";
|
||||||
@@ -24,6 +24,27 @@ export function constructEmailHtml(props: Email) {
|
|||||||
return `<div>${escapeHtml(props.message)}</div>`;
|
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) {
|
export default async function sendContactEmail(props: Email) {
|
||||||
const port = parseInt(
|
const port = parseInt(
|
||||||
process.env.EMAIL_PORT || import.meta.env.EMAIL_PORT || "",
|
process.env.EMAIL_PORT || import.meta.env.EMAIL_PORT || "",
|
||||||
@@ -35,17 +56,11 @@ export default async function sendContactEmail(props: Email) {
|
|||||||
throw new Error("Email transport is not configured.");
|
throw new Error("Email transport is not configured.");
|
||||||
}
|
}
|
||||||
|
|
||||||
const transporter = createTransport({
|
const secure =
|
||||||
host: process.env.EMAIL_HOST || import.meta.env.EMAIL_HOST,
|
process.env.EMAIL_SECURE === "true" ||
|
||||||
port,
|
import.meta.env.EMAIL_SECURE === "true";
|
||||||
secure:
|
|
||||||
process.env.EMAIL_SECURE === "true" ||
|
const transporter = getTransporter(port, secure);
|
||||||
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);
|
|
||||||
|
|
||||||
if (!props.html) {
|
if (!props.html) {
|
||||||
props.html = constructEmailHtml(props);
|
props.html = constructEmailHtml(props);
|
||||||
|
|||||||
@@ -20,10 +20,19 @@ function isRateLimited(ip: string): boolean {
|
|||||||
(t) => now - t < RATE_WINDOW_MS
|
(t) => now - t < RATE_WINDOW_MS
|
||||||
);
|
);
|
||||||
if (history.length >= RATE_MAX) {
|
if (history.length >= RATE_MAX) {
|
||||||
|
recentSends.set(ip, history);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
history.push(now);
|
history.push(now);
|
||||||
recentSends.set(ip, history);
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,10 +45,8 @@ function json(message: string, status: number, statusText: string): Response {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const POST: APIRoute = async ({ request, clientAddress }) => {
|
export const POST: APIRoute = async ({ request, clientAddress }) => {
|
||||||
const ip =
|
// Prefer the socket address: x-forwarded-for is client-controlled.
|
||||||
request.headers.get("x-forwarded-for")?.split(",")[0]?.trim() ||
|
const ip = clientAddress || "unknown";
|
||||||
clientAddress ||
|
|
||||||
"unknown";
|
|
||||||
if (isRateLimited(ip)) {
|
if (isRateLimited(ip)) {
|
||||||
return json(
|
return json(
|
||||||
"Too many messages sent. Please try again later.",
|
"Too many messages sent. Please try again later.",
|
||||||
@@ -48,7 +55,13 @@ export const POST: APIRoute = async ({ request, clientAddress }) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await request.formData();
|
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 email = (data.get("email") as string | null)?.trim() ?? "";
|
||||||
const subject = (data.get("subject") as string | null)?.trim() ?? "";
|
const subject = (data.get("subject") as string | null)?.trim() ?? "";
|
||||||
const message = (data.get("message") as string | null)?.trim() ?? "";
|
const message = (data.get("message") as string | null)?.trim() ?? "";
|
||||||
@@ -86,6 +99,7 @@ export const POST: APIRoute = async ({ request, clientAddress }) => {
|
|||||||
html
|
html
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.error("Contact email failed to send:", error);
|
||||||
return json(
|
return json(
|
||||||
`Message failed to send with an internal server error. Please contact me directly via a method below.`,
|
`Message failed to send with an internal server error. Please contact me directly via a method below.`,
|
||||||
500,
|
500,
|
||||||
|
|||||||
@@ -25,13 +25,17 @@ import { Icon } from "astro-icon/components";
|
|||||||
<SectionTitle>Other ways to reach me</SectionTitle>
|
<SectionTitle>Other ways to reach me</SectionTitle>
|
||||||
<div class="grid grid-cols-1 text-lg md:grid-cols-2">
|
<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">
|
<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"
|
<TextLink href="mailto:nathan@nathancummins.com.au" class="mt-4"
|
||||||
>nathan@nathancummins.com.au</TextLink
|
>nathan@nathancummins.com.au</TextLink
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-1 flex flex-col items-center justify-center p-4">
|
<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"
|
<Paragraph class="my-0 mt-4"
|
||||||
>PO Box 2112 Regency Park SA 5942</Paragraph
|
>PO Box 2112 Regency Park SA 5942</Paragraph
|
||||||
>
|
>
|
||||||
|
|||||||
+12
-10
@@ -17,28 +17,28 @@ import { Image } from "astro:assets";
|
|||||||
|
|
||||||
import { Icon } from "astro-icon/components";
|
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 }>(
|
const heroImages = import.meta.glob<{ default: ImageMetadata; eager: true }>(
|
||||||
"../assets/img/hero/*"
|
"../assets/img/hero/*"
|
||||||
);
|
);
|
||||||
const heroImagesArray = await convertEagerImagesImportGlobToArray(heroImages);
|
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 = (
|
const projects = (
|
||||||
await getCollection("projects", ({ data }) => data.frontPage)
|
await getCollection("projects", ({ data }) => data.frontPage)
|
||||||
).sort(
|
).sort(
|
||||||
(a, b) => (a.data.frontPage?.order || 0) - (b.data.frontPage?.order || 1)
|
(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(
|
const awards = (await getCollection("awards")).sort(
|
||||||
(a, b) => b.data.date.valueOf() - a.data.date.valueOf()
|
(a, b) => b.data.date.valueOf() - a.data.date.valueOf()
|
||||||
);
|
);
|
||||||
@@ -120,6 +120,7 @@ const tracks = (
|
|||||||
quality={5}
|
quality={5}
|
||||||
height={192}
|
height={192}
|
||||||
shuffle={true}
|
shuffle={true}
|
||||||
|
eagerCount={4}
|
||||||
><div class="flex h-full w-full items-center">
|
><div class="flex h-full w-full items-center">
|
||||||
<a
|
<a
|
||||||
href="/contact/"
|
href="/contact/"
|
||||||
@@ -207,6 +208,7 @@ const tracks = (
|
|||||||
quality={5}
|
quality={5}
|
||||||
height={384}
|
height={384}
|
||||||
shuffle={true}
|
shuffle={true}
|
||||||
|
eagerCount={4}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Reference in new issue
Block a user