[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

+5 -4
View File
@@ -15,11 +15,12 @@ const buttonVariants = cva(
// 밝은 배경 위 반투명 보조 버튼 (글라스 히어로)
glass: "bg-white/70 hover:bg-white text-ink-soft hover:text-ink border border-white shadow-sm",
},
// radius 는 사이즈 무관 rounded-2xl(16px) 로 통일 — 알약형 금지
size: {
pill: "px-4.5 py-2.5 text-sm font-semibold rounded-full",
md: "px-6 py-2.5 text-xs font-bold rounded-full",
lg: "px-8 py-4.5 text-base font-bold rounded-[20px]",
xl: "px-10 py-5 text-base font-bold rounded-[22px]",
pill: "px-4.5 py-2.5 text-sm font-semibold rounded-2xl",
md: "px-6 py-2.5 text-xs font-bold rounded-2xl",
lg: "px-8 py-4.5 text-base font-bold rounded-2xl",
xl: "px-10 py-5 text-base font-bold rounded-2xl",
},
},
defaultVariants: { variant: "primary", size: "lg" },
@@ -0,0 +1,58 @@
type PriceSparklineProps = {
/** 스텝별 가격 (시간순) */
prices: number[]
/** 점선 기준선으로 표시할 목표가 */
targetPrice: number
/** 그려질 비율 0~1 — 진행도에 맞춰 계단이 드러난다 */
progress: number
}
/** 계단식 가격 하락 라인 + 목표가 점선. 진행률만큼 클립으로 드러나는 미니 차트. */
function PriceSparkline({ prices, targetPrice, progress }: PriceSparklineProps) {
const W = 100
const H = 44
// 위아래 여백을 둔 가격 범위 매핑
const hi = Math.max(...prices, targetPrice)
const lo = Math.min(...prices, targetPrice)
const pad = (hi - lo) * 0.08 || 1
const MAX = hi + pad
const MIN = lo - pad
const y = (price: number) => ((MAX - price) / (MAX - MIN)) * H
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)}`
}
return (
<svg viewBox={`0 0 ${W} ${H}`} preserveAspectRatio="none" className="w-full h-16 overflow-visible" aria-hidden>
<defs>
<clipPath id="price-spark-clip">
<rect x="0" y="-4" width={Math.max(0, Math.min(progress, 1)) * W} height={H + 8} style={{ transition: "width 0.5s ease-out" }} />
</clipPath>
</defs>
{/* 목표가 기준선 */}
<g className="text-primary/40">
<line
x1="0"
y1={y(targetPrice)}
x2={W}
y2={y(targetPrice)}
stroke="currentColor"
strokeWidth="1"
strokeDasharray="4 4"
vectorEffect="non-scaling-stroke"
/>
</g>
{/* 가격 하락 계단 — 진행률만큼 클립으로 드러남 */}
<g clipPath="url(#price-spark-clip)" className="text-primary">
<path d={d} fill="none" stroke="currentColor" strokeWidth="2.5" vectorEffect="non-scaling-stroke" strokeLinejoin="round" />
</g>
</svg>
)
}
export { PriceSparkline }