[feat] landing: 비교 토글 자동재개·헤더 nav 4개 정리·모바일 가운데 정렬·Phone Demo 히어로 디폴트, FAQ 연동답변·중개대행·역경매·와일드카드 등 논란 문구 정리
This commit is contained in:
1 parent
9ccf42cf6b
commit
6ffdb9a389
8 files changed
+37
-29
No files matched your search
@@ -7,22 +7,33 @@ import { SectionHeading } from "@/components/ui/section-heading"
|
||||
import { Typography } from "@/components/ui/typography"
|
||||
import { useFadeUp } from "@/lib/motion"
|
||||
|
||||
/** 기존 방식 ↔ 도입 후 토글 비교 — 화면 진입 시 자동으로 오가고, 사용자가 누르면 수동 고정. */
|
||||
/** 기존 방식 ↔ 도입 후 토글 비교 — 화면 진입 시 자동으로 오가고, 누르면 잠시 수동(8초 후 자동 재개). */
|
||||
export function Comparison() {
|
||||
const fadeUp = useFadeUp()
|
||||
const toggleFadeUp = useFadeUp(0.1)
|
||||
const [mode, setMode] = useState<Mode>("before")
|
||||
// 사용자가 직접 토글을 누르면 자동 전환 중단
|
||||
// 사용자가 토글을 누르면 잠시 자동 전환 중단, 8초 무조작 시 재개
|
||||
const [locked, setLocked] = useState(false)
|
||||
const [inView, setInView] = useState(false)
|
||||
const sectionRef = useRef<HTMLDivElement>(null)
|
||||
const lockTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
||||
|
||||
const selectMode = (key: Mode) => {
|
||||
setMode(key)
|
||||
setLocked(true)
|
||||
if (lockTimerRef.current) clearTimeout(lockTimerRef.current)
|
||||
lockTimerRef.current = setTimeout(() => setLocked(false), 8000)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const el = sectionRef.current
|
||||
if (!el) return
|
||||
const observer = new IntersectionObserver(([entry]) => setInView(entry.isIntersecting), { threshold: 0.35 })
|
||||
observer.observe(el)
|
||||
return () => observer.disconnect()
|
||||
return () => {
|
||||
observer.disconnect()
|
||||
if (lockTimerRef.current) clearTimeout(lockTimerRef.current)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
@@ -32,13 +43,13 @@ export function Comparison() {
|
||||
}, [inView, locked])
|
||||
|
||||
return (
|
||||
<Section id="comparison" bordered>
|
||||
<Section id="comparison">
|
||||
<motion.div {...fadeUp} className="mb-12">
|
||||
<SectionHeading
|
||||
align="center"
|
||||
eyebrow="WHY NEGOTIUM"
|
||||
title="협상 방식을 바꾸면, 무엇이 달라질까요"
|
||||
description="기존 가격 협상의 문제는 사람이 아니라 구조입니다. 버튼을 눌러 직접 비교해 보세요."
|
||||
description="기존 가격 협상의 문제는 사람이 아니라 구조입니다."
|
||||
descriptionClassName="mt-4 text-[17px] max-w-2xl"
|
||||
/>
|
||||
</motion.div>
|
||||
@@ -49,10 +60,7 @@ export function Comparison() {
|
||||
{MODES.map((m) => (
|
||||
<button
|
||||
key={m.key}
|
||||
onClick={() => {
|
||||
setLocked(true)
|
||||
setMode(m.key)
|
||||
}}
|
||||
onClick={() => selectMode(m.key)}
|
||||
className={`px-5 py-2.5 rounded-[10px] text-xs sm:text-sm font-bold transition-all flex items-center gap-2 cursor-pointer ${
|
||||
mode === m.key ? "bg-white text-primary shadow-sm" : "text-ink-soft hover:text-ink"
|
||||
}`}
|
||||
|
||||
Reference in new issue
Block a user