From 8eb2eef9eb883f4ec7413bbe75548120ebc991dc Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 30 Oct 2026 16:22:33 +0200 Subject: [PATCH] Reuse section heading entrance and pen animations on page titles --- src/app/privacy/page.tsx | 3 ++- src/app/projects/page.tsx | 3 ++- src/standalone/PageTitle.tsx | 30 ++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 src/standalone/PageTitle.tsx diff --git a/src/app/privacy/page.tsx b/src/app/privacy/page.tsx index 998ac70..3ea1384 100644 --- a/src/app/privacy/page.tsx +++ b/src/app/privacy/page.tsx @@ -3,6 +3,7 @@ import type { Metadata } from 'next'; import { SITE_URL } from '../../lib/projectPages'; import { EMAIL } from '../../lib/siteProfile'; import StandaloneBar from '../../standalone/StandaloneBar'; +import PageTitle from '../../standalone/PageTitle'; import Contents from '../../standalone/Contents'; import '../../standalone/standalone.css'; import '../../standalone/privacy.css'; @@ -90,7 +91,7 @@ export default function Privacy() {
-

Privacy & terms

+ Privacy & terms

The short version: this site keeps a simple record of visits to see what people read, and keeps what you send through its forms so it can reply. Nothing is sold or shared for advertising, and there are no ad or tracking networks on it.

diff --git a/src/app/projects/page.tsx b/src/app/projects/page.tsx index a472725..611b2ba 100644 --- a/src/app/projects/page.tsx +++ b/src/app/projects/page.tsx @@ -2,6 +2,7 @@ import type { Metadata } from 'next'; import { SITE_URL, projectPages, projectPageUrl, tagsDoc, contributorsDoc, profileRows } from '../../lib/projectPages'; import { baseGraph, jsonLd, personRef, websiteRef, SHARE_CARD } from '../../lib/siteProfile'; import StandaloneBar from '../../standalone/StandaloneBar'; +import PageTitle from '../../standalone/PageTitle'; import ProjectsList from '../../standalone/ProjectsList'; import type { FirestoreProject } from '../../home/projects/shape'; import '../../standalone/standalone.css'; @@ -62,7 +63,7 @@ export default function ProjectsIndex() {
-

Projects

+ Projects

Things I designed and built: web apps, AI tools, a desktop system and UI designs. Each one has its live site and source code.

diff --git a/src/standalone/PageTitle.tsx b/src/standalone/PageTitle.tsx new file mode 100644 index 0000000..59c2e32 --- /dev/null +++ b/src/standalone/PageTitle.tsx @@ -0,0 +1,30 @@ +'use client'; + +import { useEffect, useRef } from 'react'; +import { enter } from '../home/entrance'; +import { handwrite } from '../lib/handwrite'; + +/** The same heading entrance and pen timing used in the homepage sections. */ +export default function PageTitle({ children }: { children: string }) { + const headingRef = useRef(null); + const inkRef = useRef(null); + + useEffect(() => { + const heading = enter(headingRef.current, { x: -30 }, { duration: 800, delay: 150 }); + const ink = handwrite(inkRef.current, { delay: 150 }); + return () => { + heading?.stop(); + ink.forEach(animation => animation.cancel()); + }; + }, []); + + return ( +
+

{children}

+ +
+ ); +}