Files
frontend/apps/dm/app/(with-layout)/intro/_components/RainIntroSection.tsx
T
2026-05-12 15:37:46 +09:00

99 lines
2.9 KiB
TypeScript

"use client";
import React from "react";
import Image, { type StaticImageData } from "next/image";
import rainSummary from "@/public/images/landing/intro/rainreuse_intro.png";
import rainDuty from "@/public/images/landing/intro/rainreuse_mandatory.png";
import rainDesign from "@/public/images/landing/intro/rainwater_design.png";
import rainStandard from "@/public/images/landing/intro/rainwater_standards.png";
function SectionTitle({ children }: { children: React.ReactNode }) {
return (
<div className="flex items-center gap-3">
<span className="h-5 w-[3px] bg-sky-500" />
<h3 className="text-[24px] font-bold text-neutral-900">{children}</h3>
</div>
);
}
function Hr({ className = "" }: { className?: string }) {
return <div className={`h-[2px] w-full bg-black/10 ${className}`} />;
}
function ImgCard({ src, alt }: { src: StaticImageData; alt: string }) {
return (
<div className="w-full overflow-x-auto">
<Image
src={src}
alt={alt}
className="mx-auto block max-w-none"
style={{ width: "auto", height: "auto" }}
/>
</div>
);
}
function SectionShell({
id,
title,
children,
className = "",
}: {
id: string;
title: string;
children: React.ReactNode;
className?: string;
}) {
return (
<section id={id} className={`scroll-mt-[120px] ${className}`}>
<SectionTitle>{title}</SectionTitle>
<div className="mt-8">{children}</div>
</section>
);
}
export default function RainIntroSection() {
const title = "빗물이용시설";
return (
<div className="mt-[120px] bg-white">
<div className="inline-block">
<h2 className="relative inline-block px-2 text-[28px] font-extrabold leading-none tracking-tight text-slate-900">
<span className="relative z-10">{title}</span>
<span className="absolute bottom-[-4px] left-0 z-0 h-3 w-full bg-gradient-to-r from-sky-300 to-green-300" />
</h2>
</div>
<div className="mt-10">
<SectionShell id="rain-intro" title="빗물 재이용 소개" className="mt-10">
<ImgCard src={rainSummary} alt="빗물 재이용 소개" />
</SectionShell>
<Hr className="my-11" />
<SectionShell
id="rain-mandatory"
title="빗물이용시설 설치 관리 법적 의무 대상"
>
<ImgCard src={rainDuty} alt="빗물이용시설 설치 관리 법적 의무 대상" />
</SectionShell>
<Hr className="my-11" />
<SectionShell id="rain-design" title="빗물이용시설 설계 방안">
<ImgCard src={rainDesign} alt="빗물이용시설 설계 방안" />
</SectionShell>
<Hr className="my-11" />
<SectionShell
id="rain-standards"
title="빗물이용시설 시설기준 및 관리기준"
>
<ImgCard src={rainStandard} alt="빗물이용시설 시설기준 및 관리기준" />
</SectionShell>
</div>
</div>
);
}