682 lines
40 KiB
TypeScript
682 lines
40 KiB
TypeScript
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
import { api, type Photo, type PhotoSlot, type User } from './api';
|
|
import { useI18n } from './i18n/I18nProvider';
|
|
import { FONT_SETS, useTheme } from './theme/ThemeProvider';
|
|
import { AuthModal } from './ui/AuthModal';
|
|
|
|
// Landing page, built to the landing blueprint: the 10-section funnel. The
|
|
// marketing prose is bilingual and lives here next to the markup as `Txt`
|
|
// pairs — the app dictionary holds UI strings, this is a page of copy, and the
|
|
// blueprint stays the source of truth for it. The page follows the same theme
|
|
// and language switches as the workspace (buttons in the nav, top-right).
|
|
// The store URLs are still unknown (WEB_PLAN.md W6), so the store badges raise
|
|
// the toast instead of navigating; fill STORE_LINKS in and drop the onClick.
|
|
const STORE_LINKS = { play: '#', appstore: '#' };
|
|
|
|
type Txt = { en: string; vi: string };
|
|
|
|
const SAMPLE = (n: number) => `/assets/samples/s${n}.jpg`;
|
|
|
|
interface Look {
|
|
tag: string;
|
|
title: Txt;
|
|
meta: string;
|
|
photo: string;
|
|
filter: string;
|
|
}
|
|
|
|
// 35mm reel: eight looks over six sample negatives, each with its own CSS
|
|
// emulation. ponytail: CSS filters, not the CanvasKit pipeline — a landing page
|
|
// does not need a 12MP render; swap in real graded stills when we have them.
|
|
const REEL: Look[] = [
|
|
{ tag: '#KODAK_PORTRA_400', title: { en: 'Golden Hour Portrait', vi: 'Chân dung giờ vàng' }, meta: 'ISO 400 · GRAIN 35 · WARMTH +18', photo: SAMPLE(1015), filter: 'sepia(.16) saturate(1.18) contrast(1.04) brightness(1.04)' },
|
|
{ tag: '#FUJI_CLASSIC_CHROME', title: { en: 'Quiet Street, 7am', vi: 'Phố vắng, 7 giờ sáng' }, meta: 'ISO 200 · GRAIN 20 · WARMTH -6', photo: SAMPLE(1025), filter: 'saturate(.78) contrast(1.14) hue-rotate(-6deg)' },
|
|
{ tag: '#CYBER_NEON_88', title: { en: 'Neon Crossing', vi: 'Ngã tư neon' }, meta: 'ISO 1600 · GRAIN 45 · WARMTH +4', photo: SAMPLE(1035), filter: 'saturate(1.7) contrast(1.25) hue-rotate(268deg)' },
|
|
{ tag: '#CINESTILL_800T', title: { en: 'Harbour Tungsten', vi: 'Cảng đèn vàng' }, meta: 'ISO 800 · GRAIN 40 · WARMTH -14', photo: SAMPLE(1043), filter: 'saturate(1.1) contrast(1.1) hue-rotate(186deg) brightness(.96)' },
|
|
{ tag: '#ILFORD_HP5_BW', title: { en: 'Alley Study', vi: 'Hẻm nhỏ' }, meta: 'ISO 400 · GRAIN 55 · MONO', photo: SAMPLE(1050), filter: 'grayscale(1) contrast(1.35) brightness(1.02)' },
|
|
{ tag: '#VELVIA_50', title: { en: 'Ridge Line', vi: 'Sống núi' }, meta: 'ISO 50 · GRAIN 12 · WARMTH +6', photo: SAMPLE(1069), filter: 'saturate(1.55) contrast(1.22)' },
|
|
{ tag: '#ACROS_100', title: { en: 'Stone Facade', vi: 'Mặt tường đá' }, meta: 'ISO 100 · GRAIN 30 · MONO', photo: SAMPLE(1025), filter: 'grayscale(1) contrast(1.18) brightness(1.06)' },
|
|
{ tag: '#ETRNA_VINTAGE', title: { en: 'Faded Postcard', vi: 'Bưu thiếp bạc màu' }, meta: 'ISO 200 · GRAIN 25 · WARMTH +10', photo: SAMPLE(1015), filter: 'sepia(.28) saturate(.9) contrast(.94) brightness(1.08)' },
|
|
];
|
|
|
|
interface Preset {
|
|
id: string;
|
|
// Stock and recipe names are proper nouns — never translated (see i18n/vi.ts).
|
|
label: string;
|
|
name: string;
|
|
desc: Txt;
|
|
filter: string;
|
|
// warmth, grain, contrast, halation bloom — 0..100
|
|
metrics: [number, number, number, number];
|
|
}
|
|
|
|
const PRESETS: Preset[] = [
|
|
{ id: 'portra', label: 'Kodak Portra 400', name: 'PORTRA 400', desc: { en: 'Warm daylight stock, forgiving highlights and natural skin tones — the everyday portrait recipe.', vi: 'Phim chân dung ánh sáng ban ngày ấm, vùng sáng mềm và tông da tự nhiên — công thức chụp hằng ngày.' }, filter: 'sepia(.18) saturate(1.15) contrast(1.03) brightness(1.05)', metrics: [72, 34, 48, 22] },
|
|
{ id: 'chrome', label: 'Fuji Classic Chrome', name: 'CLASSIC CHROME', desc: { en: 'Deep greens, muted reds and a documentary edge straight out of the rangefinder era.', vi: 'Xanh lá sâu, đỏ trầm và chất tài liệu đúng kiểu máy rangefinder.' }, filter: 'saturate(.76) contrast(1.16) hue-rotate(-8deg)', metrics: [38, 22, 68, 14] },
|
|
{ id: 'sunset', label: 'Warm Sunset Glow', name: 'SUNSET GLOW', desc: { en: 'Amber backlight with a soft halation around every highlight, made for late golden hour.', vi: 'Ngược sáng hổ phách với quầng sáng mềm quanh vùng cháy, dành cho giờ vàng muộn.' }, filter: 'sepia(.34) saturate(1.35) contrast(1.06) brightness(1.06)', metrics: [88, 28, 52, 61] },
|
|
{ id: 'cyber', label: "Cyber Neon '88", name: 'CYBER NEON 88', desc: { en: 'Magenta and cyan push, crushed blacks and a bloom that reads like wet asphalt at night.', vi: 'Đẩy magenta và cyan, đen bị nén và quầng sáng như nhựa đường ướt ban đêm.' }, filter: 'saturate(1.8) contrast(1.3) hue-rotate(266deg)', metrics: [24, 46, 84, 78] },
|
|
{ id: 'mono', label: 'Monochromatic Film', name: 'ACROS 100', desc: { en: 'High-contrast black and white with a fine grain structure and clean mid-tone separation.', vi: 'Đen trắng tương phản cao, hạt mịn và vùng trung tính tách bạch.' }, filter: 'grayscale(1) contrast(1.4) brightness(1.02)', metrics: [6, 41, 92, 18] },
|
|
];
|
|
|
|
const BAR_LABELS: Txt[] = [
|
|
{ en: 'WARMTH', vi: 'ĐỘ ẤM' },
|
|
{ en: 'FILM GRAIN', vi: 'HẠT PHIM' },
|
|
{ en: 'CONTRAST', vi: 'TƯƠNG PHẢN' },
|
|
{ en: 'HALATION BLOOM', vi: 'QUẦNG SÁNG' },
|
|
];
|
|
|
|
interface Feature { icon: 'aperture' | 'grain' | 'batch' | 'qr' | 'hsl' | 'raw'; title: Txt; text: Txt }
|
|
const FEATURES: Feature[] = [
|
|
{ icon: 'aperture', title: { en: 'Live LUT Viewfinder', vi: 'Ngắm LUT trực tiếp' }, text: { en: 'See the recipe through the lens before you press the shutter — no round trip to an editor.', vi: 'Xem công thức ngay trong ống kính trước khi bấm máy — không cần vòng qua trình chỉnh sửa.' } },
|
|
{ icon: 'grain', title: { en: '35mm & 120 Film Grain', vi: 'Hạt phim 35mm & 120' }, text: { en: 'Authentic grain structures plus halation bloom, tuned per stock rather than one global overlay.', vi: 'Cấu trúc hạt đúng chất phim kèm quầng sáng, tinh chỉnh theo từng loại phim thay vì một lớp phủ chung.' } },
|
|
{ icon: 'batch', title: { en: 'Batch Color Editing', vi: 'Chỉnh màu hàng loạt' }, text: { en: 'Apply one recipe across hundreds of photos at once and export the whole set in a single pass.', vi: 'Áp một công thức cho hàng trăm ảnh cùng lúc và xuất cả bộ trong một lượt.' } },
|
|
{ icon: 'qr', title: { en: 'QR Recipe Sharing', vi: 'Chia sẻ công thức bằng QR' }, text: { en: 'Export a recipe as a scannable card and let a friend import the exact look in one scan.', vi: 'Xuất công thức thành thẻ quét được để bạn bè nhập đúng tông màu chỉ bằng một lần quét.' } },
|
|
{ icon: 'hsl', title: { en: 'HSL & Selective Color', vi: 'HSL & màu chọn lọc' }, text: { en: 'Fine-tune eight individual colour channels when a stock needs a nudge, not a replacement.', vi: 'Tinh chỉnh tám kênh màu riêng khi loại phim chỉ cần nhích một chút, không phải thay hẳn.' } },
|
|
{ icon: 'raw', title: { en: 'RAW Support & 4K Export', vi: 'Hỗ trợ RAW & xuất 4K' }, text: { en: 'Full EXIF retention, 300 ppi print metadata and lossless JPEG at up to 4K.', vi: 'Giữ nguyên EXIF, metadata in 300 ppi và JPEG không mất dữ liệu tới 4K.' } },
|
|
];
|
|
|
|
const QUOTES = [
|
|
{ text: { en: 'I grade a whole trip before the flight lands. The QR hand-off means my editor gets the exact same look, not a screenshot.', vi: 'Tôi chỉnh màu cả chuyến đi trước khi máy bay hạ cánh. Chia sẻ bằng QR nên editor nhận đúng tông màu, không phải ảnh chụp màn hình.' }, name: 'Mai Anh', role: { en: '@maianh.travel · Travel Blogger', vi: '@maianh.travel · Blogger du lịch' } },
|
|
{ text: { en: 'Classic Chrome with a whisper of grain is 90% of my feed now. It reads like film without the scanning workflow.', vi: 'Classic Chrome thêm một chút hạt phim giờ chiếm 90% feed của tôi. Nhìn ra chất phim mà không phải scan.' }, name: 'Daniel Rowe', role: { en: '@rowe.frames · Street Photographer', vi: '@rowe.frames · Nhiếp ảnh đường phố' } },
|
|
{ text: { en: 'The live viewfinder is the whole trick — clients pick a recipe on set instead of asking for fifteen revisions later.', vi: 'Ngắm trực tiếp là điểm ăn tiền — khách chọn công thức ngay tại chỗ thay vì đòi sửa mười lăm lần sau đó.' }, name: 'Trúc Lâm', role: { en: '@truclam.studio · Content Creator', vi: '@truclam.studio · Nhà sáng tạo nội dung' } },
|
|
];
|
|
|
|
const FAQ = [
|
|
{ q: { en: 'Does it preserve original image quality?', vi: 'Ảnh gốc có bị giảm chất lượng không?' }, a: { en: 'Yes. The web studio renders from your untouched original at export time, writes 300 ppi JFIF density and keeps the camera EXIF and GPS tags. RAW and 4K export are covered on the Pro plan.', vi: 'Không. Web studio render từ ảnh gốc chưa chỉnh khi xuất, ghi mật độ JFIF 300 ppi và giữ nguyên EXIF cùng dấu GPS của máy ảnh. Xuất RAW và 4K nằm trong gói Pro.' } },
|
|
{ q: { en: 'How do I scan a recipe QR code?', vi: 'Quét mã QR công thức thế nào?' }, a: { en: 'Open the Scan QR button inside the app and point it at the card. The recipe imports with its full parameter set — no manual re-typing.', vi: 'Mở nút Quét QR trong app rồi chĩa vào thẻ. Công thức được nhập kèm toàn bộ thông số — không phải gõ lại tay.' } },
|
|
{ q: { en: 'Is there an export watermark?', vi: 'Ảnh xuất có watermark không?' }, a: { en: 'No watermarks on your own exports. Only the free guest tier on the web adds a small corner mark; sign in and it disappears.', vi: 'Ảnh bạn xuất không có watermark. Chỉ khách chưa đăng nhập trên web mới có một vết nhỏ ở góc; đăng nhập là mất.' } },
|
|
];
|
|
|
|
function Icon({ name }: { name: Feature['icon'] }) {
|
|
const common = { width: 26, height: 26, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.6, strokeLinecap: 'round' as const, strokeLinejoin: 'round' as const };
|
|
switch (name) {
|
|
case 'aperture': return <svg {...common}><circle cx="12" cy="12" r="9" /><circle cx="12" cy="12" r="3.2" /><path d="M12 3v5.5M20 16l-4.8-2.7M4 16l4.8-2.7" /></svg>;
|
|
case 'grain': return <svg {...common}><circle cx="7" cy="7" r="1" /><circle cx="13" cy="6" r="1" /><circle cx="18" cy="9" r="1" /><circle cx="9" cy="13" r="1" /><circle cx="15" cy="14" r="1" /><circle cx="6" cy="18" r="1" /><circle cx="12" cy="19" r="1" /><circle cx="18" cy="17" r="1" /></svg>;
|
|
case 'batch': return <svg {...common}><rect x="3" y="7" width="12" height="12" rx="2" /><path d="M8 4h11a2 2 0 0 1 2 2v11" /></svg>;
|
|
case 'qr': return <svg {...common}><rect x="3" y="3" width="7" height="7" rx="1" /><rect x="14" y="3" width="7" height="7" rx="1" /><rect x="3" y="14" width="7" height="7" rx="1" /><path d="M14 14h3v3h-3zM20 20h1M17 20h1" /></svg>;
|
|
case 'hsl': return <svg {...common}><path d="M12 3a9 9 0 1 0 0 18c1.4 0 2-.9 2-2 0-1.4-1-1.6-1-2.6 0-.9.7-1.4 1.6-1.4H17a4 4 0 0 0 4-4c0-4.4-4-8-9-8Z" /><circle cx="8" cy="12" r="1" /><circle cx="12" cy="8" r="1" /></svg>;
|
|
default: return <svg {...common}><path d="M12 3v11m0 0 4-4m-4 4-4-4" /><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2" /></svg>;
|
|
}
|
|
}
|
|
|
|
export function Landing() {
|
|
const { t, lang, setLang } = useI18n();
|
|
const { mode, fonts, setMode, setFonts } = useTheme();
|
|
const [menu, setMenu] = useState(false);
|
|
const [themeMenu, setThemeMenu] = useState(false);
|
|
const tools = useRef<HTMLSpanElement>(null);
|
|
const [presetId, setPresetId] = useState(PRESETS[0].id);
|
|
const [temp, setTemp] = useState(0);
|
|
const [sat, setSat] = useState(100);
|
|
const [con, setCon] = useState(100);
|
|
const [toast, setToast] = useState<string | null>(null);
|
|
const [qrOk, setQrOk] = useState(true);
|
|
const [user, setUser] = useState<User | null>(null);
|
|
const [photos, setPhotos] = useState<Photo[]>([]);
|
|
// Sign up / log in happens in a dialog on this page, not by a trip to the
|
|
// studio: the visitor keeps their scroll position and lands back on the reel.
|
|
const [auth, setAuth] = useState<'login' | 'signup' | null>(() => {
|
|
const asked = new URLSearchParams(window.location.search).get('auth');
|
|
return asked === 'login' ? 'login' : asked ? 'signup' : null;
|
|
});
|
|
const [uploading, setUploading] = useState(false);
|
|
const filePick = useRef<HTMLInputElement>(null);
|
|
const toastTimer = useRef<ReturnType<typeof setTimeout>>();
|
|
|
|
// Marketing copy, picked by the workspace's language switch.
|
|
const c = useCallback((v: Txt) => v[lang], [lang]);
|
|
|
|
const preset = PRESETS.find((p) => p.id === presetId) ?? PRESETS[0];
|
|
|
|
const showToast = useCallback((text: Txt | string) => {
|
|
setToast(typeof text === 'string' ? text : c(text));
|
|
clearTimeout(toastTimer.current);
|
|
toastTimer.current = setTimeout(() => setToast(null), 3400);
|
|
}, [c]);
|
|
useEffect(() => () => clearTimeout(toastTimer.current), []);
|
|
|
|
// The community half of the reel: whoever is signed in gets a picker, and
|
|
// everybody sees the result on the next load. A guest is sent to sign up.
|
|
const reload = useCallback(() => {
|
|
api.me().then((r) => setUser(r.user)).catch(() => undefined);
|
|
api.listPhotos().then((r) => setPhotos(r.photos)).catch(() => undefined);
|
|
}, []);
|
|
|
|
useEffect(reload, [reload]);
|
|
|
|
const contribute = useCallback(async (file: File) => {
|
|
setUploading(true);
|
|
try {
|
|
const { photo } = await api.uploadPhoto(file);
|
|
setPhotos((prev) => [photo, ...prev]);
|
|
showToast(t('photo.thanks'));
|
|
} catch (err) {
|
|
showToast(t('photo.failed', { msg: err instanceof Error ? err.message : String(err) }));
|
|
} finally {
|
|
setUploading(false);
|
|
}
|
|
}, [showToast, t]);
|
|
|
|
// Contributed stills join the reel after the six built-in looks. Every frame
|
|
// is repeated once, so the marquee's -50% translation still loops seamlessly.
|
|
const reel = useMemo<Look[]>(
|
|
() => [
|
|
...REEL,
|
|
...photos.filter((p) => p.slot === 'strip').map((p) => ({
|
|
tag: '#COMMUNITY',
|
|
title: { en: 'Community Frame', vi: 'Khung cộng đồng' },
|
|
meta: `#${p.id}`,
|
|
photo: api.photoUrl(p.id),
|
|
filter: 'none',
|
|
})),
|
|
],
|
|
[photos],
|
|
);
|
|
|
|
// The three live slots. One random photo out of each set, drawn once per page
|
|
// load so the preview does not change under the visitor's eyes on every
|
|
// render; the built-in sample stands in while a slot has no curation.
|
|
const slotPhoto = useMemo(() => {
|
|
const pick = (slot: PhotoSlot, fallback: string) => {
|
|
const list = photos.filter((p) => p.slot === slot);
|
|
return list.length ? api.photoUrl(list[Math.floor(Math.random() * list.length)].id) : fallback;
|
|
};
|
|
return { tester: pick('tester', SAMPLE(1043)), creator: pick('creator', SAMPLE(1015)), qr: pick('qr', SAMPLE(1069)) };
|
|
}, [photos]);
|
|
|
|
// The theme popover closes on a click anywhere else, like the workspace's.
|
|
useEffect(() => {
|
|
if (!themeMenu) return;
|
|
const away = (e: MouseEvent) => {
|
|
if (!tools.current?.contains(e.target as Node)) setThemeMenu(false);
|
|
};
|
|
document.addEventListener('mousedown', away);
|
|
return () => document.removeEventListener('mousedown', away);
|
|
}, [themeMenu]);
|
|
|
|
// The simulator's output: three knobs, one CSS filter string, applied live.
|
|
const labFilter = `sepia(${(Math.abs(temp) / 260).toFixed(3)}) hue-rotate(${(-temp * 0.45).toFixed(1)}deg) saturate(${sat}%) contrast(${con}%)`;
|
|
|
|
const nav: { href: string; label: Txt }[] = [
|
|
{ href: '#film', label: { en: 'Film Strip', vi: 'Dải phim' } },
|
|
{ href: '#presets', label: { en: 'Try Recipes', vi: 'Thử công thức' } },
|
|
{ href: '#creator', label: { en: 'Custom Recipe Creator', vi: 'Tạo công thức riêng' } },
|
|
{ href: '#features', label: { en: 'Features', vi: 'Tính năng' } },
|
|
{ href: '#qr', label: { en: 'QR Code', vi: 'Mã QR' } },
|
|
{ href: '#pricing', label: { en: 'Pricing', vi: 'Bảng giá' } },
|
|
];
|
|
|
|
const toastDownload: Txt = { en: 'Download links land with the public release — the web studio is live now.', vi: 'Link tải sẽ có khi phát hành chính thức — web studio đã chạy được ngay.' };
|
|
const toastStore: Txt = { en: 'Store listing arrives with the public release — use the web studio in the meantime.', vi: 'Cửa hàng ứng dụng sẽ mở khi phát hành chính thức — trong lúc chờ, hãy dùng web studio.' };
|
|
|
|
return (
|
|
<div className="lp" data-lang={lang}>
|
|
{/* 1 — fixed glass navigation */}
|
|
<nav className="lp-nav">
|
|
<div className="lp-wrap">
|
|
<a className="lp-logo" href="/" onClick={() => setMenu(false)}>
|
|
<img className="lp-logo-mark" src="/assets/RecipesCamIcon.png" alt="" width="30" height="30" />
|
|
{/* One span, not two siblings: .lp-logo is a flex row, so a bare
|
|
text node + <em> would get the 6px gap between them. */}
|
|
<span className="lp-logo-word">Recipes<em>Cam</em></span>
|
|
</a>
|
|
<div className="lp-nav-links">
|
|
{nav.map((entry) => <a key={entry.href} href={entry.href}>{c(entry.label)}</a>)}
|
|
</div>
|
|
<span className="lp-spacer" />
|
|
{/* Theme + language, the same two switches the workspace TopBar has.
|
|
Theme opens a popover: light/dark plus the font group, which
|
|
retypes the whole page. */}
|
|
<span className="lp-tools" ref={tools}>
|
|
<div className="menu-wrap">
|
|
<button
|
|
type="button"
|
|
className="lp-tool"
|
|
title={t('nav.theme')}
|
|
aria-label={t('nav.theme')}
|
|
aria-expanded={themeMenu}
|
|
onClick={() => setThemeMenu((v) => !v)}
|
|
>
|
|
◐
|
|
</button>
|
|
{themeMenu ? (
|
|
<div className="popover lp-theme-pop">
|
|
<div className="chip-row">
|
|
<button
|
|
type="button"
|
|
className={`chip${mode === 'light' ? ' on' : ''}`}
|
|
onClick={() => setMode('light')}
|
|
>
|
|
Light
|
|
</button>
|
|
<button
|
|
type="button"
|
|
className={`chip${mode === 'dark' ? ' on' : ''}`}
|
|
onClick={() => setMode('dark')}
|
|
>
|
|
Dark
|
|
</button>
|
|
</div>
|
|
<div className="chip-row" style={{ marginTop: 8 }}>
|
|
{FONT_SETS.map((entry) => (
|
|
<button
|
|
key={entry.id}
|
|
type="button"
|
|
data-key={`fonts-${entry.id}`}
|
|
title={entry.note}
|
|
className={`chip${fonts === entry.id ? ' on' : ''}`}
|
|
onClick={() => setFonts(entry.id)}
|
|
>
|
|
{entry.label}
|
|
</button>
|
|
))}
|
|
</div>
|
|
</div>
|
|
) : null}
|
|
</div>
|
|
<button
|
|
type="button"
|
|
className="lp-tool"
|
|
title={t('nav.language')}
|
|
aria-label={t('nav.language')}
|
|
onClick={() => setLang(lang === 'vi' ? 'en' : 'vi')}
|
|
>
|
|
{lang.toUpperCase()}
|
|
</button>
|
|
</span>
|
|
{/* Register: the dialog opens here, on the page the visitor is on. */}
|
|
<button type="button" className="lp-btn lp-sm" data-key="nav-signup" onClick={() => setAuth('signup')}>
|
|
{t('nav.signup')}
|
|
</button>
|
|
<button type="button" className="lp-btn lp-sm lp-primary" onClick={() => showToast(toastDownload)}>
|
|
{c({ en: 'Download RecipesCam', vi: 'Tải RecipesCam' })}
|
|
</button>
|
|
<button type="button" className="lp-burger" aria-label="menu" aria-expanded={menu} onClick={() => setMenu((v) => !v)}>
|
|
<i /><i /><i />
|
|
</button>
|
|
</div>
|
|
{menu ? (
|
|
<div className="lp-sheet">
|
|
{nav.map((entry) => <a key={entry.href} href={entry.href} onClick={() => setMenu(false)}>{c(entry.label)}</a>)}
|
|
<a href="/app" onClick={() => setMenu(false)}>{c({ en: 'Open studio', vi: 'Mở studio' })}</a>
|
|
<button
|
|
type="button"
|
|
className="lp-btn"
|
|
data-key="sheet-signup"
|
|
onClick={() => { setMenu(false); setAuth('signup'); }}
|
|
>
|
|
{t('nav.signup')}
|
|
</button>
|
|
<button
|
|
type="button"
|
|
className="lp-btn lp-primary"
|
|
onClick={() => { setMenu(false); showToast(toastDownload); }}
|
|
>
|
|
{c({ en: 'Download RecipesCam', vi: 'Tải RecipesCam' })}
|
|
</button>
|
|
</div>
|
|
) : null}
|
|
</nav>
|
|
|
|
{/* 2 — hero */}
|
|
<header className="lp-hero" id="top">
|
|
<div className="lp-glow" />
|
|
<div className="lp-wrap">
|
|
<span className="lp-badge">{c({ en: '● NEXT-GEN COLOR RECIPES 4.0 — LIVE LUTS', vi: '● CÔNG THỨC MÀU THẾ HỆ MỚI 4.0 — LUT TRỰC TIẾP' })}</span>
|
|
<h1>{c({ en: 'Capture & Grade Photos With Exclusive Color Recipes', vi: 'Chụp & chỉnh màu ảnh bằng công thức màu độc quyền' })}</h1>
|
|
<p className="lp-lede">
|
|
{c({
|
|
en: 'RecipesCam reproduces Kodak and Fuji film colour — tone curves, grain structure and halation — then applies it to your own photos. Same pipeline on the phone and in the browser, no upload, nothing leaves your machine.',
|
|
vi: 'RecipesCam tái tạo màu phim Kodak và Fuji — đường cong tông màu, cấu trúc hạt và quầng sáng — rồi áp lên ảnh của bạn. Cùng một pipeline trên điện thoại và trên trình duyệt, không tải lên, không gì rời khỏi máy bạn.',
|
|
})}
|
|
</p>
|
|
<div className="lp-cta">
|
|
<a className="lp-btn lp-primary" href="/app">{c({ en: 'Open the Web Studio', vi: 'Mở Web Studio' })}</a>
|
|
<a className="lp-btn" href="#presets">{c({ en: 'Try Color Presets', vi: 'Thử công thức màu' })}</a>
|
|
</div>
|
|
<div className="lp-stats">
|
|
<div className="lp-stat"><b>250+</b><span>{c({ en: 'COLOR RECIPES', vi: 'CÔNG THỨC MÀU' })}</span></div>
|
|
<div className="lp-stat"><b>1M+</b><span>{c({ en: 'DOWNLOADS', vi: 'LƯỢT TẢI' })}</span></div>
|
|
<div className="lp-stat"><b>4.9★</b><span>{c({ en: 'STORE RATING', vi: 'ĐIỂM CỬA HÀNG' })}</span></div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
{/* 3 — 35mm film strip marquee */}
|
|
<section className="lp-marquee" id="film" aria-label={c({ en: 'Film strip gallery', vi: 'Dải phim' })}>
|
|
<div className="lp-wrap lp-film-head">
|
|
<div>
|
|
<span className="lp-eyebrow">{c({ en: 'Community film strip', vi: 'Dải phim cộng đồng' })}</span>
|
|
<h2>{c({ en: 'Shoot it, grade it, hang it on the reel', vi: 'Chụp, chỉnh màu, rồi treo lên dải phim' })}</h2>
|
|
<p>{c({ en: 'Signed-in members can add a still of their own to the strip below, seen by everyone who lands here.', vi: 'Thành viên đã đăng nhập có thể thêm một khung ảnh của mình vào dải phim bên dưới, ai ghé trang cũng thấy.' })}</p>
|
|
</div>
|
|
{user ? (
|
|
<button
|
|
type="button"
|
|
className="lp-btn lp-primary"
|
|
data-key="contribute"
|
|
disabled={uploading}
|
|
onClick={() => filePick.current?.click()}
|
|
>
|
|
{uploading ? t('photo.uploading') : t('photo.contribute')}
|
|
</button>
|
|
) : (
|
|
/* A guest gets the same button; it opens the sign-up dialog. */
|
|
<button type="button" className="lp-btn lp-primary" data-key="contribute" onClick={() => setAuth('signup')}>
|
|
{t('photo.contribute')}
|
|
</button>
|
|
)}
|
|
<input
|
|
ref={filePick}
|
|
type="file"
|
|
hidden
|
|
accept="image/jpeg,image/png,image/webp"
|
|
data-key="contribute-input"
|
|
onChange={(e) => {
|
|
const file = e.target.files?.[0];
|
|
e.target.value = '';
|
|
if (file) void contribute(file);
|
|
}}
|
|
/>
|
|
</div>
|
|
<div className="lp-track">
|
|
{[...reel, ...reel].map((look, i) => (
|
|
<article className="lp-frame" key={`${look.tag}-${i}`}>
|
|
<div className="lp-perf" aria-hidden="true">
|
|
<i /><i /><i /><i /><i /><i />
|
|
</div>
|
|
<div className="lp-shot">
|
|
<img src={look.photo} alt={c(look.title)} loading="lazy" style={{ filter: look.filter }} />
|
|
<span className="lp-grain" aria-hidden="true" />
|
|
<span className="lp-tagline">{look.tag}</span>
|
|
</div>
|
|
<div className="lp-frame-meta">
|
|
<b>{c(look.title)}</b>
|
|
<span>{look.meta}</span>
|
|
</div>
|
|
<div className="lp-perf" aria-hidden="true">
|
|
<i /><i /><i /><i /><i /><i />
|
|
</div>
|
|
</article>
|
|
))}
|
|
</div>
|
|
</section>
|
|
|
|
{/* 4 — live preset tester */}
|
|
<section className="lp-sec" id="presets">
|
|
<div className="lp-wrap">
|
|
<div className="lp-sec-head">
|
|
<span className="lp-eyebrow">{c({ en: 'Live preset tester', vi: 'Thử công thức trực tiếp' })}</span>
|
|
<h2>{c({ en: 'Tap a recipe, watch the negative change', vi: 'Chọn công thức, xem âm bản đổi ngay' })}</h2>
|
|
<p>{c({ en: 'Five stocks from the library, applied to the same frame with the same colour maths the exporter uses.', vi: 'Năm loại phim trong thư viện, áp lên cùng một khung với đúng phép màu mà bộ xuất ảnh dùng.' })}</p>
|
|
</div>
|
|
<div className="lp-tester">
|
|
<div>
|
|
<div className="lp-tabs" role="tablist" aria-label={c({ en: 'Color presets', vi: 'Công thức màu' })}>
|
|
{PRESETS.map((p) => (
|
|
<button key={p.id} type="button" role="tab" className="lp-tab" aria-pressed={p.id === presetId} onClick={() => setPresetId(p.id)}>
|
|
{p.label}
|
|
</button>
|
|
))}
|
|
</div>
|
|
<div className="lp-view">
|
|
<img src={slotPhoto.tester} alt={`${preset.name} preview`} style={{ filter: preset.filter }} />
|
|
<div className="lp-hud">
|
|
<span>f/<b>1.8</b></span>
|
|
<span>SS <b>1/500s</b></span>
|
|
<span>ISO <b>200</b></span>
|
|
<span><b>4K</b> ULTRA HD</span>
|
|
<span>{preset.name}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<aside className="lp-specs">
|
|
<span className="lp-eyebrow">{c({ en: 'Recipe specs', vi: 'Thông số công thức' })}</span>
|
|
<h3>{preset.name}</h3>
|
|
<p>{c(preset.desc)}</p>
|
|
<div className="lp-bars">
|
|
{preset.metrics.map((value, i) => (
|
|
<div className="lp-bar" key={BAR_LABELS[i].en}>
|
|
<span>{c(BAR_LABELS[i])}<em className="lp-muted">{value}</em></span>
|
|
<i style={{ ['--v' as string]: `${value}%` }} />
|
|
</div>
|
|
))}
|
|
</div>
|
|
</aside>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* 5 — custom recipe simulator */}
|
|
<section className="lp-sec" id="creator">
|
|
<div className="lp-wrap">
|
|
<div className="lp-sec-head">
|
|
<span className="lp-eyebrow">{c({ en: 'Custom recipe creator', vi: 'Tạo công thức riêng' })}</span>
|
|
<h2>{c({ en: 'Build your own grade in three moves', vi: 'Tự dựng công thức trong ba bước' })}</h2>
|
|
<p>{c({ en: 'Temperature, saturation and contrast, applied to the preview as you drag — the same knobs the studio exposes, minus the render wait.', vi: 'Nhiệt độ, độ bão hoà và tương phản, áp ngay khi bạn kéo — đúng những núm studio có, chỉ bỏ thời gian chờ render.' })}</p>
|
|
</div>
|
|
<div className="lp-lab">
|
|
<div className="lp-view">
|
|
<img src={slotPhoto.creator} alt={c({ en: 'Custom recipe preview', vi: 'Xem trước công thức riêng' })} style={{ filter: labFilter }} />
|
|
<div className="lp-hud"><span>{c({ en: 'CUSTOM RECIPE', vi: 'CÔNG THỨC RIÊNG' })}</span><span>TEMP <b>{temp > 0 ? `+${temp}` : temp}</b></span><span>SAT <b>{sat}%</b></span><span>CON <b>{con}%</b></span></div>
|
|
</div>
|
|
<div className="lp-knobs">
|
|
<div className="lp-knob">
|
|
<label htmlFor="lp-temp">{c({ en: 'TEMPERATURE', vi: 'NHIỆT ĐỘ' })}<b>{temp > 0 ? `+${temp}` : temp}</b></label>
|
|
<input id="lp-temp" type="range" min={-50} max={50} step={1} value={temp} onChange={(e) => setTemp(Number(e.target.value))} />
|
|
</div>
|
|
<div className="lp-knob">
|
|
<label htmlFor="lp-sat">{c({ en: 'SATURATION', vi: 'ĐỘ BÃO HOÀ' })}<b>{sat}%</b></label>
|
|
<input id="lp-sat" type="range" min={0} max={200} step={1} value={sat} onChange={(e) => setSat(Number(e.target.value))} />
|
|
</div>
|
|
<div className="lp-knob">
|
|
<label htmlFor="lp-con">{c({ en: 'CONTRAST', vi: 'TƯƠNG PHẢN' })}<b>{con}%</b></label>
|
|
<input id="lp-con" type="range" min={50} max={180} step={1} value={con} onChange={(e) => setCon(Number(e.target.value))} />
|
|
</div>
|
|
<div className="lp-code">
|
|
<div>RECIPE CUSTOM_01 <b>·</b> 300 ppi <b>·</b> EXIF KEPT</div>
|
|
<div>filter: sepia({(Math.abs(temp) / 260).toFixed(3)}) hue-rotate({(-temp * 0.45).toFixed(1)}deg)</div>
|
|
<div> saturate({sat}%) contrast({con}%)</div>
|
|
<button
|
|
type="button"
|
|
className="lp-btn lp-sm"
|
|
style={{ marginTop: 12 }}
|
|
onClick={() => { setTemp(0); setSat(100); setCon(100); }}
|
|
>
|
|
{c({ en: 'Reset knobs', vi: 'Đặt lại' })}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* 6 — features */}
|
|
<section className="lp-sec" id="features">
|
|
<div className="lp-wrap">
|
|
<div className="lp-sec-head">
|
|
<span className="lp-eyebrow">{c({ en: 'Features', vi: 'Tính năng' })}</span>
|
|
<h2>{c({ en: 'Everything the phone build ships with', vi: 'Mọi thứ bản điện thoại có' })}</h2>
|
|
</div>
|
|
<div className="lp-grid">
|
|
{FEATURES.map((f) => (
|
|
<article className="lp-feat" key={f.title.en}>
|
|
<Icon name={f.icon} />
|
|
<h3>{c(f.title)}</h3>
|
|
<p>{c(f.text)}</p>
|
|
</article>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* 7 — QR recipe sharing */}
|
|
<section className="lp-sec" id="qr">
|
|
<div className="lp-wrap">
|
|
<div className="lp-qr">
|
|
<div className="lp-recipe-card">
|
|
<div className="lp-shot">
|
|
<img src={slotPhoto.qr} alt={c({ en: 'Shared recipe card', vi: 'Thẻ công thức được chia sẻ' })} style={{ filter: PRESETS[2].filter }} />
|
|
<span className="lp-grain" aria-hidden="true" />
|
|
<span className="lp-tagline">#SUNSET_GLOW</span>
|
|
</div>
|
|
<div className="lp-rc-row">
|
|
<div className="lp-rc-qr">
|
|
{qrOk ? (
|
|
<img
|
|
src={`https://api.qrserver.com/v1/create-qr-code/?size=180x180&data=${encodeURIComponent(`${window.location.origin}/app`)}`}
|
|
alt="QR"
|
|
loading="lazy"
|
|
referrerPolicy="no-referrer"
|
|
onError={() => setQrOk(false)}
|
|
/>
|
|
) : null}
|
|
</div>
|
|
<div className="lp-rc-meta">
|
|
<b>SUNSET GLOW</b>
|
|
<span>WARMTH 88 · GRAIN 28 · BLOOM 61</span>
|
|
<span>BY @maianh.travel · 12.4K IMPORTS</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<span className="lp-eyebrow">{c({ en: 'Share by QR', vi: 'Chia sẻ bằng QR' })}</span>
|
|
<h2 style={{ marginTop: 10 }}>{c({ en: 'One scan, byte-identical recipe', vi: 'Quét một lần, công thức y nguyên' })}</h2>
|
|
<div className="lp-steps">
|
|
<div className="lp-step">
|
|
<span>1</span>
|
|
<p>
|
|
<b>{c({ en: 'Export a recipe card.', vi: 'Xuất thẻ công thức.' })}</b>{' '}
|
|
{c({ en: 'The app designs the card — graded thumbnail, parameter readout, author tag — and saves it as an image you can post anywhere.', vi: 'App tự thiết kế thẻ — ảnh thu nhỏ đã chỉnh màu, bảng thông số, tên tác giả — và lưu thành ảnh để bạn đăng ở đâu cũng được.' })}
|
|
</p>
|
|
</div>
|
|
<div className="lp-step">
|
|
<span>2</span>
|
|
<p>
|
|
<b>{c({ en: 'Your friend scans it.', vi: 'Bạn bè quét thẻ.' })}</b>{' '}
|
|
{c({ en: 'The QR opens the recipe in RecipesCam and imports every parameter at once, so the look lands exactly as you built it.', vi: 'Mã QR mở công thức trong RecipesCam và nhập toàn bộ thông số một lần, nên tông màu đúng y như bạn dựng.' })}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* 8 — pricing */}
|
|
<section className="lp-sec" id="pricing">
|
|
<div className="lp-wrap">
|
|
<div className="lp-sec-head">
|
|
<span className="lp-eyebrow">{c({ en: 'Pricing', vi: 'Bảng giá' })}</span>
|
|
<h2>{c({ en: 'Start free. Go Pro when the grain matters.', vi: 'Bắt đầu miễn phí. Lên Pro khi bạn cần hạt phim.' })}</h2>
|
|
</div>
|
|
<div className="lp-price">
|
|
<article className="lp-plan">
|
|
<span className="lp-eyebrow">{c({ en: 'Starter', vi: 'Khởi đầu' })}</span>
|
|
<div className="lp-amount">$0<small>{c({ en: ' / FOREVER', vi: ' / MÃI MÃI' })}</small></div>
|
|
<p className="lp-muted">{c({ en: 'Everything needed to shoot your first roll.', vi: 'Đủ để bạn chụp cuộn phim đầu tiên.' })}</p>
|
|
<ul>
|
|
<li>{c({ en: '15 basic recipes', vi: '15 công thức cơ bản' })}</li>
|
|
<li>{c({ en: 'HD live viewfinder', vi: 'Ngắm trực tiếp HD' })}</li>
|
|
<li>{c({ en: 'Basic grain adjustment', vi: 'Chỉnh hạt phim cơ bản' })}</li>
|
|
<li>{c({ en: '300 ppi JPEG export', vi: 'Xuất JPEG 300 ppi' })}</li>
|
|
</ul>
|
|
<a className="lp-btn" href="/app">{c({ en: 'Open the studio', vi: 'Mở studio' })}</a>
|
|
</article>
|
|
<article className="lp-plan vip">
|
|
<span className="lp-eyebrow">VIP Pro</span>
|
|
<div className="lp-amount">$2.99<small>{c({ en: ' / MONTH', vi: ' / THÁNG' })}</small></div>
|
|
<p className="lp-muted">{c({ en: 'For the people who grade every frame.', vi: 'Dành cho người chỉnh màu từng khung hình.' })}</p>
|
|
<ul>
|
|
<li>{c({ en: '250+ VIP recipes', vi: '250+ công thức VIP' })}</li>
|
|
<li>{c({ en: 'Batch processing', vi: 'Xử lý hàng loạt' })}</li>
|
|
<li>{c({ en: 'Tone curve & HSL tools', vi: 'Công cụ tone curve & HSL' })}</li>
|
|
<li>{c({ en: 'Lossless RAW & 4K export', vi: 'Xuất RAW & 4K không mất dữ liệu' })}</li>
|
|
<li>{c({ en: 'Unlimited QR generation', vi: 'Tạo QR không giới hạn' })}</li>
|
|
</ul>
|
|
<button type="button" className="lp-btn lp-primary" onClick={() => showToast({ en: 'Pro checkout opens with the public release — Starter is free in the web studio today.', vi: 'Thanh toán Pro sẽ mở khi phát hành chính thức — gói Khởi đầu miễn phí ngay trong web studio.' })}>
|
|
{c({ en: 'Go Pro', vi: 'Lên Pro' })}
|
|
</button>
|
|
</article>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* 9 — testimonials + FAQ */}
|
|
<section className="lp-sec">
|
|
<div className="lp-wrap">
|
|
<div className="lp-sec-head">
|
|
<span className="lp-eyebrow">{c({ en: 'Reviews', vi: 'Đánh giá' })}</span>
|
|
<h2>{c({ en: 'Shot on RecipesCam', vi: 'Chụp bằng RecipesCam' })}</h2>
|
|
</div>
|
|
<div className="lp-quotes">
|
|
{QUOTES.map((q) => (
|
|
<article className="lp-quote" key={q.name}>
|
|
<p>“{c(q.text)}”</p>
|
|
<footer><b>{q.name}</b>{c(q.role)}</footer>
|
|
</article>
|
|
))}
|
|
</div>
|
|
<div className="lp-sec-head">
|
|
<span className="lp-eyebrow">FAQ</span>
|
|
<h2>{c({ en: 'Questions we get every week', vi: 'Câu hỏi tuần nào cũng có' })}</h2>
|
|
</div>
|
|
<div className="lp-faq">
|
|
{FAQ.map((item) => (
|
|
<details key={item.q.en}>
|
|
<summary>{c(item.q)}</summary>
|
|
<p>{c(item.a)}</p>
|
|
</details>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* 10 — final CTA + footer */}
|
|
<section className="lp-final" id="download">
|
|
<div className="lp-glow" />
|
|
<div className="lp-wrap">
|
|
<h2>{c({ en: 'Load a recipe. Shoot the rest of the day.', vi: 'Nạp một công thức. Chụp cả ngày còn lại.' })}</h2>
|
|
<p>{c({ en: 'RecipesCam is free on both stores, and the web studio runs right here in your browser.', vi: 'RecipesCam miễn phí trên cả hai cửa hàng, và web studio chạy ngay trong trình duyệt của bạn.' })}</p>
|
|
<div className="lp-stores">
|
|
<button type="button" className="lp-btn" onClick={() => showToast(toastStore)}>
|
|
<span className="lp-store"><small>{c({ en: 'COMING SOON', vi: 'SẮP CÓ' })}</small><b>{c({ en: 'Download on the App Store', vi: 'Tải trên App Store' })}</b></span>
|
|
</button>
|
|
<button type="button" className="lp-btn" onClick={() => showToast(toastStore)}>
|
|
<span className="lp-store"><small>{c({ en: 'COMING SOON', vi: 'SẮP CÓ' })}</small><b>{c({ en: 'Get it on Google Play', vi: 'Tải trên Google Play' })}</b></span>
|
|
</button>
|
|
<a className="lp-btn lp-primary" href="/app">{c({ en: 'Open the Web Studio', vi: 'Mở Web Studio' })}</a>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<footer className="lp-footer">
|
|
<div className="lp-wrap">
|
|
<span>© {new Date().getFullYear()} RecipesCam — {c({ en: 'Color Recipe & Film Camera Studio', vi: 'Studio công thức màu & máy ảnh phim' })}</span>
|
|
<a href="#top">{c({ en: 'Privacy', vi: 'Quyền riêng tư' })}</a>
|
|
<a href="#top">{c({ en: 'Terms', vi: 'Điều khoản' })}</a>
|
|
<a href={STORE_LINKS.play}>{c({ en: 'Support', vi: 'Hỗ trợ' })}</a>
|
|
<span className="lp-social">
|
|
<a href="#top">INSTAGRAM</a>
|
|
<a href="#top">TIKTOK</a>
|
|
<a href="#top">PINTEREST</a>
|
|
</span>
|
|
</div>
|
|
</footer>
|
|
|
|
{auth ? (
|
|
<AuthModal
|
|
initialMode={auth}
|
|
onClose={() => setAuth(null)}
|
|
onDone={() => {
|
|
setAuth(null);
|
|
reload();
|
|
}}
|
|
/>
|
|
) : null}
|
|
|
|
{toast ? <div className="lp-toast" role="status"><b>{c({ en: 'Coming soon —', vi: 'Sắp có —' })}</b> {toast}</div> : null}
|
|
</div>
|
|
);
|
|
}
|