1a12c70462
WORK_ITEMS 过滤后为空(含只挂锁定条目)时渲染「第一批作品正在打磨」 空状态:大字 scramble 标题 + NO.001-003 骨架卡(点阵纹理 + 虚线框 + 制作中/20XX 标签,复用真实网格不对称节奏)+ 小红书/抖音/邮箱 CTA。 - 占位卡不注册 WebGL 图层,纯 DOM 渲染,加首个真实作品自动切回 - 联系方式抽到 lib/socials.ts 供页脚与空状态共用 - lint 与基线一致(119 errors 均为存量)
220 lines
7.9 KiB
TypeScript
220 lines
7.9 KiB
TypeScript
"use client";
|
|
|
|
import { useCallback, useState } from "react";
|
|
import ScrambleReveal from "@/components/dom/ScrambleReveal";
|
|
import { CONTACT_EMAIL } from "@/lib/socials";
|
|
|
|
/**
|
|
* #contact footer — ported from the original footer (chunk
|
|
* 2689132c4e070b68.js module 28192),内容已中文化并替换为北极新一的联系方式:
|
|
*
|
|
* - `<footer id="contact">` fills the last viewport (h-dvh / lg:h-screen)
|
|
* and carries `data-section="footer"` — SmoothScroller's sP f2 factor and
|
|
* PostFX's bright-source gating both read this attribute.
|
|
* - Headline: 「让我们 / 创造 / 一些不凡的 / 数字作品」,
|
|
* "创造" 与 "数字作品" 行用 reverse reveal(字符从末位向前)。
|
|
* - Bottom bar: mailto + 抖音 / 微信 / 小红书:
|
|
* - 抖音、小红书:点击新窗口打开主页链接;悬停显示二维码卡片。
|
|
* - 微信:无链接,点击弹出二维码浮层(移动端无 hover 也能查看)。
|
|
*/
|
|
|
|
// CONTACT_EMAIL 来自 @/lib/socials(与空作品区 CTA 共享)。
|
|
|
|
const dottedLink =
|
|
"block before:absolute relative before:inset-0 p-2 lg:hover:before:border-l1 before:border-2 before:border-transparent active:before:border-l1 before:border-dotted uppercase before:content-[''] before:transition-colors before:duration-200 cursor-pointer pointer-events-auto before:pointer-events-none";
|
|
|
|
type Social = {
|
|
key: string;
|
|
label: string;
|
|
qr: string;
|
|
href?: string;
|
|
/** 无链接的条目(微信):点击弹出二维码浮层。 */
|
|
qrOnly?: boolean;
|
|
hint: string;
|
|
};
|
|
|
|
const SOCIALS: Social[] = [
|
|
{
|
|
key: "douyin",
|
|
label: "抖音",
|
|
qr: "/img/douyin.png",
|
|
href: "https://www.douyin.com/user/MS4wLjABAAAArYzCh3gIgSsDfQcN84MsMLoHFznc4wmNWJ5NsQR7T5naf21t-sCGc_tQdd4MV0zr",
|
|
hint: "扫码或点击打开抖音主页",
|
|
},
|
|
{
|
|
key: "wechat",
|
|
label: "微信",
|
|
qr: "/img/wechat.png",
|
|
qrOnly: true,
|
|
hint: "扫码添加微信",
|
|
},
|
|
{
|
|
key: "xiaohongshu",
|
|
label: "小红书",
|
|
qr: "/img/xiaohongshu.jpg",
|
|
href: "https://www.xiaohongshu.com/user/profile/6656326f0000000003033107",
|
|
hint: "扫码或点击打开小红书主页",
|
|
},
|
|
];
|
|
|
|
function QrPreview({ social }: { social: Social }) {
|
|
return (
|
|
<span
|
|
aria-hidden="true"
|
|
className="bottom-full right-0 z-20 absolute mb-3 hidden flex-col items-center gap-2 lg:group-hover:flex"
|
|
>
|
|
<span className="flex w-44 flex-col items-center gap-2 bg-be p-3 shadow-[0_8px_32px_rgba(0,0,0,0.18)]">
|
|
{/* 严格正方形的白色内衬 + object-contain:无论源图留白如何,
|
|
二维码始终 1:1 完整显示,白底保证可扫。 */}
|
|
<span className="block aspect-square w-full bg-white p-1.5">
|
|
{/* eslint-disable-next-line @next/next/no-img-element -- 静态二维码 */}
|
|
<img
|
|
src={social.qr}
|
|
alt=""
|
|
width={152}
|
|
height={152}
|
|
className="block h-full w-full object-contain select-none"
|
|
draggable={false}
|
|
/>
|
|
</span>
|
|
<span className="text-xs normal-case text-l2 whitespace-nowrap">
|
|
{social.hint}
|
|
</span>
|
|
</span>
|
|
</span>
|
|
);
|
|
}
|
|
|
|
export default function FooterSection() {
|
|
const [activeQr, setActiveQr] = useState<Social | null>(null);
|
|
const closeQr = useCallback(() => setActiveQr(null), []);
|
|
|
|
return (
|
|
<footer
|
|
id="contact"
|
|
data-section="footer"
|
|
className="z-10 relative flex flex-col justify-center p-6 lg:p-16 w-full h-dvh lg:h-screen pointer-events-none"
|
|
>
|
|
<div
|
|
className="gap-2 grid grid-cols-12 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] leading-none"
|
|
style={{ fontVariationSettings: '"wdth" 120' }}
|
|
>
|
|
<ScrambleReveal
|
|
text="让我们"
|
|
className="col-span-6 md:col-span-5 xl:col-span-4 md:col-start-2 xl:col-start-3 text-left pointer-events-auto"
|
|
startDelayMs={300}
|
|
scrambleColors={false}
|
|
/>
|
|
<ScrambleReveal
|
|
text="创造"
|
|
className="col-span-6 md:col-span-5 xl:col-span-4 text-right pointer-events-auto"
|
|
startDelayMs={300}
|
|
reverse
|
|
scrambleColors={false}
|
|
/>
|
|
</div>
|
|
<div
|
|
className="gap-2 grid grid-cols-12 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] leading-none"
|
|
style={{ fontVariationSettings: '"wdth" 120' }}
|
|
>
|
|
<ScrambleReveal
|
|
text="一些不凡的"
|
|
className="col-span-12 md:col-start-2 xl:col-start-3 text-left pointer-events-auto"
|
|
startDelayMs={300}
|
|
scrambleColors={false}
|
|
/>
|
|
</div>
|
|
<div
|
|
className="gap-2 grid grid-cols-12 font-bold text-[7.2svw] lg:text-[6svw] 2xl:text-[5svw] xl:text-[5.6svw] leading-none"
|
|
style={{ fontVariationSettings: '"wdth" 120' }}
|
|
>
|
|
<ScrambleReveal
|
|
text="数字作品"
|
|
className="col-span-12 md:col-end-12 xl:col-end-11 text-right pointer-events-auto"
|
|
startDelayMs={300}
|
|
reverse
|
|
scrambleColors={false}
|
|
/>
|
|
</div>
|
|
<div className="absolute inset-0 flex flex-col justify-end px-4 lg:px-14 py-18 lg:py-24 font-mono-2 text-sm lg:text-base">
|
|
<div className="flex lg:flex-row flex-col justify-between w-full">
|
|
<a className={dottedLink} href={`mailto:${CONTACT_EMAIL}`}>
|
|
<ScrambleReveal
|
|
text={CONTACT_EMAIL}
|
|
startDelayMs={300}
|
|
scrambleColors={false}
|
|
/>
|
|
</a>
|
|
<div className="flex flex-row items-center gap-2 lg:gap-4">
|
|
{SOCIALS.map((social) => {
|
|
const inner = (
|
|
<>
|
|
<ScrambleReveal
|
|
text={social.label}
|
|
startDelayMs={300}
|
|
scrambleColors={false}
|
|
/>
|
|
<QrPreview social={social} />
|
|
</>
|
|
);
|
|
const groupCls = `${dottedLink} group relative`;
|
|
if (social.href) {
|
|
return (
|
|
<a
|
|
key={social.key}
|
|
className={groupCls}
|
|
href={social.href}
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
aria-label={`${social.label}主页(新窗口打开)`}
|
|
>
|
|
{inner}
|
|
</a>
|
|
);
|
|
}
|
|
return (
|
|
<button
|
|
key={social.key}
|
|
type="button"
|
|
className={`${groupCls} text-left`}
|
|
aria-label="微信 — 点击显示二维码"
|
|
onClick={() => setActiveQr(social)}
|
|
>
|
|
{inner}
|
|
</button>
|
|
);
|
|
})}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{/* 二维码浮层(微信等无链接条目;移动端无 hover 的兜底) */}
|
|
{activeQr && (
|
|
<div
|
|
role="dialog"
|
|
aria-modal="true"
|
|
aria-label={`${activeQr.label}二维码`}
|
|
className="inset-0 z-50 fixed flex justify-center items-center bg-b1/80 p-6 pointer-events-auto"
|
|
onClick={closeQr}
|
|
>
|
|
<div className="flex flex-col items-center gap-4 bg-be p-8">
|
|
<span className="block aspect-square w-64 bg-white p-2 sm:w-80">
|
|
{/* eslint-disable-next-line @next/next/no-img-element -- 静态二维码 */}
|
|
<img
|
|
src={activeQr.qr}
|
|
alt={`${activeQr.label}二维码`}
|
|
width={288}
|
|
height={288}
|
|
className="block h-full w-full object-contain select-none"
|
|
draggable={false}
|
|
/>
|
|
</span>
|
|
<span className="text-sm text-l2">{activeQr.hint}</span>
|
|
<span className="font-mono-2 text-xs text-l3">点击任意处关闭</span>
|
|
</div>
|
|
</div>
|
|
)}
|
|
</footer>
|
|
);
|
|
}
|