"use client"; /** * About-paragraph passcode easter egg — 1:1 port of the original components * `c9` + `c2` (chunk 4d3f3b68dbbde33a.js): * * - Locked: the brand label slot scrambles as "■■■■■■" (each char wrapped, * PASSCODE_LOCKED_CHAR_CLASS); clicking navigates through the route * transition to /unlock/2026?return=%2F. * - Unlocked: the slot settles to the "TikTok" button span — long-press * (500ms) or context-menu re-locks (confirm + reload). * - The reveal sequence (ScrambleReveal) treats the label as a slot part, so * its 6 characters participate in the per-char scramble timing. */ import { useCallback, useRef } from "react"; import { useRouter } from "next/navigation"; import ScrambleReveal from "@/components/dom/ScrambleReveal"; import { logoutPasscodeAccess, usePasscodeAllowed, } from "@/components/dom/PasscodeAccess"; import { PASSCODE_LOCKED_CHAR_CLASS, PASSCODE_LOCKED_SCRAMBLE_CLASS, buildPasscodeUnlockHref, passcodeLockedPlaceholderText, primaryPasscodePath, revealBrandLabel, revealBrandLabelLength, } from "@/lib/passcode"; const SCOPE = primaryPasscodePath(); // "/2026" const BRAND = revealBrandLabel(); // "TikTok" const BRAND_LEN = revealBrandLabelLength(); // 6 function RevealLabelButton() { const allowed = usePasscodeAllowed(SCOPE); const router = useRouter(); const timerRef = useRef | null>(null); const clearTimer = useCallback(() => { if (timerRef.current) { clearTimeout(timerRef.current); timerRef.current = null; } }, []); const relock = useCallback(async () => { if ( window.confirm("Lock protected content again? You will need the passcode to view it.") ) { await logoutPasscodeAccess({ reload: true }); } }, []); if (!allowed) { // TODO(route-system): go through useRouteTransitionController().startNavigation const go = () => { router.push(buildPasscodeUnlockHref(SCOPE, "/")); }; return ( { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); go(); } }} > {passcodeLockedPlaceholderText() .split("") .map((ch, i) => ( ))} ); } return ( { clearTimer(); timerRef.current = setTimeout(() => void relock(), 500); }} onPointerUp={clearTimer} onPointerLeave={clearTimer} onPointerCancel={clearTimer} onContextMenu={(e) => { e.preventDefault(); void relock(); }} > {BRAND} ); } export default function PasscodeRevealText({ className, startDelayMs = 300, letterDelayMs = 10, }: { className?: string; startDelayMs?: number; letterDelayMs?: number; }) { const allowed = usePasscodeAllowed(SCOPE); const parts = [ "I'm Haoqi Wen, leading Design Engineering and AI exploration at ", { length: BRAND_LEN, scramble: allowed ? BRAND : passcodeLockedPlaceholderText(), className: allowed ? undefined : PASSCODE_LOCKED_SCRAMBLE_CLASS, settled: , }, ", engineering, and AI at scale. Outside work, I build design tools for team efficiency.", ]; return ( ); }