74 lines
1.9 KiB
TypeScript
74 lines
1.9 KiB
TypeScript
import type { ReactNode } from "react";
|
|
|
|
export type PageSectionProps = {
|
|
id?: string;
|
|
title: string;
|
|
subtitle?: string;
|
|
dark?: boolean;
|
|
className?: string;
|
|
/** false면 섹션 입장용 `animate-fade-in-up` 미적용 (DEMO에 없는 모션을 쓰지 않을 때) */
|
|
animateEnter?: boolean;
|
|
children: ReactNode;
|
|
};
|
|
|
|
export function PageSection({
|
|
id,
|
|
title,
|
|
subtitle,
|
|
dark = false,
|
|
className = "",
|
|
animateEnter = true,
|
|
children,
|
|
}: PageSectionProps) {
|
|
return (
|
|
<section
|
|
id={id}
|
|
className={[
|
|
"py-16 md:py-20 px-6 scroll-mt-36",
|
|
animateEnter ? "animate-fade-in-up" : "",
|
|
dark ? "bg-navy-900 text-white relative overflow-hidden" : "bg-white",
|
|
className,
|
|
]
|
|
.filter(Boolean)
|
|
.join(" ")}
|
|
>
|
|
{dark ? (
|
|
<div
|
|
className="absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,rgba(108,92,231,0.15),transparent_60%)] pointer-events-none"
|
|
aria-hidden
|
|
/>
|
|
) : null}
|
|
<div
|
|
className={[
|
|
"relative max-w-7xl mx-auto",
|
|
dark ? "text-white" : "text-neutral-80",
|
|
].join(" ")}
|
|
>
|
|
<header className="mb-10">
|
|
<h2
|
|
className={
|
|
dark
|
|
? "font-serif text-3xl md:display-36 font-bold mb-3 bg-gradient-to-r from-lavender-200 to-marketing-ice bg-clip-text text-transparent"
|
|
: "font-serif text-3xl md:display-36 font-bold mb-3 text-transparent text-gradient"
|
|
}
|
|
>
|
|
{title}
|
|
</h2>
|
|
{subtitle ? (
|
|
<p
|
|
className={
|
|
dark
|
|
? "body-18 text-lavender-200 break-keep solid-text-paint"
|
|
: "body-18 text-neutral-70 break-keep solid-text-paint"
|
|
}
|
|
>
|
|
{subtitle}
|
|
</p>
|
|
) : null}
|
|
</header>
|
|
{children}
|
|
</div>
|
|
</section>
|
|
);
|
|
}
|