diff --git a/.gitignore b/.gitignore index 4bb1e75..2427d71 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ Thumbs.db # ---- Obsidian ---- .obsidian/ +.claudian/sessions/conv-1781943335504-q62bzosye.meta.json diff --git a/frontend/index.html b/frontend/index.html index bbbb74b..babf80e 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,8 +4,11 @@ - - CamTalk — AI 视觉对话助手 + + CamTalk - AI 视觉对话助手 + + +
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 0c3d1d8..73a7906 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -11,7 +11,7 @@ import { ChatPanel } from "./components/ChatPanel"; import { ConfigPanel } from "./components/ConfigPanel"; import { SessionSidebar } from "./components/SessionSidebar"; import { ToastContainer } from "./components/Toast"; -import { AuthPage } from "./components/AuthPage"; +import { LandingPage } from "./components/LandingPage"; import { AuthProvider, useAuth } from "./lib/auth"; import { loadConfig, loadTheme, saveTheme } from "./lib/storage"; import { I18nContext, parseLocale, t } from "./lib/i18n"; @@ -232,7 +232,7 @@ function AppContent() { } if (!isAuthenticated) { - return ; + return ; } return ( diff --git a/frontend/src/components/LandingPage/LandingPage.css b/frontend/src/components/LandingPage/LandingPage.css new file mode 100644 index 0000000..b162ecf --- /dev/null +++ b/frontend/src/components/LandingPage/LandingPage.css @@ -0,0 +1,1183 @@ +/* ============================================================ + LandingPage — Daylight Redesign + Typeface: Outfit + Noto Sans SC | Accent: blue | Bg: warm light + Motion: custom cubic-bezier, reduced-motion aware + ============================================================ */ + +/* ========== Root Tokens ========== */ +.landing-page { + --bg-base: #f6f7f9; + --bg-surface: #ffffff; + --bg-elevated: #f0f2f5; + --bg-overlay: rgba(255, 255, 255, 0.92); + + --border-subtle: rgba(0, 0, 0, 0.06); + --border-hover: rgba(0, 0, 0, 0.12); + + --accent: #2563eb; + --accent-dim: rgba(37, 99, 235, 0.08); + --accent-hover: #1d4ed8; + + --text-primary: #111827; + --text-secondary:#4b5563; + --text-muted: #9ca3af; + + --brand-grad: linear-gradient(135deg, #2563eb 0%, #6366f1 55%, #a855f7 100%); + + --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04); + --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04); + --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04); + --shadow-glow: 0 4px 24px rgba(37, 99, 235, 0.12); + + --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1); + --ease-spring: cubic-bezier(0.32, 0.72, 0, 1); + --dur-normal: 500ms; + --dur-slow: 800ms; + + --radius-sm: 6px; + --radius-md: 12px; + --radius-lg: 20px; + --radius-xl: 28px; + --radius-pill: 999px; + + --font-sans: 'Outfit', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', 'WenQuanYi Micro Hei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; + + position: relative; + min-height: 100dvh; + background: var(--bg-base); + color: var(--text-primary); + font-family: var(--font-sans); + line-height: 1.8; + overflow-x: hidden; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + word-break: break-word; + overflow-wrap: break-word; +} + +/* ========== Grain Overlay ========== */ +.landing-page::before { + content: ""; + position: fixed; + inset: 0; + z-index: 60; + pointer-events: none; + opacity: 0.018; + background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); + background-repeat: repeat; + background-size: 200px; +} + +/* ========== Ambient Background ========== */ +.landing-page .lp-bg-grid { + position: fixed; + inset: 0; + z-index: 0; + pointer-events: none; + background: + radial-gradient(ellipse 60% 50% at 15% 20%, rgba(37, 99, 235, 0.04) 0%, transparent 70%), + radial-gradient(ellipse 50% 40% at 85% 75%, rgba(99, 102, 241, 0.03) 0%, transparent 70%); +} + +/* ========== Layout ========== */ +.landing-page .lp-container { + max-width: 1200px; + margin: 0 auto; + padding: 0 24px; + position: relative; + z-index: 1; +} + +.landing-page section { + padding: 100px 0; +} + +/* ========== Top Navigation ========== */ +.lp-nav { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 90; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 32px; + height: 64px; + background: rgba(255, 255, 255, 0.72); + backdrop-filter: blur(20px) saturate(1.4); + -webkit-backdrop-filter: blur(20px) saturate(1.4); + border-bottom: 1px solid var(--border-subtle); +} + +.lp-nav__logo { + font-size: 1.2rem; + font-weight: 700; + letter-spacing: -0.01em; + background: var(--brand-grad); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + cursor: default; +} + +.lp-nav__links { + display: flex; + gap: 28px; +} + +.lp-nav__links a { + color: var(--text-muted); + text-decoration: none; + font-size: 0.85rem; + font-weight: 500; + letter-spacing: 0; + transition: color var(--dur-normal) var(--ease-out-expo); +} +.lp-nav__links a:hover { + color: var(--text-primary); +} + +.lp-nav__actions { + display: flex; + gap: 8px; +} + +.lp-nav__btn { + padding: 7px 16px; + border-radius: var(--radius-pill); + font-size: 0.82rem; + font-weight: 500; + font-family: var(--font-sans); + cursor: pointer; + border: none; + transition: all var(--dur-normal) var(--ease-spring); +} + +.lp-nav__btn--ghost { + background: transparent; + color: var(--text-secondary); + border: 1px solid var(--border-subtle); +} +.lp-nav__btn--ghost:hover { + color: var(--text-primary); + border-color: var(--border-hover); + background: rgba(0, 0, 0, 0.02); +} +.lp-nav__btn--ghost:active { + transform: scale(0.97); +} + +.lp-nav__btn--primary { + background: var(--accent); + color: #ffffff; + box-shadow: 0 2px 12px rgba(37, 99, 235, 0.2); +} +.lp-nav__btn--primary:hover { + background: var(--accent-hover); + box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3); + transform: translateY(-1px); +} +.lp-nav__btn--primary:active { + transform: scale(0.97) translateY(0); +} + +/* ========== Hero ========== */ +.lp-hero { + min-height: 100dvh; + display: flex; + align-items: center; + justify-content: center; + text-align: center; + position: relative; + padding-top: 64px; +} + +.lp-hero-content { + max-width: 780px; +} + +.lp-hero-badge { + display: inline-flex; + align-items: center; + gap: 8px; + background: var(--bg-surface); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-pill); + padding: 6px 16px; + font-size: 0.78rem; + font-weight: 500; + letter-spacing: 0.02em; + color: var(--text-secondary); + margin-bottom: 36px; + box-shadow: var(--shadow-sm); +} + +.lp-hero-badge__dot { + width: 6px; + height: 6px; + border-radius: 50%; + background: #22c55e; + animation: lpPulse 2.5s ease-in-out infinite; +} +@keyframes lpPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } } + +.lp-hero h1 { + font-size: clamp(2.4rem, 5.5vw, 4rem); + font-weight: 800; + line-height: 1.2; + letter-spacing: -0.01em; + margin-bottom: 24px; + color: var(--text-primary); +} + +.lp-hero h1 .lp-gradient { + background: var(--brand-grad); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; +} + +.lp-hero__sub { + font-size: 1.05rem; + font-weight: 400; + color: var(--text-secondary); + max-width: 520px; + margin: 0 auto 0; + line-height: 1.85; +} + +/* Hero CTA Actions */ +.lp-hero-actions { + display: flex; + flex-direction: column; + align-items: center; + gap: 16px; + margin: 36px auto 44px; +} + +.lp-hero-actions__links { + display: flex; + gap: 20px; +} + +.lp-hero-actions__links a { + color: var(--text-muted); + text-decoration: none; + font-size: 0.82rem; + font-weight: 500; + transition: color var(--dur-normal) var(--ease-out-expo); +} +.lp-hero-actions__links a:hover { + color: var(--accent); +} + +/* Device Mockup - Double Bezel */ +.lp-hero-visual { + position: relative; + width: 100%; + max-width: 680px; + margin: 64px auto 0; + aspect-ratio: 16/9; + border-radius: var(--radius-xl); + padding: 3px; + background: linear-gradient(145deg, rgba(0,0,0,0.08), rgba(0,0,0,0.03)); + box-shadow: var(--shadow-lg); +} + +.lp-hero-visual__inner { + width: 100%; + height: 100%; + border-radius: calc(var(--radius-xl) - 3px); + overflow: hidden; + background: var(--bg-surface); + position: relative; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); +} + +.lp-hero-visual__screen { + position: absolute; + inset: 0; + display: grid; + grid-template-columns: 1fr 1fr; +} + +.lp-screen-left { + background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%); + display: flex; + align-items: center; + justify-content: center; + position: relative; + overflow: hidden; +} + +.lp-camera-ring { + width: 120px; + height: 120px; + border-radius: 50%; + border: 1.5px solid rgba(96, 165, 250, 0.35); + display: flex; + align-items: center; + justify-content: center; + animation: lpRingPulse 4s ease-in-out infinite; + position: relative; +} + +.lp-camera-ring::before { + content: ''; + position: absolute; + inset: -10px; + border-radius: 50%; + border: 1px solid rgba(96, 165, 250, 0.12); +} + +.lp-camera-ring svg { + width: 40px; + height: 40px; + fill: none; + stroke: #60a5fa; + stroke-width: 1.2; + opacity: 0.8; +} +@keyframes lpRingPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: 0.8; } } + +.lp-scan-line { + position: absolute; + left: 0; + right: 0; + height: 1px; + background: linear-gradient(90deg, transparent, #60a5fa, transparent); + animation: lpScanMove 4s linear infinite; + opacity: 0.5; +} +@keyframes lpScanMove { 0% { top: 0; } 100% { top: 100%; } } + +.lp-screen-right { + background: var(--bg-surface); + padding: 24px; + display: flex; + flex-direction: column; + gap: 10px; + border-left: 1px solid var(--border-subtle); +} + +.lp-chat-bubble { + max-width: 85%; + padding: 10px 14px; + border-radius: var(--radius-md); + font-size: 0.78rem; + line-height: 1.7; + animation: lpFadeInUp var(--dur-slow) var(--ease-out-expo) both; +} + +.lp-chat-bubble--user { + background: var(--accent); + color: #ffffff; + font-weight: 500; + align-self: flex-end; + border-bottom-right-radius: var(--radius-sm); +} + +.lp-chat-bubble--ai { + background: var(--bg-elevated); + color: var(--text-secondary); + align-self: flex-start; + border-bottom-left-radius: var(--radius-sm); + border: 1px solid var(--border-subtle); +} + +.lp-typing { + display: inline-flex; + gap: 4px; + margin-top: 6px; +} + +.lp-typing span { + width: 4px; + height: 4px; + border-radius: 50%; + background: var(--accent); + animation: lpBlink 1.4s infinite both; +} +.lp-typing span:nth-child(2) { animation-delay: 0.2s; } +.lp-typing span:nth-child(3) { animation-delay: 0.4s; } +@keyframes lpBlink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } } +@keyframes lpFadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } } + +.lp-chat-bubble:nth-child(1) { animation-delay: 0.2s; } +.lp-chat-bubble:nth-child(2) { animation-delay: 0.6s; } +.lp-chat-bubble:nth-child(3) { animation-delay: 1.1s; } + +.lp-audio-wave { + display: flex; + align-items: center; + gap: 2px; + margin-top: auto; + padding-top: 8px; +} + +.lp-audio-wave span { + width: 2px; + border-radius: 2px; + background: var(--accent); + animation: lpWaveBar 1.2s ease-in-out infinite; + opacity: 0.7; +} +.lp-audio-wave span:nth-child(1) { height: 10px; animation-delay: 0s; } +.lp-audio-wave span:nth-child(2) { height: 18px; animation-delay: 0.1s; } +.lp-audio-wave span:nth-child(3) { height: 14px; animation-delay: 0.2s; } +.lp-audio-wave span:nth-child(4) { height: 22px; animation-delay: 0.3s; } +.lp-audio-wave span:nth-child(5) { height: 12px; animation-delay: 0.4s; } +.lp-audio-wave span:nth-child(6) { height: 18px; animation-delay: 0.15s; } +.lp-audio-wave span:nth-child(7) { height: 8px; animation-delay: 0.35s; } +@keyframes lpWaveBar { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1.2); } } + +/* ========== Section Headers ========== */ +.lp-section-header { + text-align: center; + margin-bottom: 64px; +} + +.lp-section-header__tag { + display: inline-block; + font-size: 1.75rem; + font-weight: 600; + letter-spacing: 0.04em; + color: var(--accent); + margin-bottom: 14px; +} + +.lp-section-header h2 { + font-size: clamp(1.8rem, 3.5vw, 2.4rem); + font-weight: 700; + line-height: 1.3; + letter-spacing: -0.01em; + color: var(--text-primary); +} + +.lp-section-header p { + color: var(--text-secondary); + max-width: 520px; + margin: 14px auto 0; + font-size: 0.95rem; + line-height: 1.85; +} + +/* ========== Problem Section ========== */ +.lp-problem-grid { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 16px; +} + +.lp-problem-card { + background: var(--bg-surface); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-lg); + padding: 32px; + transition: all var(--dur-normal) var(--ease-spring); + position: relative; + box-shadow: var(--shadow-sm); +} + +.lp-problem-card:hover { + border-color: var(--border-hover); + transform: translateY(-4px); + box-shadow: var(--shadow-lg); +} + +.lp-problem-card__icon { + width: 44px; + height: 44px; + border-radius: var(--radius-md); + display: flex; + align-items: center; + justify-content: center; + font-size: 1.3rem; + margin-bottom: 20px; + background: var(--bg-elevated); + border: 1px solid var(--border-subtle); +} + +.lp-problem-card h3 { + font-size: 1.05rem; + font-weight: 600; + letter-spacing: 0; + margin-bottom: 8px; + color: var(--text-primary); +} + +.lp-problem-card p { + color: var(--text-secondary); + font-size: 0.88rem; + line-height: 1.85; +} + +/* ========== Flow Section ========== */ +.lp-flow-wrapper { + background: var(--bg-surface); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-xl); + padding: 48px 40px; + overflow-x: auto; + box-shadow: var(--shadow-sm); +} + +.lp-flow-steps { + display: flex; + align-items: center; + gap: 0; + min-width: 700px; + justify-content: center; +} + +.lp-flow-step { + display: flex; + flex-direction: column; + align-items: center; + gap: 12px; + min-width: 100px; + text-align: center; +} + +.lp-flow-step__node { + width: 56px; + height: 56px; + border-radius: var(--radius-lg); + display: flex; + align-items: center; + justify-content: center; + font-size: 1.4rem; + border: 1px solid var(--border-subtle); + background: var(--bg-elevated); + transition: all var(--dur-normal) var(--ease-spring); +} + +.lp-flow-step:hover .lp-flow-step__node { + border-color: var(--accent-dim); + box-shadow: var(--shadow-glow); + transform: scale(1.08); +} + +.lp-flow-step__label { + font-size: 0.78rem; + color: var(--text-secondary); + font-weight: 500; + letter-spacing: 0; +} + +.lp-flow-arrow { + font-size: 1rem; + color: var(--text-muted); + flex-shrink: 0; + padding: 0 6px; +} + +/* ========== Features (asymmetric 2-col) ========== */ +.lp-features-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 16px; +} + +.lp-feature-card { + background: var(--bg-surface); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-lg); + padding: 36px 32px; + transition: all var(--dur-normal) var(--ease-spring); + position: relative; + overflow: hidden; + box-shadow: var(--shadow-sm); +} + +.lp-feature-card:hover { + border-color: var(--border-hover); + box-shadow: var(--shadow-lg); +} + +.lp-feature-card:last-child:nth-child(odd) { + grid-column: 1 / -1; + max-width: calc(50% - 8px); + justify-self: center; +} + +.lp-feature-card__number { + position: absolute; + top: 24px; + right: 24px; + font-size: 2.2rem; + font-weight: 800; + color: rgba(0, 0, 0, 0.04); + line-height: 1; + letter-spacing: -0.02em; + font-variant-numeric: tabular-nums; +} + +.lp-feature-card__icon { + width: 40px; + height: 40px; + border-radius: var(--radius-md); + display: flex; + align-items: center; + justify-content: center; + font-size: 1.2rem; + margin-bottom: 20px; + background: var(--bg-elevated); + border: 1px solid var(--border-subtle); +} + +.lp-feature-card h3 { + font-size: 1.05rem; + font-weight: 600; + letter-spacing: 0; + margin-bottom: 10px; + color: var(--text-primary); +} + +.lp-feature-card p { + color: var(--text-secondary); + font-size: 0.88rem; + line-height: 1.85; +} + +/* ========== Users ========== */ +.lp-users-grid { + display: grid; + grid-template-columns: repeat(5, 1fr); + gap: 12px; +} + +.lp-user-card { + background: var(--bg-surface); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-lg); + padding: 24px 16px; + text-align: center; + transition: all var(--dur-normal) var(--ease-spring); + box-shadow: var(--shadow-sm); +} + +.lp-user-card:hover { + transform: translateY(-4px); + box-shadow: var(--shadow-lg); + border-color: var(--border-hover); +} + +.lp-user-card__avatar { + width: 48px; + height: 48px; + border-radius: var(--radius-md); + display: flex; + align-items: center; + justify-content: center; + font-size: 1.4rem; + margin: 0 auto 14px; + background: var(--bg-elevated); + border: 1px solid var(--border-subtle); +} + +.lp-user-card h4 { + font-size: 0.9rem; + font-weight: 600; + letter-spacing: 0; + margin-bottom: 6px; + color: var(--text-primary); +} + +.lp-user-card p { + color: var(--text-secondary); + font-size: 0.78rem; + line-height: 1.75; +} + +/* ========== Scenes ========== */ +.lp-scenes-list { + display: flex; + flex-direction: column; + gap: 8px; +} + +.lp-scene-row { + display: grid; + grid-template-columns: 44px 1fr auto; + gap: 16px; + align-items: center; + background: var(--bg-surface); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-md); + padding: 18px 24px; + transition: all var(--dur-normal) var(--ease-spring); + box-shadow: var(--shadow-sm); +} + +.lp-scene-row:hover { + border-color: var(--border-hover); + background: var(--bg-elevated); + box-shadow: var(--shadow-md); +} + +.lp-scene-row__icon { + font-size: 1.3rem; + text-align: center; +} + +.lp-scene-row h4 { + font-size: 0.92rem; + font-weight: 600; + letter-spacing: 0; + margin-bottom: 2px; + color: var(--text-primary); +} + +.lp-scene-row__desc { + color: var(--text-secondary); + font-size: 0.82rem; + line-height: 1.75; +} + +.lp-scene-row__tag { + font-size: 0.7rem; + padding: 3px 10px; + border-radius: var(--radius-pill); + font-weight: 500; + white-space: nowrap; + background: var(--bg-elevated); + color: var(--text-secondary); + border: 1px solid var(--border-subtle); +} + +/* ========== Metrics ========== */ +.lp-metrics-grid { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 12px; +} + +.lp-metric-card { + background: var(--bg-surface); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-lg); + padding: 32px 24px; + text-align: center; + transition: all var(--dur-normal) var(--ease-spring); + box-shadow: var(--shadow-sm); +} + +.lp-metric-card:hover { + border-color: var(--border-hover); + box-shadow: var(--shadow-glow); +} + +.lp-metric-card__value { + font-size: 2rem; + font-weight: 800; + letter-spacing: -0.02em; + margin-bottom: 6px; + color: var(--accent); + font-variant-numeric: tabular-nums; +} + +.lp-metric-card__label { + color: var(--text-secondary); + font-size: 0.82rem; + font-weight: 500; + letter-spacing: 0; +} + +/* ========== Tech Stack ========== */ +.lp-tech-layers { + display: flex; + flex-direction: column; + gap: 12px; +} + +.lp-tech-layer { + background: var(--bg-surface); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-lg); + padding: 24px 28px; + display: grid; + grid-template-columns: 100px 1fr; + gap: 20px; + align-items: center; + transition: all var(--dur-normal) var(--ease-spring); + box-shadow: var(--shadow-sm); +} + +.lp-tech-layer:hover { + border-color: var(--border-hover); + box-shadow: var(--shadow-md); +} + +.lp-tech-layer__badge { + font-size: 0.7rem; + font-weight: 600; + letter-spacing: 0.04em; + padding: 4px 10px; + border-radius: var(--radius-sm); + display: inline-block; + width: fit-content; + background: var(--bg-elevated); + color: var(--text-secondary); + border: 1px solid var(--border-subtle); +} + +.lp-tech-layer__tags { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.lp-tech-layer__tags span { + background: var(--bg-elevated); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-sm); + padding: 5px 12px; + font-size: 0.78rem; + color: var(--text-secondary); + font-weight: 400; + transition: all var(--dur-normal) var(--ease-out-expo); +} + +.lp-tech-layer__tags span:hover { + border-color: var(--accent-dim); + color: var(--text-primary); +} + +/* ========== CTA / Footer ========== */ +.lp-cta-section { + text-align: center; + padding: 120px 0; +} + +.lp-cta-section h2 { + font-size: clamp(1.6rem, 3vw, 2.2rem); + font-weight: 700; + letter-spacing: -0.01em; + margin-bottom: 16px; + color: var(--text-primary); +} + +.lp-cta-section p { + color: var(--text-secondary); + margin-bottom: 36px; + font-size: 1rem; +} + +.lp-cta-btn { + display: inline-flex; + align-items: center; + gap: 10px; + background: var(--accent); + color: #ffffff; + font-size: 0.95rem; + font-weight: 600; + font-family: var(--font-sans); + padding: 14px 32px; + border-radius: var(--radius-pill); + text-decoration: none; + transition: all var(--dur-normal) var(--ease-spring); + border: none; + cursor: pointer; + box-shadow: 0 4px 24px rgba(37, 99, 235, 0.22); +} + +.lp-cta-btn:hover { + background: var(--accent-hover); + transform: translateY(-2px); + box-shadow: 0 8px 36px rgba(37, 99, 235, 0.32); +} + +.lp-cta-btn:active { + transform: scale(0.97); +} + +.lp-cta-links { + margin-top: 24px; + display: flex; + gap: 20px; + justify-content: center; +} + +.lp-cta-links a { + color: var(--text-muted); + text-decoration: none; + font-size: 0.82rem; + font-weight: 500; + transition: color var(--dur-normal) var(--ease-out-expo); +} +.lp-cta-links a:hover { + color: var(--accent); +} + +.lp-footer { + border-top: 1px solid var(--border-subtle); + padding: 32px 0; + text-align: center; + color: var(--text-muted); + font-size: 0.82rem; + font-weight: 400; +} + +/* ========== Scroll Animations ========== */ +.lp-fade-in { + opacity: 0; + transform: translateY(32px); + transition: opacity var(--dur-slow) var(--ease-out-expo), + transform var(--dur-slow) var(--ease-out-expo); +} +.lp-fade-in.lp-visible { + opacity: 1; + transform: translateY(0); +} + +/* ========== Login Modal ========== */ +.lp-modal-overlay { + position: fixed; + inset: 0; + z-index: 100; + display: flex; + align-items: center; + justify-content: center; + background: rgba(0, 0, 0, 0.3); + backdrop-filter: blur(12px); + -webkit-backdrop-filter: blur(12px); + animation: lpModalOverlayIn 300ms var(--ease-out-expo); +} + +@keyframes lpModalOverlayIn { + from { opacity: 0; } + to { opacity: 1; } +} + +/* Double-bezel modal */ +.lp-modal { + width: 100%; + max-width: 380px; + border-radius: var(--radius-xl); + padding: 4px; + background: linear-gradient(160deg, rgba(0,0,0,0.06), rgba(0,0,0,0.02)); + box-shadow: 0 32px 80px rgba(0, 0, 0, 0.15), 0 0 60px rgba(37, 99, 235, 0.06); + animation: lpModalIn 400ms var(--ease-spring); +} + +@keyframes lpModalIn { + from { opacity: 0; transform: translateY(24px) scale(0.96); } + to { opacity: 1; transform: translateY(0) scale(1); } +} + +.lp-modal__inner { + background: var(--bg-surface); + border-radius: calc(var(--radius-xl) - 4px); + padding: 36px 28px 28px; + position: relative; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); +} + +.lp-modal__close { + position: absolute; + top: 12px; + right: 12px; + width: 32px; + height: 32px; + border-radius: var(--radius-sm); + border: none; + background: transparent; + color: var(--text-muted); + font-size: 1.1rem; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: all var(--dur-normal) var(--ease-out-expo); +} +.lp-modal__close:hover { + background: rgba(0, 0, 0, 0.04); + color: var(--text-primary); +} + +.lp-modal__header { + text-align: center; + margin-bottom: 28px; +} + +.lp-modal__logo { + font-size: 1.5rem; + font-weight: 700; + letter-spacing: -0.01em; + background: var(--brand-grad); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + margin-bottom: 4px; +} + +.lp-modal__subtitle { + color: var(--text-muted); + font-size: 0.82rem; + font-weight: 400; +} + +/* Modal form */ +.lp-modal__tabs { + display: flex; + gap: 0; + margin-bottom: 20px; + background: var(--bg-base); + border-radius: var(--radius-md); + padding: 3px; +} + +.lp-modal__tab { + flex: 1; + padding: 8px 0; + border: none; + border-radius: calc(var(--radius-md) - 2px); + font-size: 0.82rem; + font-weight: 500; + font-family: var(--font-sans); + cursor: pointer; + background: transparent; + color: var(--text-muted); + transition: all var(--dur-normal) var(--ease-out-expo); +} + +.lp-modal__tab:hover { + color: var(--text-secondary); +} + +.lp-modal__tab--active { + background: var(--bg-surface); + color: var(--text-primary); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); +} + +.lp-modal__field { + display: block; + margin-bottom: 14px; +} + +.lp-modal__field-label { + display: block; + font-size: 0.75rem; + color: var(--text-secondary); + margin-bottom: 6px; + font-weight: 500; +} + +.lp-modal__field-input { + width: 100%; + padding: 10px 14px; + border-radius: var(--radius-md); + border: 1px solid var(--border-subtle); + background: var(--bg-base); + color: var(--text-primary); + font-size: 0.88rem; + font-family: var(--font-sans); + outline: none; + transition: border-color var(--dur-normal) var(--ease-out-expo), + box-shadow var(--dur-normal) var(--ease-out-expo); +} + +.lp-modal__field-input::placeholder { + color: var(--text-muted); +} + +.lp-modal__field-input:focus { + border-color: var(--accent); + box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); +} + +.lp-modal__error { + background: rgba(239, 68, 68, 0.06); + border: 1px solid rgba(239, 68, 68, 0.18); + color: #dc2626; + font-size: 0.78rem; + padding: 8px 12px; + border-radius: var(--radius-sm); + margin-bottom: 14px; + text-align: center; +} + +.lp-modal__submit { + width: 100%; + padding: 11px 0; + border-radius: var(--radius-pill); + border: none; + background: var(--accent); + color: #ffffff; + font-size: 0.9rem; + font-weight: 600; + font-family: var(--font-sans); + cursor: pointer; + transition: all var(--dur-normal) var(--ease-spring); + box-shadow: 0 2px 16px rgba(37, 99, 235, 0.18); +} + +.lp-modal__submit:hover:not(:disabled) { + background: var(--accent-hover); + transform: translateY(-1px); + box-shadow: 0 4px 24px rgba(37, 99, 235, 0.28); +} + +.lp-modal__submit:active:not(:disabled) { + transform: scale(0.97); +} + +.lp-modal__submit:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +.lp-modal__footer { + text-align: center; + margin-top: 20px; + font-size: 0.78rem; + color: var(--text-muted); +} + +.lp-modal__link { + background: none; + border: none; + color: var(--accent); + cursor: pointer; + font-size: 0.78rem; + font-weight: 500; + font-family: var(--font-sans); + margin-left: 4px; + padding: 0; + transition: color var(--dur-normal) var(--ease-out-expo); +} +.lp-modal__link:hover { + color: var(--accent-hover); +} + +/* ========== Responsive ========== */ +@media (max-width: 768px) { + .lp-nav__links { display: none; } + .lp-problem-grid { grid-template-columns: 1fr; } + .lp-features-grid { grid-template-columns: 1fr; } + .lp-feature-card:last-child:nth-child(odd) { max-width: 100%; grid-column: auto; } + .lp-users-grid { grid-template-columns: repeat(2, 1fr); } + .lp-metrics-grid { grid-template-columns: repeat(2, 1fr); } + .lp-tech-layer { grid-template-columns: 1fr; } +} + +@media (max-width: 640px) { + .landing-page section { padding: 72px 0; } + .lp-hero-visual { margin-top: 40px; } + .lp-scene-row { grid-template-columns: 40px 1fr; } + .lp-scene-row__tag { grid-column: 2; justify-self: start; } + .lp-flow-steps { justify-content: flex-start; } + .lp-users-grid { grid-template-columns: 1fr; } +} + +/* ========== Reduced Motion ========== */ +@media (prefers-reduced-motion: reduce) { + .lp-fade-in { opacity: 1; transform: none; transition: none; } + .lp-scan-line, .lp-camera-ring, .lp-audio-wave span, .lp-typing span, .lp-hero-badge__dot { animation: none; } + .lp-chat-bubble { animation: none; opacity: 1; transform: none; } + .lp-modal-overlay, .lp-modal { animation-duration: 0.01ms; } + *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } +} diff --git a/frontend/src/components/LandingPage/LoginModal.tsx b/frontend/src/components/LandingPage/LoginModal.tsx new file mode 100644 index 0000000..fceda39 --- /dev/null +++ b/frontend/src/components/LandingPage/LoginModal.tsx @@ -0,0 +1,163 @@ +// ============================================================ +// LoginModal — 登录 / 注册模态框 +// 职责:在 LandingPage 上弹出的认证表单,复用现有 auth 系统 +// ============================================================ + +import { useCallback, useEffect, useRef, useState } from "react"; +import { useAuth } from "../../lib/auth"; +import { useI18n } from "../../lib/i18n"; + +type AuthMode = "login" | "register"; + +interface LoginModalProps { + initialMode?: AuthMode; + onClose: () => void; +} + +export function LoginModal({ initialMode = "login", onClose }: LoginModalProps) { + const { login, register } = useAuth(); + const { t } = useI18n(); + const [mode, setMode] = useState(initialMode); + const [username, setUsername] = useState(""); + const [password, setPassword] = useState(""); + const [error, setError] = useState(""); + const [isSubmitting, setIsSubmitting] = useState(false); + const overlayRef = useRef(null); + + // 点击遮罩关闭 + const handleOverlayClick = useCallback( + (e: React.MouseEvent) => { + if (e.target === overlayRef.current) onClose(); + }, + [onClose] + ); + + // ESC 关闭 + useEffect(() => { + const handler = (e: KeyboardEvent) => { + if (e.key === "Escape") onClose(); + }; + window.addEventListener("keydown", handler); + return () => window.removeEventListener("keydown", handler); + }, [onClose]); + + // 阻止 body 滚动 + useEffect(() => { + const prev = document.body.style.overflow; + document.body.style.overflow = "hidden"; + return () => { document.body.style.overflow = prev; }; + }, []); + + const handleSubmit = useCallback( + async (e: React.FormEvent) => { + e.preventDefault(); + setError(""); + + if (username.length < 3 || username.length > 64) { + setError(t("auth.error.usernameLength")); + return; + } + if (password.length < 8 || password.length > 72) { + setError(t("auth.error.passwordLength")); + return; + } + + setIsSubmitting(true); + const fn = mode === "login" ? login : register; + const result = await fn(username, password); + setIsSubmitting(false); + + if (result.error) { + setError(result.error); + } + // 登录成功时 auth 状态更新,App 自动切到主界面,modal 自然消失 + }, + [username, password, mode, login, register, t] + ); + + const switchMode = useCallback(() => { + setMode((m) => (m === "login" ? "register" : "login")); + setError(""); + }, []); + + return ( +
+
+
+ + +
+
CamTalk
+
{t("auth.subtitle")}
+
+ +
+
+ + +
+ + + + + + {error &&
{error}
} + + +
+ +
+ {mode === "login" ? t("auth.noAccount") : t("auth.hasAccount")} + +
+
+
+
+ ); +} diff --git a/frontend/src/components/LandingPage/index.tsx b/frontend/src/components/LandingPage/index.tsx new file mode 100644 index 0000000..d305a8c --- /dev/null +++ b/frontend/src/components/LandingPage/index.tsx @@ -0,0 +1,390 @@ +// ============================================================ +// LandingPage — 官网首页(含登录弹窗) +// 职责:未登录用户的落地页,展示产品介绍并提供登录/注册入口 +// ============================================================ + +import { useCallback, useEffect, useRef, useState } from "react"; +import { LoginModal } from "./LoginModal"; +import "./LandingPage.css"; + +type ModalMode = "login" | "register"; + +export function LandingPage() { + const [modal, setModal] = useState<{ open: boolean; mode: ModalMode }>({ + open: false, + mode: "login", + }); + + const openModal = useCallback((mode: ModalMode) => { + setModal({ open: true, mode }); + }, []); + + const closeModal = useCallback(() => { + setModal((prev) => ({ ...prev, open: false })); + }, []); + + // ---- Scroll Reveal ---- + const observerRef = useRef(null); + + useEffect(() => { + observerRef.current = new IntersectionObserver( + (entries) => { + entries.forEach((entry) => { + if (entry.isIntersecting) { + entry.target.classList.add("lp-visible"); + } + }); + }, + { threshold: 0.1, rootMargin: "0px 0px -40px 0px" } + ); + + document.querySelectorAll(".lp-fade-in").forEach((el) => { + observerRef.current?.observe(el); + }); + + return () => observerRef.current?.disconnect(); + }, []); + + return ( +
+
+ + {/* ========== Top Navigation ========== */} + + + {/* ========== HERO ========== */} +
+
+
+ + XEngineers +
+

+ CamTalk +
+ 给 AI 装上眼睛和耳朵 +

+

+ 多模态实时 AI 视觉对话助手。打开浏览器,对着摄像头说话,AI 实时理解画面和语音,以文字和语音同步回答你。 +

+ +
+ + +
+ + {/* Device Mockup - Double Bezel */} +
+
+
+
+
+
+ + + + +
+
+
+
这道数学题怎么做?
+
+ 这是一道二次方程求解题。观察方程 x² - 5x + 6 = 0,可以使用因式分解法…… +
+ +
+
+
能用求根公式再算一遍吗?
+
+ +
+
+
+
+
+
+
+ + {/* ========== PROBLEM ========== */} +
+
+
+
痛点分析
+

AI 能说会道,却看不到你眼前的世界

+

传统 AI 助手存在三大断层,割裂了自然交流的直觉

+
+
+
+
+ + + +
+

视觉断层

+

用户必须先拍照、保存、上传、再打字描述上下文,AI 才能「看到」画面。四步操作,割裂了自然交流的直觉。

+
+
+
+ + + +
+

交互断层

+

面对外语菜单、数学公式、电路图等复杂内容,打字描述极其低效。用户脑中的问题转不成文字,AI 也就无法作答。

+
+
+
+ + + +
+

成本断层

+

实时视频流 + 大模型推理的组合让 API 成本居高不下。传统方案月成本高达 $5,000,无法面向普通用户商业化。

+
+
+
+
+ + {/* ========== SOLUTION ========== */} +
+
+
+

看 + 听 + 说 = 真正理解你的 AI

+

CamTalk 用一个对话界面闭合所有断层

+
+
+
+ {[ + { icon: "📷", label: "摄像头采集" }, + { icon: "🧠", label: "边缘预处理" }, + { icon: "🔌", label: "WebSocket" }, + { icon: "⚡", label: "Eino 编排" }, + { icon: "👁️", label: "视觉理解" }, + { icon: "💬", label: "流式回复" }, + { icon: "🔊", label: "语音输出" }, + ].map((step, i, arr) => ( +
+
+
{step.icon}
+
{step.label}
+
+ {i < arr.length - 1 &&
} +
+ ))} +
+
+
+
+ + {/* ========== FEATURES ========== */} +
+
+
+
核心亮点
+

五大技术创新

+

从端到端架构到成本控制,每一层都经过精心设计

+
+
+ {[ + { + num: "01", icon: "⚡", + title: "流式并行推送", + desc: "LLM 文本流与 TTS 音频流并行输出。用户先看到文字,紧接着听到语音,感知延迟低于 0.5 秒,接近真人对话节奏。", + }, + { + num: "02", icon: "🧠", + title: "声明式 AI 编排", + desc: "基于 CloudWeGo Eino Graph 的 7 节点 DAG 流水线(STT → History → ChatModel → Splitter → TTS),类型安全、可扩展、易测试。", + }, + { + num: "03", icon: "💰", + title: "端云协同降本", + desc: "浏览器端 VAD 语音检测 + 关键帧像素比较 + 混合采样策略,节省 70% 带宽,月成本从 $5,000 降至 $300,降幅 90%。", + }, + { + num: "04", icon: "🎯", + title: "多场景智能模式", + desc: "5 种 AI 角色(自由对话 / 模拟面试 / 英语老师 / 辩论对手 / 同声翻译)× 3 种视觉模式 × 观察模式,灵活覆盖学习与工作。", + }, + { + num: "05", icon: "🏗️", + title: "生产级工程架构", + desc: "三级存储自动降级(Memory → Redis → PostgreSQL)、JWT 双 token 认证、Docker Compose 一键部署、完善的错误处理与降级策略。", + }, + ].map((f) => ( +
+
{f.num}
+
+ {f.icon} +
+

{f.title}

+

{f.desc}

+
+ ))} +
+
+
+ + {/* ========== USERS ========== */} +
+
+
+

为每一类学习者而设计

+

无论你是在学英语、准备面试,还是想让 AI 帮你看看眼前的世界

+
+
+ {[ + { avatar: "🧑‍🎓", title: "语言学习者", desc: "对着课本或实物,与 AI 英语外教用英语自由对话,实时纠正语法和发音" }, + { avatar: "💼", title: "面试准备者", desc: "开启模拟面试模式,AI 面试官通过摄像头观察你的表情与状态,给出针对性反馈" }, + { avatar: "🌍", title: "跨境交流者", desc: "出国旅行时对着外文菜单、路牌实时翻译,AI 语音播报翻译结果" }, + { avatar: "👁️", title: "视障人士", desc: "AI 实时描述摄像头画面中的环境、障碍物和文字,提供无障碍信息辅助" }, + { avatar: "🔬", title: "学生 / 教师", desc: "对着题目问「怎么做?」,AI 看到画面后逐步讲解,就像身边有一位私教" }, + ].map((u) => ( +
+
{u.avatar}
+

{u.title}

+

{u.desc}

+
+ ))} +
+
+
+ + {/* ========== SCENES ========== */} +
+
+
+

五种模式,覆盖真实需求

+
+
+ {[ + { icon: "💬", title: "自由对话", desc: "对着摄像头随意聊天,AI 实时理解画面并语音回答", tag: "通用" }, + { icon: "🗣️", title: "英语老师", desc: "AI 外教结合摄像头场景进行英语口语教学,实时纠正语法", tag: "学习" }, + { icon: "🎤", title: "模拟面试", desc: "AI 面试官根据你的回答追问,通过摄像头观察你的表现", tag: "求职" }, + { icon: "⚔️", title: "辩论对手", desc: "AI 反驳你的观点,锻炼你的逻辑思维和表达能力", tag: "思维" }, + { icon: "🌐", title: "同声翻译", desc: "实时识别画面中的外语文字并语音翻译,口语化输出", tag: "工具" }, + ].map((s) => ( +
+
{s.icon}
+
+

{s.title}

+
{s.desc}
+
+
+ {s.tag} +
+
+ ))} +
+
+
+ + {/* ========== METRICS ========== */} +
+
+
+

用数据说话

+
+
+ {[ + { value: "< 2s", label: "端到端响应延迟" }, + { value: "90%", label: "API 成本降幅" }, + { value: "70%", label: "带宽节省率" }, + { value: "5+3", label: "场景 × 视觉模式" }, + ].map((m) => ( +
+
{m.value}
+
{m.label}
+
+ ))} +
+
+
+ + {/* ========== TECH STACK ========== */} +
+
+
+

三层系统,生产级质量

+

前端轻量预处理 → Go 网关智能编排 → 云端 AI 按需调用

+
+
+ {[ + { badge: "前端层", tags: ["React 18", "TypeScript", "Vite", "WebRTC VAD", "Canvas 关键帧检测", "WebSocket", "i18n (中/英/日)"] }, + { badge: "网关层", tags: ["Go + Gin", "gorilla/websocket", "Eino Graph", "JWT 双 Token", "Zap 日志", "Viper 配置"] }, + { badge: "存储层", tags: ["L1 Memory", "L2 Redis", "L3 PostgreSQL", "TieredManager 自动降级"] }, + { badge: "AI 服务", tags: ["qwen3-vl-plus (LLM)", "MiMo ASR (STT)", "MiMo TTS", "Docker Compose"] }, + ].map((layer) => ( +
+
+
+ {layer.badge} +
+
+
+ {layer.tags.map((tag) => {tag})} +
+
+ ))} +
+
+
+ + {/* ========== CTA ========== */} +
+
+

让 AI 看见你看见的世界

+

CamTalk,不只是聊天,而是真正的多模态视觉对话。

+ + +
+
+ + {/* ========== Footer ========== */} +
+
+ CamTalk © 2026 XEngineers +
+
+ + {/* ========== Login Modal ========== */} + {modal.open && ( + + )} +
+ ); +}