feat: refresh uses, testimonials, and theme
Uses page: - Merge "For work"/"For fun" into one Hardware list; drop the MS-01. - Gaming rig becomes the Arch "Daily driver" (9950X, Looking Glass VM); custom workstation is now the Proxmox box (5900X, 128GB, RTX 3090). - Swap MetaMCP -> ContextForge and Open WebUI -> Paseo; add Codex, OpenCode, and OpenRouter. Testimonials: - Add Douglas Wilhelm; trim all quotes to ~55-60 words of verbatim sentences so cards stay the same size. - Move above projects and restyle as a card with gold-bordered initials, inline gold quote marks, and a countdown line under the divider. - Fix carousel bugs: hooks after an early return, timer not resetting on manual navigation, layout shift between quotes of different lengths. The countdown animation now drives rotation, and hover/keyboard focus pause it. Theme: - Centralize colors and fonts as CSS variables in globals.css; the neutral-* scale reads from them, and the header's hardcoded bg is gone. - New defaults: Manrope (body), EB Garamond (display), zinc greys, gold. - Add a dev-only theme switcher for A/B-ing fonts and palettes; it is compiled out of production builds. - Remove dead runtime-built hover classes on the about page that never generated CSS. Copy: replace em dashes with plain hyphens site-wide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6b6790813b
commit
abd5fd4a58
24 files changed
+765
-313
No files matched your search
@@ -18,7 +18,7 @@ export default function ProjectCard({ slug, title, year, stack, description, liv
|
||||
<h1 className="text-[24px] font-semibold">{title}</h1>
|
||||
<IconArrowNarrowRight className='group-hover:scale-150 transition-transform'/>
|
||||
</Link>
|
||||
<p className="text-md text-neutral-400 text-muted">{year} — {stack.join(' · ')}</p>
|
||||
<p className="text-md text-neutral-400 text-muted">{year} - {stack.join(' · ')}</p>
|
||||
<p className="text-xl">{description}</p>
|
||||
<a
|
||||
href={liveUrl}
|
||||
|
||||
@@ -27,7 +27,7 @@ export default function RotatingHeadline({
|
||||
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
{/* rotating row — key forces remount so a CSS transition can fire */}
|
||||
{/* rotating row - key forces remount so a CSS transition can fire */}
|
||||
<div className="text-2xl">
|
||||
<span key={activeIndex}>{items[activeIndex]}</span>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { useState } from "react";
|
||||
import Image from "next/image";
|
||||
import { IconPlayerPauseFilled, IconPlayerPlayFilled, IconPoint, IconPointFilled } from '@tabler/icons-react';
|
||||
import type { Testimonial } from "@/shared/types";
|
||||
import { colors } from "@/constants/colors";
|
||||
|
||||
const ROTATE_MS = 10000;
|
||||
|
||||
function getInitials(name: string) {
|
||||
return name
|
||||
@@ -12,13 +16,6 @@ function getInitials(name: string) {
|
||||
.join("");
|
||||
}
|
||||
|
||||
type Testimonial = {
|
||||
name: string;
|
||||
title: string;
|
||||
avatar?: string;
|
||||
quote: string;
|
||||
};
|
||||
|
||||
type TestimonialsProps = {
|
||||
items: Testimonial[];
|
||||
};
|
||||
@@ -26,68 +23,134 @@ type TestimonialsProps = {
|
||||
export default function Testimonials({ items }: TestimonialsProps) {
|
||||
const [activeIndex, setActiveIndex] = useState(0);
|
||||
const [isPlaying, setIsPlaying] = useState(true);
|
||||
const active = items[activeIndex];
|
||||
// Hovering or focusing the card pauses rotation so nobody loses their place mid-read.
|
||||
const [isHovered, setIsHovered] = useState(false);
|
||||
const [isFocused, setIsFocused] = useState(false);
|
||||
|
||||
if (!active) return null;
|
||||
const shouldRotate = items.length > 1 && isPlaying && !isHovered && !isFocused;
|
||||
|
||||
useEffect(() => {
|
||||
if (items.length <= 1 || !isPlaying) return;
|
||||
if (items.length === 0) return null;
|
||||
|
||||
const id = setInterval(() => {
|
||||
setActiveIndex((i) => (i + 1) % items.length);
|
||||
}, 5000);
|
||||
|
||||
return () => clearInterval(id);
|
||||
}, [items.length, isPlaying]);
|
||||
|
||||
// TODO: fix bug - when clicking a pagination button, the auto-rotation timer doesn't reset, causing it to immediately rotate to the next testimonial after 5 seconds instead of 10
|
||||
// Clamp in case items shrinks underneath us.
|
||||
const current = Math.min(activeIndex, items.length - 1);
|
||||
|
||||
return (
|
||||
<section className="w-full">
|
||||
{/* header: avatar + name + title */}
|
||||
<header className="flex items-center gap-3 mb-2">
|
||||
{active.avatar ? (
|
||||
<Image
|
||||
src={active.avatar}
|
||||
alt={active.name}
|
||||
width={64}
|
||||
height={64}
|
||||
className="rounded-full object-cover size-10"
|
||||
/>
|
||||
) : (
|
||||
<div
|
||||
aria-hidden
|
||||
className="size-10 rounded-full bg-neutral-800 flex items-center justify-center text-xs font-medium text-neutral-400"
|
||||
>
|
||||
{getInitials(active.name)}
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<div className="text-sm font-semibold">{active.name}</div>
|
||||
<div className="text-xs text-neutral-500">{active.title}</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<blockquote className="p-3">"{active.quote}"</blockquote>
|
||||
|
||||
<footer className="flex items-center justify-between">
|
||||
<div className="flex mt-3">
|
||||
{items.map((_, i) => (
|
||||
<button
|
||||
key={i}
|
||||
onClick={() => setActiveIndex(i)}
|
||||
aria-label={`Go to testimonial ${i + 1}`}
|
||||
<section
|
||||
className="w-full"
|
||||
aria-roledescription="carousel"
|
||||
aria-label="Testimonials"
|
||||
onMouseEnter={() => setIsHovered(true)}
|
||||
onMouseLeave={() => setIsHovered(false)}
|
||||
// Only keyboard focus pauses. A mouse click also focuses the dot, and that
|
||||
// focus would otherwise keep rotation paused after the pointer leaves.
|
||||
onFocus={(e) => setIsFocused(e.target.matches(":focus-visible"))}
|
||||
onBlur={(e) => {
|
||||
if (!e.currentTarget.contains(e.relatedTarget)) setIsFocused(false);
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="relative overflow-hidden rounded-2xl border border-neutral-800 bg-elevated/40 px-6 pb-5 pt-6 sm:px-8">
|
||||
{/* Every slide sits in the same grid cell, so the card is always as tall
|
||||
as the longest testimonial and nothing below it jumps on rotation. */}
|
||||
<div className="grid">
|
||||
{items.map((item, i) => (
|
||||
<figure
|
||||
key={item.name}
|
||||
aria-hidden={i !== current}
|
||||
className={`col-start-1 row-start-1 flex flex-col justify-between gap-6 transition-opacity duration-300 ${
|
||||
i === current ? "opacity-100" : "invisible opacity-0"
|
||||
}`}
|
||||
>
|
||||
{i === activeIndex ? <IconPointFilled /> : <IconPoint />}
|
||||
</button>
|
||||
<blockquote className="text-[19px] leading-[1.65] text-neutral-200">
|
||||
<span
|
||||
className="mr-0.5 font-serif text-[26px] leading-none"
|
||||
style={{ color: colors.accent }}
|
||||
>
|
||||
“
|
||||
</span>
|
||||
{item.quote}
|
||||
<span
|
||||
className="ml-0.5 font-serif text-[26px] leading-none"
|
||||
style={{ color: colors.accent }}
|
||||
>
|
||||
”
|
||||
</span>
|
||||
</blockquote>
|
||||
|
||||
<figcaption className="flex items-center gap-3">
|
||||
{item.avatar ? (
|
||||
<Image
|
||||
src={item.avatar}
|
||||
alt=""
|
||||
width={80}
|
||||
height={80}
|
||||
className="size-10 shrink-0 rounded-full border object-cover"
|
||||
style={{ borderColor: colors.accent }}
|
||||
/>
|
||||
) : (
|
||||
<div
|
||||
aria-hidden
|
||||
className="flex size-10 shrink-0 items-center justify-center rounded-full border bg-neutral-900 text-[12px] font-medium tracking-wide text-neutral-400"
|
||||
style={{ borderColor: colors.accent }}
|
||||
>
|
||||
{getInitials(item.name)}
|
||||
</div>
|
||||
)}
|
||||
<div className="space-y-0.5">
|
||||
<div className="text-base font-semibold text-neutral-100">{item.name}</div>
|
||||
<div className="text-sm text-neutral-400">{item.title}</div>
|
||||
</div>
|
||||
</figcaption>
|
||||
</figure>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* TODO: play/pause button + auto-rotate timer */}
|
||||
<button onClick={() => setIsPlaying(!isPlaying)} aria-label={isPlaying ? "Pause" : "Play"}>
|
||||
{isPlaying ? <IconPlayerPauseFilled size={20} /> : <IconPlayerPlayFilled size={20} />}
|
||||
</button>
|
||||
</footer>
|
||||
{items.length > 1 && (
|
||||
<footer className="relative mt-5 flex items-center justify-between border-t border-neutral-800 pt-3">
|
||||
{/* Countdown line, and also the rotation timer: when the shrink animation
|
||||
ends, the next testimonial shows. Re-keying on the slide restarts it
|
||||
from full, and pausing freezes it in place, so the line always
|
||||
matches the time actually left. */}
|
||||
<div
|
||||
key={current}
|
||||
aria-hidden
|
||||
className="animate-testimonial-countdown absolute inset-x-0 top-0 h-px origin-left"
|
||||
style={
|
||||
{
|
||||
"--countdown-ms": `${ROTATE_MS}ms`,
|
||||
backgroundColor: colors.accent,
|
||||
animationPlayState: shouldRotate ? "running" : "paused",
|
||||
} as React.CSSProperties
|
||||
}
|
||||
onAnimationEnd={() => setActiveIndex((i) => (i + 1) % items.length)}
|
||||
/>
|
||||
|
||||
<div className="flex">
|
||||
{items.map((item, i) => (
|
||||
<button
|
||||
key={item.name}
|
||||
type="button"
|
||||
onClick={() => setActiveIndex(i)}
|
||||
aria-label={`Show testimonial from ${item.name}`}
|
||||
aria-current={i === current}
|
||||
className={i === current ? "text-accent" : "text-neutral-600 transition-colors hover:text-neutral-400"}
|
||||
>
|
||||
{i === current ? <IconPointFilled /> : <IconPoint />}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setIsPlaying((p) => !p)}
|
||||
aria-label={isPlaying ? "Pause rotation" : "Resume rotation"}
|
||||
className="text-neutral-500 transition-colors hover:text-neutral-300"
|
||||
>
|
||||
{isPlaying ? <IconPlayerPauseFilled size={18} /> : <IconPlayerPlayFilled size={18} />}
|
||||
</button>
|
||||
</footer>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
"use client";
|
||||
|
||||
// Dev-only theme switcher for A/B-ing fonts and palettes on the real pages.
|
||||
// It overrides the CSS variables from app/globals.css on <html>; once a combo is
|
||||
// picked, bake it into globals.css (and layout.tsx for fonts) and it ships.
|
||||
// Rendered only in development, see app/layout.tsx.
|
||||
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import type { FontOption } from "./themeFonts";
|
||||
|
||||
type Config = { sans: string; serif: string; tone: string; accent: string };
|
||||
type Slot = "A" | "B";
|
||||
type Stored = { current: Config; A?: Config; B?: Config };
|
||||
|
||||
const STORAGE_KEY = "dev-theme-switcher-v2";
|
||||
const DEFAULT: Config = { sans: "manrope", serif: "garamond", tone: "zinc", accent: "gold" };
|
||||
|
||||
// Tailwind v4 grey scales, copied from node_modules/tailwindcss/theme.css.
|
||||
const TONES: Record<string, { label: string; scale: Record<string, string> }> = {
|
||||
neutral: {
|
||||
label: "Neutral (previous)",
|
||||
scale: { "50": "oklch(98.5% 0 0)", "100": "oklch(97% 0 0)", "200": "oklch(92.2% 0 0)", "300": "oklch(87% 0 0)", "400": "oklch(70.8% 0 0)", "500": "oklch(55.6% 0 0)", "600": "oklch(43.9% 0 0)", "700": "oklch(37.1% 0 0)", "800": "oklch(26.9% 0 0)", "900": "oklch(20.5% 0 0)", "950": "oklch(14.5% 0 0)" },
|
||||
},
|
||||
stone: {
|
||||
label: "Stone (warm)",
|
||||
scale: { "50": "oklch(98.5% 0.001 106.423)", "100": "oklch(97% 0.001 106.424)", "200": "oklch(92.3% 0.003 48.717)", "300": "oklch(86.9% 0.005 56.366)", "400": "oklch(70.9% 0.01 56.259)", "500": "oklch(55.3% 0.013 58.071)", "600": "oklch(44.4% 0.011 73.639)", "700": "oklch(37.4% 0.01 67.558)", "800": "oklch(26.8% 0.007 34.298)", "900": "oklch(21.6% 0.006 56.043)", "950": "oklch(14.7% 0.004 49.25)" },
|
||||
},
|
||||
zinc: {
|
||||
label: "Zinc (current)",
|
||||
scale: { "50": "oklch(98.5% 0 0)", "100": "oklch(96.7% 0.001 286.375)", "200": "oklch(92% 0.004 286.32)", "300": "oklch(87.1% 0.006 286.286)", "400": "oklch(70.5% 0.015 286.067)", "500": "oklch(55.2% 0.016 285.938)", "600": "oklch(44.2% 0.017 285.786)", "700": "oklch(37% 0.013 285.805)", "800": "oklch(27.4% 0.006 286.033)", "900": "oklch(21% 0.006 285.885)", "950": "oklch(14.1% 0.005 285.823)" },
|
||||
},
|
||||
gray: {
|
||||
label: "Gray (blue hint)",
|
||||
scale: { "50": "oklch(98.5% 0.002 247.839)", "100": "oklch(96.7% 0.003 264.542)", "200": "oklch(92.8% 0.006 264.531)", "300": "oklch(87.2% 0.01 258.338)", "400": "oklch(70.7% 0.022 261.325)", "500": "oklch(55.1% 0.027 264.364)", "600": "oklch(44.6% 0.03 256.802)", "700": "oklch(37.3% 0.034 259.733)", "800": "oklch(27.8% 0.033 256.848)", "900": "oklch(21% 0.034 264.665)", "950": "oklch(13% 0.028 261.692)" },
|
||||
},
|
||||
slate: {
|
||||
label: "Slate (blue)",
|
||||
scale: { "50": "oklch(98.4% 0.003 247.858)", "100": "oklch(96.8% 0.007 247.896)", "200": "oklch(92.9% 0.013 255.508)", "300": "oklch(86.9% 0.022 252.894)", "400": "oklch(70.4% 0.04 256.788)", "500": "oklch(55.4% 0.046 257.417)", "600": "oklch(44.6% 0.043 257.281)", "700": "oklch(37.2% 0.044 257.287)", "800": "oklch(27.9% 0.041 260.031)", "900": "oklch(20.8% 0.042 265.755)", "950": "oklch(12.9% 0.042 264.695)" },
|
||||
},
|
||||
};
|
||||
|
||||
const ACCENTS: Record<string, { label: string; value: string; hover?: string }> = {
|
||||
gold: { label: "Gold (current)", value: "#d4a24a", hover: "#e6b966" },
|
||||
ember: { label: "Ember", value: "#e07b3c" },
|
||||
coral: { label: "Coral", value: "#ef7a6a" },
|
||||
rose: { label: "Rose", value: "#e8829f" },
|
||||
sage: { label: "Sage", value: "#94b88a" },
|
||||
teal: { label: "Teal", value: "#3cbfae" },
|
||||
iris: { label: "Iris", value: "#8f8cf5" },
|
||||
sky: { label: "Sky", value: "#5ba8f0" },
|
||||
};
|
||||
|
||||
function readStored(): Stored | null {
|
||||
try {
|
||||
const raw = localStorage.getItem(STORAGE_KEY);
|
||||
return raw ? (JSON.parse(raw) as Stored) : null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function writeStored(value: Stored) {
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(value));
|
||||
} catch {
|
||||
// storage unavailable, the switcher still works for this page view
|
||||
}
|
||||
}
|
||||
|
||||
function applyConfig(cfg: Config, sans: FontOption[], serif: FontOption[]) {
|
||||
const root = document.documentElement.style;
|
||||
const sansOpt = sans.find((o) => o.id === cfg.sans) ?? sans[0];
|
||||
const serifOpt = serif.find((o) => o.id === cfg.serif) ?? serif[0];
|
||||
root.setProperty("--site-sans", `var(${sansOpt.variable})`);
|
||||
root.setProperty("--site-serif", `var(${serifOpt.variable})`);
|
||||
|
||||
const tone = TONES[cfg.tone] ?? TONES.neutral;
|
||||
for (const [step, value] of Object.entries(tone.scale)) root.setProperty(`--n-${step}`, value);
|
||||
if (cfg.tone === "neutral") {
|
||||
// The original site values, so "Neutral" matches the old look exactly.
|
||||
root.setProperty("--background", "#0a0a0a");
|
||||
root.setProperty("--foreground", "#ededed");
|
||||
root.setProperty("--bg-elevated", "#1c1c1c");
|
||||
} else {
|
||||
root.setProperty("--background", "var(--n-950)");
|
||||
root.setProperty("--foreground", "color-mix(in oklab, var(--n-100), var(--n-200) 60%)");
|
||||
root.setProperty("--bg-elevated", "color-mix(in oklab, var(--n-900), var(--n-800) 30%)");
|
||||
}
|
||||
|
||||
const accent = ACCENTS[cfg.accent] ?? ACCENTS.gold;
|
||||
root.setProperty("--accent", accent.value);
|
||||
root.setProperty("--accent-hover", accent.hover ?? `color-mix(in oklab, ${accent.value} 75%, white)`);
|
||||
}
|
||||
|
||||
function describe(cfg: Config, sans: FontOption[], serif: FontOption[]) {
|
||||
const strip = (s: string) => s.replace(/ \(.*\)$/, "");
|
||||
return [
|
||||
strip(sans.find((o) => o.id === cfg.sans)?.label ?? cfg.sans),
|
||||
strip(serif.find((o) => o.id === cfg.serif)?.label ?? cfg.serif),
|
||||
strip(TONES[cfg.tone]?.label ?? cfg.tone),
|
||||
strip(ACCENTS[cfg.accent]?.label ?? cfg.accent),
|
||||
].join(" · ");
|
||||
}
|
||||
|
||||
// navigator.clipboard only exists on secure origins (https or localhost). The dev
|
||||
// server is usually opened by LAN IP over plain http, so fall back to the old
|
||||
// hidden-textarea + execCommand trick, which still works there.
|
||||
async function copyText(text: string): Promise<boolean> {
|
||||
try {
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
await navigator.clipboard.writeText(text);
|
||||
return true;
|
||||
}
|
||||
} catch {
|
||||
// fall through to the legacy path
|
||||
}
|
||||
const area = document.createElement("textarea");
|
||||
area.value = text;
|
||||
area.setAttribute("readonly", "");
|
||||
area.style.position = "fixed";
|
||||
area.style.opacity = "0";
|
||||
document.body.appendChild(area);
|
||||
area.select();
|
||||
let ok = false;
|
||||
try {
|
||||
ok = document.execCommand("copy");
|
||||
} catch {
|
||||
ok = false;
|
||||
}
|
||||
area.remove();
|
||||
return ok;
|
||||
}
|
||||
|
||||
const panel: React.CSSProperties = {
|
||||
fontFamily: "ui-sans-serif, system-ui, sans-serif",
|
||||
background: "#111",
|
||||
color: "#ddd",
|
||||
border: "1px solid #333",
|
||||
};
|
||||
const field: React.CSSProperties = { background: "#1b1b1b", color: "#eee", border: "1px solid #333" };
|
||||
|
||||
export default function ThemeSwitcher({
|
||||
sansOptions,
|
||||
serifOptions,
|
||||
}: {
|
||||
sansOptions: FontOption[];
|
||||
serifOptions: FontOption[];
|
||||
}) {
|
||||
const [open, setOpen] = useState(true);
|
||||
const [stored, setStored] = useState<Stored>({ current: DEFAULT });
|
||||
const [activeSlot, setActiveSlot] = useState<Slot | null>(null);
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
// Restore after mount (localStorage isn't available during SSR).
|
||||
useEffect(() => {
|
||||
const saved = readStored();
|
||||
if (saved) setStored({ ...saved, current: { ...DEFAULT, ...saved.current } });
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
applyConfig(stored.current, sansOptions, serifOptions);
|
||||
writeStored(stored);
|
||||
}, [stored, sansOptions, serifOptions]);
|
||||
|
||||
const update = (patch: Partial<Config>) => {
|
||||
setActiveSlot(null);
|
||||
setStored((s) => ({ ...s, current: { ...s.current, ...patch } }));
|
||||
};
|
||||
|
||||
const save = (slot: Slot) => {
|
||||
setStored((s) => ({ ...s, [slot]: s.current }));
|
||||
setActiveSlot(slot);
|
||||
};
|
||||
|
||||
const show = useCallback((slot: Slot) => {
|
||||
setStored((s) => (s[slot] ? { ...s, current: s[slot]! } : s));
|
||||
setActiveSlot(slot);
|
||||
}, []);
|
||||
|
||||
// Backtick flips between A and B, unless typing in a field.
|
||||
useEffect(() => {
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (e.key !== "`") return;
|
||||
const tag = (e.target as HTMLElement | null)?.tagName;
|
||||
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") return;
|
||||
if (!stored.A || !stored.B) return;
|
||||
e.preventDefault();
|
||||
show(activeSlot === "A" ? "B" : "A");
|
||||
};
|
||||
window.addEventListener("keydown", onKey);
|
||||
return () => window.removeEventListener("keydown", onKey);
|
||||
}, [stored.A, stored.B, activeSlot, show]);
|
||||
|
||||
const summary = describe(stored.current, sansOptions, serifOptions);
|
||||
|
||||
if (!open) {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setOpen(true)}
|
||||
className="fixed bottom-4 right-4 z-[90] rounded-full px-3 py-1.5 text-[12px] shadow-lg"
|
||||
style={panel}
|
||||
>
|
||||
Theme{activeSlot ? ` · ${activeSlot}` : ""}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
const select = (label: string, value: string, options: { id: string; label: string }[], key: keyof Config) => (
|
||||
<label className="flex items-center justify-between gap-3">
|
||||
<span style={{ color: "#888" }}>{label}</span>
|
||||
<select
|
||||
value={value}
|
||||
onChange={(e) => update({ [key]: e.target.value })}
|
||||
className="w-40 rounded-md px-1.5 py-1"
|
||||
style={field}
|
||||
>
|
||||
{options.map((o) => (
|
||||
<option key={o.id} value={o.id}>
|
||||
{o.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
);
|
||||
|
||||
const slotButton = (slot: Slot) => {
|
||||
const has = Boolean(stored[slot]);
|
||||
const active = activeSlot === slot;
|
||||
return (
|
||||
<div key={slot} className="flex flex-1 flex-col gap-1">
|
||||
<button
|
||||
type="button"
|
||||
disabled={!has}
|
||||
onClick={() => show(slot)}
|
||||
className="rounded-md py-1 font-semibold disabled:opacity-40"
|
||||
style={{ ...field, ...(active ? { background: "#eee", color: "#111" } : null) }}
|
||||
title={has ? describe(stored[slot]!, sansOptions, serifOptions) : "Nothing saved yet"}
|
||||
>
|
||||
Show {slot}
|
||||
</button>
|
||||
<button type="button" onClick={() => save(slot)} className="rounded-md py-1" style={field}>
|
||||
Save as {slot}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="fixed bottom-4 right-4 z-[90] w-72 space-y-2.5 rounded-xl p-3 text-[12px] shadow-2xl" style={panel}>
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="font-semibold">Theme (dev only)</span>
|
||||
<button type="button" onClick={() => setOpen(false)} style={{ color: "#888" }} aria-label="Collapse">
|
||||
Hide
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{select("Body font", stored.current.sans, sansOptions, "sans")}
|
||||
{select("Display font", stored.current.serif, serifOptions, "serif")}
|
||||
{select("Greys", stored.current.tone, Object.entries(TONES).map(([id, t]) => ({ id, label: t.label })), "tone")}
|
||||
{select("Accent", stored.current.accent, Object.entries(ACCENTS).map(([id, a]) => ({ id, label: a.label })), "accent")}
|
||||
|
||||
<div className="flex gap-2">{slotButton("A")}{slotButton("B")}</div>
|
||||
<p style={{ color: "#777" }}>Save two combos, then press ` to flip between them.</p>
|
||||
|
||||
<div className="flex items-center gap-2 border-t pt-2" style={{ borderColor: "#2a2a2a" }}>
|
||||
<span className="flex-1 leading-snug">{summary}</span>
|
||||
<button
|
||||
type="button"
|
||||
onClick={async () => {
|
||||
if (await copyText(summary)) {
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 1200);
|
||||
}
|
||||
}}
|
||||
className="rounded-md px-2 py-1"
|
||||
style={field}
|
||||
>
|
||||
{copied ? "Copied" : "Copy"}
|
||||
</button>
|
||||
<button type="button" onClick={() => update(DEFAULT)} className="rounded-md px-2 py-1" style={field}>
|
||||
Reset
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// Dev-only: alternative fonts for the theme switcher. Imported by app/layout.tsx
|
||||
// behind a NODE_ENV check, so none of these ship to production. The current
|
||||
// fonts (Manrope, EB Garamond) are loaded by the layout itself.
|
||||
import {
|
||||
DM_Sans,
|
||||
Fraunces,
|
||||
Geist,
|
||||
IBM_Plex_Sans,
|
||||
Instrument_Serif,
|
||||
Inter,
|
||||
Newsreader,
|
||||
Playfair_Display,
|
||||
} from "next/font/google";
|
||||
|
||||
const geist = Geist({ variable: "--font-opt-geist", subsets: ["latin"], preload: false });
|
||||
const plexSans = IBM_Plex_Sans({
|
||||
variable: "--font-opt-plex-sans",
|
||||
subsets: ["latin"],
|
||||
weight: ["400", "500", "600", "700"],
|
||||
preload: false,
|
||||
});
|
||||
const inter = Inter({ variable: "--font-opt-inter", subsets: ["latin"], preload: false });
|
||||
const dmSans = DM_Sans({ variable: "--font-opt-dm-sans", subsets: ["latin"], preload: false });
|
||||
|
||||
const newsreader = Newsreader({
|
||||
variable: "--font-opt-newsreader",
|
||||
subsets: ["latin"],
|
||||
style: ["normal", "italic"],
|
||||
preload: false,
|
||||
});
|
||||
const fraunces = Fraunces({
|
||||
variable: "--font-opt-fraunces",
|
||||
subsets: ["latin"],
|
||||
style: ["normal", "italic"],
|
||||
preload: false,
|
||||
});
|
||||
const playfair = Playfair_Display({
|
||||
variable: "--font-opt-playfair",
|
||||
subsets: ["latin"],
|
||||
style: ["normal", "italic"],
|
||||
preload: false,
|
||||
});
|
||||
const instrument = Instrument_Serif({
|
||||
variable: "--font-opt-instrument",
|
||||
subsets: ["latin"],
|
||||
weight: "400",
|
||||
style: ["normal", "italic"],
|
||||
preload: false,
|
||||
});
|
||||
|
||||
/** Class names that define every alternative font's CSS variable; goes on <html>. */
|
||||
export const fontVariables = [geist, plexSans, inter, dmSans, newsreader, fraunces, playfair, instrument]
|
||||
.map((f) => f.variable)
|
||||
.join(" ");
|
||||
|
||||
export type FontOption = { id: string; label: string; variable: string };
|
||||
|
||||
export const sansOptions: FontOption[] = [
|
||||
{ id: "manrope", label: "Manrope (current)", variable: "--font-manrope" },
|
||||
{ id: "inter", label: "Inter (previous)", variable: "--font-opt-inter" },
|
||||
{ id: "geist", label: "Geist", variable: "--font-opt-geist" },
|
||||
{ id: "plex-sans", label: "IBM Plex Sans", variable: "--font-opt-plex-sans" },
|
||||
{ id: "dm-sans", label: "DM Sans", variable: "--font-opt-dm-sans" },
|
||||
];
|
||||
|
||||
export const serifOptions: FontOption[] = [
|
||||
{ id: "garamond", label: "EB Garamond (current)", variable: "--font-garamond" },
|
||||
{ id: "instrument", label: "Instrument Serif (previous)", variable: "--font-opt-instrument" },
|
||||
{ id: "newsreader", label: "Newsreader", variable: "--font-opt-newsreader" },
|
||||
{ id: "fraunces", label: "Fraunces", variable: "--font-opt-fraunces" },
|
||||
{ id: "playfair", label: "Playfair Display", variable: "--font-opt-playfair" },
|
||||
];
|
||||
@@ -3,7 +3,7 @@ import Nav from "./Nav";
|
||||
|
||||
export default function Header() {
|
||||
return (
|
||||
<header className="mx-auto w-full max-w-4xl px-6 py-5 flex items-center justify-between sticky top-0 z-50 bg-[#0a0a0a]/70 backdrop-blur-lg">
|
||||
<header className="mx-auto w-full max-w-4xl px-6 py-5 flex items-center justify-between sticky top-0 z-50 bg-background/70 backdrop-blur-lg">
|
||||
<Link
|
||||
href="/"
|
||||
className="text-sm font-semibold text-neutral-100 hover:text-white"
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { IconPointFilled } from '@tabler/icons-react';
|
||||
import { colors } from '@/constants';
|
||||
|
||||
export default function SectionLabel({ label }: { label: string }) {
|
||||
return (
|
||||
<div>
|
||||
<h2 className="text-sm font-semibold uppercase tracking-wide text-neutral-400 flex gap-1 items-center">
|
||||
<IconPointFilled color={colors.accent}/>
|
||||
<IconPointFilled className="text-accent" />
|
||||
{label}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@ export default function AccentLink({ link, label, download }: { link: string, la
|
||||
return (
|
||||
<a href={link} download={download} className='flex gap-1 items-center hover:translate-x-2 hover:scale-110 transition-transform duration-200 w-fit'>
|
||||
<p style={{ color: colors.accent }}>{label}</p>
|
||||
<IconArrowNarrowRight color={colors.accent} />
|
||||
<IconArrowNarrowRight className="text-accent" />
|
||||
</a>
|
||||
);
|
||||
}
|
||||
@@ -26,7 +26,7 @@ export default function CopyButton({
|
||||
setCopied(true);
|
||||
window.setTimeout(() => setCopied(false), 1500);
|
||||
} catch {
|
||||
// clipboard unavailable — silently ignore
|
||||
// clipboard unavailable - silently ignore
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ export default function Cursor() {
|
||||
const dotRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
// Skip on touchscreens — pointer:fine === false there
|
||||
// Skip on touchscreens - pointer:fine === false there
|
||||
if (!window.matchMedia("(pointer: fine)").matches) return;
|
||||
|
||||
const el = dotRef.current;
|
||||
|
||||
@@ -13,18 +13,18 @@ type ImageViewerProps = {
|
||||
onClose: () => void;
|
||||
};
|
||||
|
||||
/** Caption to display — falls back to the required `alt` text. */
|
||||
/** Caption to display - falls back to the required `alt` text. */
|
||||
const captionOf = (s: Screenshot) => s.caption ?? s.alt;
|
||||
|
||||
/**
|
||||
* Full-bleed fullscreen image viewer with pan / pinch / wheel zoom, keyboard
|
||||
* navigation, and a thumbnail rail (vertical on desktop, horizontal at the
|
||||
* bottom on mobile). Borrowed from imagelab-gpu's FullscreenImage, trimmed to
|
||||
* the parts this portfolio needs — no slideshow.
|
||||
* the parts this portfolio needs - no slideshow.
|
||||
*/
|
||||
export default function ImageViewer({ items, index, onIndexChange, onClose }: ImageViewerProps) {
|
||||
// Natural size is tagged with the index it was measured for, so it reads as
|
||||
// null until the *current* image's onLoad fires — no reset effect needed.
|
||||
// null until the *current* image's onLoad fires - no reset effect needed.
|
||||
const [sized, setSized] = useState<{ i: number; w: number; h: number } | null>(null);
|
||||
const stageRef = useRef<HTMLDivElement>(null);
|
||||
const activeThumbRef = useRef<HTMLButtonElement>(null);
|
||||
@@ -82,7 +82,7 @@ export default function ImageViewer({ items, index, onIndexChange, onClose }: Im
|
||||
<div className="absolute inset-0 bg-black/60" />
|
||||
</div>
|
||||
|
||||
{/* Stage — owns the pan/zoom gestures. */}
|
||||
{/* Stage - owns the pan/zoom gestures. */}
|
||||
<div
|
||||
ref={stageRef}
|
||||
className="relative z-10 min-h-0 flex-1 overflow-hidden"
|
||||
@@ -132,7 +132,7 @@ export default function ImageViewer({ items, index, onIndexChange, onClose }: Im
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Thumbnail rail — horizontal at the bottom on mobile, vertical on the right on desktop. */}
|
||||
{/* Thumbnail rail - horizontal at the bottom on mobile, vertical on the right on desktop. */}
|
||||
{len > 1 && (
|
||||
<div className="z-10 flex shrink-0 gap-2 overflow-x-auto border-t border-white/10 bg-black/40 p-3 backdrop-blur-md md:w-32 md:flex-col md:overflow-x-visible md:overflow-y-auto md:border-l md:border-t-0">
|
||||
{items.map((shot, i) => {
|
||||
|
||||
Reference in new issue
Block a user