[feat] landing: 히어로/데모 리뉴얼 — 콘솔형 히어로·price-sparkline 추가, 데모 미디어(mp4/jpg) 세트 추가, ROI 시뮬레이터·negotiation-console·버튼·홈 라우트 수정

This commit is contained in:
minaChoi committed 2026-07-22 08:29:54 +09:00
1 parent 6ffdb9a389
commit e9427543c8
20 files changed
+178 -81

No files matched your search

@@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from "react"
import { AnimatePresence, motion } from "motion/react"
import { Bot, Handshake, ShieldCheck } from "lucide-react"
import { PriceSparkline } from "@/components/ui/price-sparkline"
import { SlateRenderer } from "@/components/ui/slate-renderer"
import { Typography } from "@/components/ui/typography"
import { EASE_OUT_EXPO } from "@/lib/motion"
@@ -105,7 +106,11 @@ export function NegotiationConsole() {
{/* 계단식 하락 스파크라인 + 목표가 기준선 */}
<div>
<PriceSparkline activeStep={activeStep} />
<PriceSparkline
prices={NEGOTIATION_STEPS.map((step) => step.price)}
targetPrice={TARGET_PRICE}
progress={activeStep < 0 ? 0 : (activeStep + 1) / NEGOTIATION_STEPS.length}
/>
<div className="flex justify-between mt-2">
<Typography variant="micro">시작가 {START_PRICE.toLocaleString()}</Typography>
<Typography variant="micro" className="text-primary">
@@ -125,7 +130,7 @@ export function NegotiationConsole() {
initial={{ scale: 0.95, opacity: 0 }}
animate={{ scale: 1, opacity: 1 }}
exit={{ scale: 0.95, opacity: 0 }}
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-emerald-50 text-positive border border-emerald-100 text-xs font-bold"
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-positive-soft text-positive border border-positive/15 text-xs font-bold"
>
<ShieldCheck className="w-4 h-4 shrink-0" />
{NEGOTIATION_STEPS[activeStep].badge}
@@ -220,54 +225,6 @@ export function NegotiationConsole() {
const START_PRICE = 1200000
const TARGET_PRICE = 1080000
/** 대화 진행에 맞춰 그려지는 계단식 가격 하락 라인 + 목표가 점선. */
function PriceSparkline({ activeStep }: { activeStep: number }) {
const W = 100
const H = 44
// 위아래 여백을 둔 가격 범위 매핑
const MAX = 1215000
const MIN = 1035000
const y = (price: number) => ((MAX - price) / (MAX - MIN)) * H
const prices = NEGOTIATION_STEPS.map((step) => step.price)
const stepX = (i: number) => (i / (prices.length - 1)) * W
// step-after 계단 경로
let d = `M 0 ${y(prices[0]).toFixed(1)}`
for (let i = 1; i < prices.length; i++) {
d += ` L ${stepX(i).toFixed(1)} ${y(prices[i - 1]).toFixed(1)} L ${stepX(i).toFixed(1)} ${y(prices[i]).toFixed(1)}`
}
const progress = activeStep < 0 ? 0 : Math.min((activeStep + 1) / prices.length, 1)
return (
<svg viewBox={`0 0 ${W} ${H}`} preserveAspectRatio="none" className="w-full h-16 overflow-visible" aria-hidden>
<defs>
<clipPath id="nego-spark-clip">
<rect x="0" y="-4" width={progress * W} height={H + 8} style={{ transition: "width 0.5s ease-out" }} />
</clipPath>
</defs>
{/* 목표가 기준선 */}
<g className="text-primary/40">
<line
x1="0"
y1={y(TARGET_PRICE)}
x2={W}
y2={y(TARGET_PRICE)}
stroke="currentColor"
strokeWidth="1"
strokeDasharray="4 4"
vectorEffect="non-scaling-stroke"
/>
</g>
{/* 가격 하락 계단 — 진행률만큼 클립으로 드러남 */}
<g clipPath="url(#nego-spark-clip)" className="text-primary">
<path d={d} fill="none" stroke="currentColor" strokeWidth="2.5" vectorEffect="non-scaling-stroke" strokeLinejoin="round" />
</g>
</svg>
)
}
// 데모 대화 시나리오 — 1,200,000원 제시에서 1,050,000원 낙찰까지 6스텝
const NEGOTIATION_STEPS: DialogueStep[] = [
{