// Tela: Landing page
const { useState: useStateLanding, useEffect: useEffectLanding } = React;
function Landing({ t, lang, setLang, onStart, onSignIn }) {
const [scrolled, setScrolled] = useStateLanding(false);
useEffectLanding(() => {
const el = document.querySelector('.mv-landing-scroll');
if (!el) return;
const onScroll = () => setScrolled(el.scrollTop > 12);
el.addEventListener('scroll', onScroll);
return () => el.removeEventListener('scroll', onScroll);
}, []);
return (
{t.landing_eyebrow}
{t.landing_title}
{t.landing_sub}
{t.pricing_trial} · No credit card required.
{t.pricing_title}
{t.plan_monthly}
{t.plan_monthly_price}{t.plan_per_month}
{t.plan_best}
{t.plan_yearly}
{t.plan_yearly_price}{t.plan_per_year}
{t.plan_yearly_equiv}
{t.pricing_trial} · No credit card required.
- {t.pricing_b1}
- {t.pricing_b2}
- {t.pricing_b3}
- {t.pricing_b4}
);
}
function ShareDemo({ lang, t }) {
const [shared, setShared] = useStateLanding(false);
const shareUrl = 'https://mywisdomverse.online';
const verse = {
en: { text: '"I can do all things through Christ who strengthens me."', ref: 'Philippians 4:13' },
pt: { text: '"Tudo posso naquele que me fortalece."', ref: 'Filipenses 4:13' },
es: { text: '"Todo lo puedo en Cristo que me fortalece."', ref: 'Filipenses 4:13' },
}[lang] || { text: '"I can do all things through Christ who strengthens me."', ref: 'Philippians 4:13' };
const labels = {
eyebrow: { en: 'Spread the Word', pt: 'Espalhe a Palavra', es: 'Comparte la Palabra' },
title: { en: "Share a verse. Change someone's day.", pt: 'Compartilhe um versículo. Mude o dia de alguém.', es: 'Comparte un versículo. Cambia el día de alguien.' },
desc: { en: 'Every verse you share is an invitation. One tap sends the Word — and a link so your friend can start their own daily journey.', pt: 'Cada versículo que você compartilha é um convite. Um toque envia a Palavra — e um link para que seu amigo comece sua própria jornada diária.', es: 'Cada versículo que compartes es una invitación. Un toque envía la Palabra — y un enlace para que tu amigo comience su propio camino diario.' },
btn: { en: 'Share this verse', pt: 'Compartilhar este versículo', es: 'Compartir este versículo' },
shared: { en: 'Copied!', pt: 'Copiado!', es: 'Copiado!' },
sharedMobile: { en: 'Shared!', pt: 'Compartilhado!', es: 'Compartido!' },
caption: { en: 'Works on WhatsApp, iMessage, Instagram and more', pt: 'Funciona no WhatsApp, iMessage, Instagram e mais', es: 'Funciona en WhatsApp, iMessage, Instagram y más' },
};
const l = (key) => labels[key][lang] || labels[key].en;
const callToAction = {
en: '✨ Get your daily Bible verse — free for 7 days',
pt: '✨ Receba seu versículo diário — 7 dias grátis',
es: '✨ Recibe tu versículo diario — 7 días gratis',
}[lang] || '✨ Get your daily Bible verse — free for 7 days';
// Gera imagem do cartão como Blob
function generateImageBlob() {
return new Promise((resolve) => {
const c = document.createElement('canvas');
c.width = 1080; c.height = 1080;
const ctx = c.getContext('2d');
const g = ctx.createRadialGradient(540, 380, 100, 540, 540, 800);
g.addColorStop(0, '#fbf3df'); g.addColorStop(0.6, '#f1e3c0'); g.addColorStop(1, '#d8bd86');
ctx.fillStyle = g; ctx.fillRect(0, 0, 1080, 1080);
ctx.strokeStyle = 'rgba(122,90,48,0.3)'; ctx.lineWidth = 2;
ctx.strokeRect(60, 60, 960, 960);
ctx.fillStyle = '#7a5a30'; ctx.font = '64px serif'; ctx.textAlign = 'center';
ctx.fillText('✧', 540, 200);
ctx.fillStyle = '#3a2c14';
ctx.font = 'italic 44px "Cormorant Garamond", serif';
const words = verse.text.split(' ');
let line = '', y = 420;
for (const w of words) {
const test = line + w + ' ';
if (ctx.measureText(test).width > 880 && line) {
ctx.fillText(line.trim(), 540, y); y += 60; line = w + ' ';
} else { line = test; }
}
if (line) ctx.fillText(line.trim(), 540, y);
ctx.font = '500 26px "Inter", sans-serif';
ctx.fillStyle = '#7a5a30';
ctx.fillText(verse.ref.toUpperCase(), 540, y + 80);
ctx.strokeStyle = 'rgba(122,90,48,0.35)'; ctx.lineWidth = 1;
ctx.beginPath(); ctx.moveTo(200, y + 120); ctx.lineTo(880, y + 120); ctx.stroke();
ctx.font = '500 20px "Inter", sans-serif';
ctx.fillStyle = 'rgba(122,90,48,0.6)';
ctx.fillText('My Verse', 540, y + 170);
c.toBlob(resolve, 'image/png');
});
}
// Copia texto como fallback desktop
function copyToClipboard() {
const text = `${verse.text} — ${verse.ref}\n\n${callToAction}\n${shareUrl}`;
try {
if (navigator.clipboard) {
navigator.clipboard.writeText(text).catch(() => {});
} else {
const ta = document.createElement('textarea');
ta.value = text;
ta.style.position = 'fixed';
ta.style.opacity = '0';
document.body.appendChild(ta);
ta.select();
document.execCommand('copy');
document.body.removeChild(ta);
}
} catch(e) {}
setShared(true);
setTimeout(() => setShared(false), 2500);
}
async function handleShare() {
const isMobile = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
if (isMobile && navigator.share) {
try {
const blob = await generateImageBlob();
const file = new File([blob], 'myverse.png', { type: 'image/png' });
const shareData = { title: 'My Verse', text: callToAction, url: shareUrl };
if (navigator.canShare && navigator.canShare({ files: [file] })) {
await navigator.share({ ...shareData, files: [file] });
} else {
await navigator.share(shareData);
}
setShared(true);
setTimeout(() => setShared(false), 2500);
} catch (e) {
if (e.name !== 'AbortError') copyToClipboard();
}
} else {
copyToClipboard();
}
}
return (
{l('eyebrow')}
{l('title')}
{l('desc')}
✧
{verse.text}
{verse.ref}
My Verse · mywisdomverse.online
{l('caption')}
);
}
function FeatureCard({ icon, title, desc }) {
return (
);
}
function LangSwitch({ lang, setLang, compact }) {
const opts = [{ k: 'pt', l: 'PT' }, { k: 'en', l: 'EN' }, { k: 'es', l: 'ES' }];
return (
{opts.map(o => (
))}
);
}
Object.assign(window, { Landing, LangSwitch });