// Tweaks panel for the Asmae landing page
const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
"theme": "warm",
"heroCalligraphy": "سلام",
"animationIntensity": "bold",
"ctaText": "Start the Course",
"headline": "Speak Arabic with confidence — in 90 days.",
"showVideo": true,
"showAbout": true,
"showCurriculum": true,
"showSampler": true,
"showPricing": true,
"showTestimonials": true,
"showFAQ": true
}/*EDITMODE-END*/;
function App() {
const [tweaks, setTweak] = window.useTweaks(TWEAK_DEFAULTS);
// Apply theme
React.useEffect(() => {
document.documentElement.setAttribute('data-theme', tweaks.theme);
}, [tweaks.theme]);
// Apply hero calligraphy
React.useEffect(() => {
if (window.setHeroCalligraphy) window.setHeroCalligraphy(tweaks.heroCalligraphy);
}, [tweaks.heroCalligraphy]);
// Animation intensity
React.useEffect(() => {
if (window.setAnimationIntensity) window.setAnimationIntensity(tweaks.animationIntensity);
}, [tweaks.animationIntensity]);
// Headline copy
React.useEffect(() => {
const h1 = document.getElementById('hero-headline');
if (!h1) return;
// Split last 2 words into accent
const words = tweaks.headline.split(' ');
if (words.length >= 3) {
const accent = words.slice(-3).join(' ');
const main = words.slice(0, -3).join(' ');
h1.innerHTML = `${main}
${accent}`;
} else {
h1.textContent = tweaks.headline;
}
}, [tweaks.headline]);
// CTA text
React.useEffect(() => {
const c = document.getElementById('cta-text');
if (c) c.textContent = tweaks.ctaText;
}, [tweaks.ctaText]);
// Section visibility
React.useEffect(() => {
const map = {
showVideo: '#video',
showAbout: '#about',
showCurriculum: '#curriculum',
showSampler: '#sampler',
showPricing: '#pricing',
showFAQ: '#faq'
};
Object.entries(map).forEach(([k, sel]) => {
const el = document.querySelector(sel);
if (el) el.style.display = tweaks[k] ? '' : 'none';
});
}, [tweaks.showVideo, tweaks.showAbout, tweaks.showCurriculum, tweaks.showSampler, tweaks.showPricing, tweaks.showFAQ]);
const T = window.TweaksPanel;
const TS = window.TweakSection;
const TR = window.TweakRadio;
const TT = window.TweakText;
return (
setTweak('theme', v)}
/>
setTweak('heroCalligraphy', v)}
/>
setTweak('animationIntensity', v)}
/>
setTweak('headline', v)} multiline />
setTweak('ctaText', v)} />
{[
['showVideo', 'Video preview'],
['showAbout', 'About Asmae'],
['showCurriculum', 'Curriculum'],
['showSampler', 'Phrases sampler'],
['showPricing', 'Pricing'],
['showFAQ', 'FAQ']
].map(([k, label]) => (
setTweak(k, v)} />
))}
);
}
const root = document.createElement('div');
document.body.appendChild(root);
ReactDOM.createRoot(root).render();