Files
KimiCodeSwitch/website/src/components/SectionShell.tsx
T
KimiSwitch Dev 75e48bc4c6 feat(website): 官网企业版视觉升级
- 引入 Geist 字体,去除紫色渐变,克制阴影与交互态
- 导航/卡片/按钮统一企业风格,各区块视觉收敛
2026-08-06 01:56:37 +08:00

41 lines
1.1 KiB
TypeScript

import { useInView } from "../hooks";
import type { ReactNode } from "react";
interface SectionShellProps {
id: string;
title: string;
subtitle?: string;
children: ReactNode;
}
export default function SectionShell({ id, title, subtitle, children }: SectionShellProps) {
const [ref, inView] = useInView<HTMLElement>();
return (
<section
ref={ref}
id={id}
aria-labelledby={`${id}-title`}
className={`py-20 transition-all duration-700 ease-out ${
inView
? "motion-safe:opacity-100 motion-safe:translate-y-0"
: "motion-safe:opacity-0 motion-safe:translate-y-6"
}`}
>
<div className="container-page">
<div className="mb-12 max-w-3xl">
<h2
id={`${id}-title`}
className="text-3xl font-bold tracking-[-0.03em] md:text-4xl"
>
{title}
</h2>
{subtitle && (
<p className="mt-3 text-base leading-relaxed text-muted-foreground">{subtitle}</p>
)}
</div>
{children}
</div>
</section>
);
}