From 59e9e4ff647104a9c216d40f8e8283cd4c7772d8 Mon Sep 17 00:00:00 2001 From: komeno Date: Tue, 1 Dec 2026 00:08:30 +0900 Subject: [PATCH] Tilt the About portrait and featured article photo toward the pointer The photo leans in 3D, lifts slightly, and gets a soft highlight and a shadow that follow the pointer, all driven by springs so it eases in and settles. On touch screens it follows a pressed finger and lets go on release. Shared by both pages via a [data-tilt] script and tilt.scss; the article page itself is unchanged. Co-Authored-By: Claude Opus 5.5 --- quartz/components/HomeAbout.tsx | 41 +++--- quartz/components/HomeArticles.tsx | 15 ++- quartz/components/scripts/tilt.inline.ts | 143 +++++++++++++++++++++ quartz/components/styles/homeAbout.scss | 8 +- quartz/components/styles/homeArticles.scss | 9 +- quartz/components/styles/tilt.scss | 50 +++++++ 6 files changed, 239 insertions(+), 27 deletions(-) create mode 100644 quartz/components/scripts/tilt.inline.ts create mode 100644 quartz/components/styles/tilt.scss diff --git a/quartz/components/HomeAbout.tsx b/quartz/components/HomeAbout.tsx index ba0bdfce7d119..93eb7c18656b3 100644 --- a/quartz/components/HomeAbout.tsx +++ b/quartz/components/HomeAbout.tsx @@ -1,6 +1,10 @@ import { QuartzComponent, QuartzComponentConstructor } from "./types" import { DocTitle, localizedAttrs, SiteLang, T } from "./localized" import style from "./styles/homeAbout.scss" +// @ts-ignore +import tiltScript from "./scripts/tilt.inline" +import tiltStyle from "./styles/tilt.scss" +import { concatenateResources } from "../util/resources" const aboutTitle: Record = { en: "About", @@ -17,21 +21,25 @@ const HomeAbout: QuartzComponent = () => (
-
- +
+ +
+ + +
@@ -75,6 +83,7 @@ const HomeAbout: QuartzComponent = () => ( ) -HomeAbout.css = style +HomeAbout.css = concatenateResources(style, tiltStyle) +HomeAbout.afterDOMLoaded = tiltScript export default (() => HomeAbout) satisfies QuartzComponentConstructor diff --git a/quartz/components/HomeArticles.tsx b/quartz/components/HomeArticles.tsx index ab8e67246090b..3b0fab8d048cd 100644 --- a/quartz/components/HomeArticles.tsx +++ b/quartz/components/HomeArticles.tsx @@ -14,11 +14,14 @@ import { QuartzPluginData } from "../plugins/vfile" import { concatenateResources } from "../util/resources" import style from "./styles/homeArticles.scss" import archiveStyle from "./styles/archiveGate.scss" +import tiltStyle from "./styles/tilt.scss" import { VIEWBOX, WORD, WORD_SLANT, WORD_VIEWBOX, drawGate } from "./archiveGateDrawing" // @ts-ignore import script from "./scripts/homeArticles.inline" // @ts-ignore import archiveScript from "./scripts/archiveGate.inline" +// @ts-ignore +import tiltScript from "./scripts/tilt.inline" const featuredArticleSlug = "Swift-Student-Challenge-2026" // Everything written before this article is kept behind the archive gate, on its own page. @@ -398,8 +401,12 @@ export default (() => { {featuredArticle && (
{featuredArticle.firstImage && ( -