feat(portfolio): add hero command deck with canvas signal grid
This commit is contained in:
@@ -6,17 +6,17 @@ import { HeroCanvas } from "./HeroCanvas";
|
|||||||
|
|
||||||
const paletteEventName = "blacksite:palette";
|
const paletteEventName = "blacksite:palette";
|
||||||
|
|
||||||
|
function openCommandPalette() {
|
||||||
|
if (typeof window === "undefined") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.dispatchEvent(new CustomEvent(paletteEventName));
|
||||||
|
}
|
||||||
|
|
||||||
export function Hero() {
|
export function Hero() {
|
||||||
const shouldReduceMotion = useReducedMotion();
|
const shouldReduceMotion = useReducedMotion();
|
||||||
|
|
||||||
const openCommandPalette = () => {
|
|
||||||
if (typeof window === "undefined") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window.dispatchEvent(new CustomEvent(paletteEventName));
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
aria-labelledby="hero-heading"
|
aria-labelledby="hero-heading"
|
||||||
|
|||||||
@@ -176,8 +176,10 @@ export function HeroCanvas() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
resize();
|
resize();
|
||||||
resizeObserver = new ResizeObserver(resize);
|
if ("ResizeObserver" in window) {
|
||||||
resizeObserver.observe(canvas);
|
resizeObserver = new ResizeObserver(resize);
|
||||||
|
resizeObserver.observe(canvas);
|
||||||
|
}
|
||||||
window.addEventListener("resize", resize, { passive: true });
|
window.addEventListener("resize", resize, { passive: true });
|
||||||
|
|
||||||
if (!shouldReduceMotion) {
|
if (!shouldReduceMotion) {
|
||||||
|
|||||||
Reference in New Issue
Block a user