feat(portfolio): add manifesto and numbered capability rows
This commit is contained in:
@@ -4,8 +4,16 @@ import { m, useReducedMotion } from "motion/react";
|
|||||||
|
|
||||||
import { capabilities } from "@/lib/portfolio";
|
import { capabilities } from "@/lib/portfolio";
|
||||||
|
|
||||||
|
function formatCapabilityIndex(index: string) {
|
||||||
|
return `/.${index}`;
|
||||||
|
}
|
||||||
|
|
||||||
export function CapabilityRows() {
|
export function CapabilityRows() {
|
||||||
const shouldReduceMotion = useReducedMotion();
|
const shouldReduceMotion = useReducedMotion();
|
||||||
|
const firstMarker = formatCapabilityIndex(capabilities[0]?.index ?? "01");
|
||||||
|
const lastMarker = formatCapabilityIndex(
|
||||||
|
capabilities[capabilities.length - 1]?.index ?? "05",
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
@@ -23,7 +31,9 @@ export function CapabilityRows() {
|
|||||||
Built for hostile constraints.
|
Built for hostile constraints.
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<p className="section-label hidden text-right sm:block">/.01—/.05</p>
|
<p className="section-label hidden text-right sm:block">
|
||||||
|
{firstMarker}—{lastMarker}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="border-t border-blacksite-line">
|
<div className="border-t border-blacksite-line">
|
||||||
@@ -44,7 +54,7 @@ export function CapabilityRows() {
|
|||||||
{capability.text}
|
{capability.text}
|
||||||
</p>
|
</p>
|
||||||
<p className="section-label text-left text-blacksite-faint sm:text-right">
|
<p className="section-label text-left text-blacksite-faint sm:text-right">
|
||||||
/.{capability.index}
|
{formatCapabilityIndex(capability.index)}
|
||||||
</p>
|
</p>
|
||||||
</m.div>
|
</m.div>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ export function Hero() {
|
|||||||
const shouldReduceMotion = useReducedMotion();
|
const shouldReduceMotion = useReducedMotion();
|
||||||
|
|
||||||
const openCommandPalette = () => {
|
const openCommandPalette = () => {
|
||||||
|
if (typeof window === "undefined") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
window.dispatchEvent(new CustomEvent(paletteEventName));
|
window.dispatchEvent(new CustomEvent(paletteEventName));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ export function HeroCanvas() {
|
|||||||
let dpr = 1;
|
let dpr = 1;
|
||||||
let frameId = 0;
|
let frameId = 0;
|
||||||
let isMounted = true;
|
let isMounted = true;
|
||||||
|
let resizeObserver: ResizeObserver | null = null;
|
||||||
|
|
||||||
const resize = () => {
|
const resize = () => {
|
||||||
const rect = canvas.getBoundingClientRect();
|
const rect = canvas.getBoundingClientRect();
|
||||||
@@ -175,6 +176,8 @@ export function HeroCanvas() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
resize();
|
resize();
|
||||||
|
resizeObserver = new ResizeObserver(resize);
|
||||||
|
resizeObserver.observe(canvas);
|
||||||
window.addEventListener("resize", resize, { passive: true });
|
window.addEventListener("resize", resize, { passive: true });
|
||||||
|
|
||||||
if (!shouldReduceMotion) {
|
if (!shouldReduceMotion) {
|
||||||
@@ -183,6 +186,7 @@ export function HeroCanvas() {
|
|||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
isMounted = false;
|
isMounted = false;
|
||||||
|
resizeObserver?.disconnect();
|
||||||
window.removeEventListener("resize", resize);
|
window.removeEventListener("resize", resize);
|
||||||
if (frameId) {
|
if (frameId) {
|
||||||
window.cancelAnimationFrame(frameId);
|
window.cancelAnimationFrame(frameId);
|
||||||
|
|||||||
@@ -4,10 +4,13 @@ import { m, useReducedMotion } from "motion/react";
|
|||||||
|
|
||||||
import { manifesto } from "@/lib/portfolio";
|
import { manifesto } from "@/lib/portfolio";
|
||||||
|
|
||||||
|
const SURVIVE_PHRASE = "survive contact";
|
||||||
|
const PROOF_PHRASE = "proof";
|
||||||
|
|
||||||
export function Manifesto() {
|
export function Manifesto() {
|
||||||
const shouldReduceMotion = useReducedMotion();
|
const shouldReduceMotion = useReducedMotion();
|
||||||
const [beforeSurvive, afterSurvive = ""] = manifesto.split("survive contact");
|
const [beforeSurvive, afterSurvive = ""] = manifesto.split(SURVIVE_PHRASE);
|
||||||
const [betweenAccents, afterProof = ""] = afterSurvive.split("proof");
|
const [betweenAccents, afterProof = ""] = afterSurvive.split(PROOF_PHRASE);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<m.section
|
<m.section
|
||||||
@@ -24,9 +27,9 @@ export function Manifesto() {
|
|||||||
className="max-w-5xl font-display text-[clamp(28px,4vw,56px)] font-semibold leading-[0.98] tracking-[-0.06em] text-blacksite-muted"
|
className="max-w-5xl font-display text-[clamp(28px,4vw,56px)] font-semibold leading-[0.98] tracking-[-0.06em] text-blacksite-muted"
|
||||||
>
|
>
|
||||||
{beforeSurvive}
|
{beforeSurvive}
|
||||||
<span className="text-signal-cyan">survive contact</span>
|
<span className="text-signal-cyan">{SURVIVE_PHRASE}</span>
|
||||||
{betweenAccents}
|
{betweenAccents}
|
||||||
<span className="text-signal-orange">proof</span>
|
<span className="text-signal-orange">{PROOF_PHRASE}</span>
|
||||||
{afterProof}
|
{afterProof}
|
||||||
</h2>
|
</h2>
|
||||||
</m.section>
|
</m.section>
|
||||||
|
|||||||
Reference in New Issue
Block a user