feat(portfolio): add hero command deck with canvas signal grid

This commit is contained in:
kbot
2026-07-06 20:34:19 -05:00
parent d332691e7e
commit d4a6819093
2 changed files with 12 additions and 10 deletions

View File

@@ -6,16 +6,16 @@ import { HeroCanvas } from "./HeroCanvas";
const paletteEventName = "blacksite:palette"; const paletteEventName = "blacksite:palette";
export function Hero() { function openCommandPalette() {
const shouldReduceMotion = useReducedMotion();
const openCommandPalette = () => {
if (typeof window === "undefined") { if (typeof window === "undefined") {
return; return;
} }
window.dispatchEvent(new CustomEvent(paletteEventName)); window.dispatchEvent(new CustomEvent(paletteEventName));
}; }
export function Hero() {
const shouldReduceMotion = useReducedMotion();
return ( return (
<section <section

View File

@@ -176,8 +176,10 @@ export function HeroCanvas() {
}; };
resize(); resize();
if ("ResizeObserver" in window) {
resizeObserver = new ResizeObserver(resize); resizeObserver = new ResizeObserver(resize);
resizeObserver.observe(canvas); resizeObserver.observe(canvas);
}
window.addEventListener("resize", resize, { passive: true }); window.addEventListener("resize", resize, { passive: true });
if (!shouldReduceMotion) { if (!shouldReduceMotion) {