o2o-negosium-original/landing/app/components/sections/contact.tsx
Haewon Kam 6785c8a6f4 [feat] landing: 랜딩 v2 — 다크 무대 히어로·인터랙티브 협상 데모·디자인 토큰 재정립
레퍼런스(statworx·jitter·infinith) 실측값으로 디자인 시스템을 다시 잡고,
스크롤 재생형 콘솔을 사용자가 직접 협상하는 데모로 교체했다.

디자인 토큰
- 타이포: 굵기·크기·자간을 함께 조정(섹션 제목 44→64px/600→800/자간 -0.042em).
  한글 행간은 1.07 — 라틴 기준 0.95 를 쓰면 네모틀이 꽉 차 줄이 닿는다.
- 모서리: 12가지로 흩어져 있던 값을 card 8px / control 4px / full 셋으로 수렴.
  20~32px 짜리 뭉툭한 카드가 제네릭 SaaS 의 가장 강한 신호였다.
- 다크 무대 토큰 신설(stage/on-stage/counter) + 배경 그라데이션.
- primary-on-stage(#7C8CFF) 추가 — #0101F3 은 무대 배경 대비 2.0:1 로
  WCAG 최소(4.5:1)의 절반도 안 돼 다크 위에서 읽히지 않았다.
- 영문 디스플레이 서체 Playfair Display self-host(latin 서브셋 39KB).

히어로
- 배경 캔버스가 실제 파이프라인을 그린다: 수집→분류→대조→산정→협상→학습.
  분류 단계는 거래 품목(시트)·사용자·협력사로 갈라지고 라벨이 붙는다.
- z 좌표 + 원근 투영. 군집마다 z 평면을 하나씩 줘 격자는 온전한 채 깊이만 생긴다.
- 순환 링(정원, 점선 궤도 회전). 진행도는 ref 로 공유해 60fps 리렌더를 피한다.
- 카피에 진입 애니메이션을 걸지 않는다 — LCP 요소라 opacity:0 으로 시작하면
  하이드레이션 전까지 첫 화면이 빈다.

협상 데모 (신규)
- 역할 선택(공급사/구매 담당자) → 품목·단가 제시 → 턴 협상 → 낙찰/개찰 → 상담 신청.
- 판정 규칙은 실제 엔진과 동일: 앵커링가 이하 낙찰, 협상 카드 3장, 소진 시 개찰.
- 로직은 lib/negotiation-sim.ts 순수 함수로 분리 — 나중에 agent 서비스 연동 시
  컴포넌트를 건드리지 않는다.

카피 감사
- "봇" 21곳 → "에이전트"(로봇 아이콘 3개 포함). 대리인은 조달 실무의 정당한 역할이다.
- "악역은 봇이", "단가를 깎는 악역" 제거 — 협력사를 적으로 규정하는 프레임은
  같은 페이지 FAQ(공급사 만족도 82%)와 모순이고, 동반성장 평가를 받는
  대기업 구매팀 결재 라인에 올릴 수 없다.
- 번역투 최상급(초정밀·압도적·완벽히·최적의)과 데모 대화문 전면 재작성.

버그 수정
- 헤더가 흰 배경 위에 흰 글자 버튼을 그리던 문제. onStage 를 스크롤 수치로 계산해
  하이드레이션 전 스크롤 복원 시 초기값이 굳었다 → IntersectionObserver 로 교체.
- 버튼 transition-all → transition-colors (variant 교체 시 배경 플리커).
- 폼 입력 14px → 16px. iOS 사파리는 16px 미만 입력에 포커스하면 화면을 확대해
  모바일 폼 이탈을 만든다.

정리
- 대체된 히어로 3종·기존 협상 콘솔 삭제(약 760줄).
- 라벨 아이콘·알약 배지·blur(120px) 글로우 블롭 제거.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 17:08:37 +09:00

191 lines
7.0 KiB
TypeScript

import { useState } from "react"
import { AnimatePresence, motion } from "motion/react"
import { Check, Loader2 } from "lucide-react"
import { Button } from "@/components/ui/button"
import { Input, Textarea } from "@/components/ui/input"
import { Section } from "@/components/ui/section"
import { SectionHeading } from "@/components/ui/section-heading"
import { Typography } from "@/components/ui/typography"
import { EASE_OUT_EXPO } from "@/lib/motion"
const EMPTY_FORM = {
companyName: '',
contactName: '',
email: '',
phone: '',
message: '',
}
/** 도입 문의 폼. 백엔드 미연결 — 제출은 데모 처리(1.2초 후 성공 화면). */
export function Contact() {
const [formData, setFormData] = useState(EMPTY_FORM)
const [status, setStatus] = useState<'idle' | 'submitting' | 'success'>('idle')
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault()
if (!formData.companyName || !formData.contactName || !formData.email || !formData.phone) {
return
}
setStatus('submitting')
setTimeout(() => setStatus('success'), 1200)
}
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
const { name, value } = e.target
setFormData((prev) => ({ ...prev, [name]: value }))
}
const submitting = status === 'submitting'
return (
<Section id="contact-section" bordered>
<SectionHeading
align="center"
className="mb-16"
eyebrow="Get in Touch"
title="도입 문의"
description="품목과 협력사 규모를 알려주시면, 예상 절감 구간과 도입 절차를 정리해 드립니다."
descriptionClassName="max-w-xl"
/>
<div className="max-w-2xl mx-auto">
<AnimatePresence mode="wait">
{status !== 'success' ? (
<motion.form
key="contact-form"
onSubmit={handleSubmit}
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -20 }}
transition={{ duration: 0.5, ease: EASE_OUT_EXPO }}
className="space-y-9"
>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-9">
<FormField label="회사명" required>
<Input
type="text"
name="companyName"
required
placeholder="예: (주)한빛유통"
value={formData.companyName}
onChange={handleChange}
disabled={submitting}
/>
</FormField>
<FormField label="담당자 성함 / 직책" required>
<Input
type="text"
name="contactName"
required
placeholder="예: 홍길동 팀장"
value={formData.contactName}
onChange={handleChange}
disabled={submitting}
/>
</FormField>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-9">
<FormField label="이메일 주소" required>
<Input
type="email"
name="email"
required
placeholder="example@company.com"
value={formData.email}
onChange={handleChange}
disabled={submitting}
/>
</FormField>
<FormField label="연락처" required>
<Input
type="tel"
name="phone"
required
placeholder="010-0000-0000"
value={formData.phone}
onChange={handleChange}
disabled={submitting}
/>
</FormField>
</div>
<FormField label="상세 문의 및 요구사항">
<Textarea
name="message"
rows={4}
placeholder="협상 자동화를 검토 중인 품목이나 현재 겪는 어려움을 적어주세요."
value={formData.message}
onChange={handleChange}
disabled={submitting}
/>
</FormField>
<Typography variant="caption" className="font-medium">
입력하신 정보는 문의 응답과 도입 검토 목적으로만 사용됩니다.
</Typography>
<div className="pt-2">
<Button type="submit" disabled={submitting} size="lg" className="w-full">
{submitting ? (
<>
<Loader2 className="w-5 h-5 animate-spin" />
<span>신청서 전송 중...</span>
</>
) : (
<span>상담 신청</span>
)}
</Button>
</div>
</motion.form>
) : (
<motion.div
key="success-message"
initial={{ opacity: 0, scale: 0.95 }}
animate={{ opacity: 1, scale: 1 }}
transition={{ duration: 0.6, ease: EASE_OUT_EXPO }}
className="text-center py-20 px-6 border border-line-strong rounded-card text-ink break-keep"
>
<div className="w-12 h-12 bg-primary text-white rounded-full flex items-center justify-center mx-auto mb-6">
<Check className="w-6 h-6" strokeWidth={2.5} />
</div>
<h3 className="text-[24px] font-semibold tracking-[-0.02em] text-ink mb-3">도입 문의 신청이 접수되었습니다</h3>
<p className="text-ink-soft text-[15px] leading-[1.6] max-w-md mx-auto mb-8">
{formData.contactName} 님께 영업일 기준 하루 안에 연락드리겠습니다.
</p>
<Button
type="button"
size="md"
onClick={() => {
setFormData(EMPTY_FORM)
setStatus('idle')
}}
>
새로 문의하기
</Button>
</motion.div>
)}
</AnimatePresence>
</div>
</Section>
)
}
/* 라벨 옆 작은 아이콘은 정보를 더하지 않는다 — "회사명" 옆의 빌딩 아이콘이 알려주는 건
이미 글자가 말한 것뿐이고, 필드마다 반복되면 폼이 산만해진다. 글자만 남긴다. */
function FormField({ label, required = false, children }: { label: string; required?: boolean; children: React.ReactNode }) {
return (
<div className="space-y-2.5">
<label className="block text-[14px] font-medium text-ink">
{label}
{required && <span className="text-primary ml-1" aria-hidden>*</span>}
</label>
{children}
</div>
)
}