Files
virtheart 7744a6b420 feat: SEO 商用化 — robots/sitemap/OG/结构化数据 + 服务清单内置
- robots.txt:禁 /virtheart /api /unlock,含 sitemap 指向
- sitemap.xml:动态生成(首页 + 服务页 + 已发布作品详情)
- metadata:metadataBase/title template/keywords/canonical/OG/Twitter
  卡片/apple-icon,全部后台可改(site_title/description/keywords)
- search_verification 字段:百度站长验证 meta(后台填入即生效)
- JSON-LD:首页 Person 实体 + 服务页 ProfessionalService/ Offer
- og.png(1200×630)与 icon/apple-icon 品牌图(scripts/gen-brand-images.py)
- 页脚 ICP 备案号位(icp_beian,后台填入即显示,链工信部)
- 服务清单内置 7 项(Web/小程序、AI 应用、Flutter、Java/Go、
  产品设计、全栈交付、技术咨询),价格一律面议,DB 种子幂等

SEO 部署侧待办:百度/搜狗/360/Bing 站长平台提交与验证(填
search_verification 或放验证文件)、NEXT_PUBLIC_SITE_URL 指向正式域名。
2026-09-02 18:48:44 +08:00

241 lines
8.6 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 作为默认值 fallback;页面级会传入 site_config 的 contact_email。
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({
contactEmail = CONTACT_EMAIL,
icpBeian = "",
}: {
contactEmail?: string;
/** ICP 备案号(site_config.icp_beian,空则不显示) */
icpBeian?: string;
}) {
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:${contactEmail}`}>
<ScrambleReveal
text={contactEmail}
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>
)}
{/* ICP 备案号 — site_config.icp_beian(后台可填,空则不渲染)。 */}
{icpBeian && (
<div className="absolute bottom-2 left-0 right-0 flex justify-center px-4 pointer-events-auto">
<a
href="https://beian.miit.gov.cn/"
target="_blank"
rel="noopener noreferrer nofollow"
className="font-mono-2 text-xs text-l3 hover:text-l2 transition-colors"
>
{icpBeian}
</a>
</div>
)}
</footer>
);
}