End User License Agreement
@@ -2464,6 +2763,72 @@
}
}
+ // ---- How-To modal & videos ----
+ // Add videos here as they go live on YouTube:
+ // { title: 'Installing Moxie Desktop on Windows', desc: 'From download to first chat in 5 minutes.', yt: 'VIDEO_ID', duration: '4:32' }
+ // `yt` = the YouTube video ID (the part after watch?v=). For videos hosted
+ // elsewhere use url: 'https://...' instead of yt (opens in a new tab).
+ const HOWTO_VIDEOS = [];
+
+ function renderHowtoVideos() {
+ const grid = document.getElementById('videoGrid');
+ if (!grid) return;
+ if (!HOWTO_VIDEOS.length) {
+ grid.innerHTML = '
' +
+ '
' +
+ '
How-to videos are on the way.
We are recording walkthroughs now — the steps above will get you running in the meantime.
' +
+ '
';
+ return;
+ }
+ grid.innerHTML = HOWTO_VIDEOS.map((v, i) =>
+ '
'
+ ).join('');
+ }
+
+ function playHowtoVideo(card) {
+ const v = HOWTO_VIDEOS[parseInt(card.dataset.index, 10)];
+ if (!v) return;
+ const thumb = card.querySelector('.howto-thumb');
+ if (v.yt && thumb) {
+ // lazy-embed on first click so the page never loads third-party
+ // scripts until the visitor actually asks to watch
+ thumb.innerHTML = '
';
+ } else if (v.url) {
+ window.open(v.url, '_blank', 'noopener');
+ }
+ }
+
+ function openHowtoModal() {
+ document.getElementById('howtoModal').classList.add('active');
+ document.body.style.overflow = 'hidden';
+ }
+ function closeHowtoModal() {
+ document.getElementById('howtoModal').classList.remove('active');
+ // keep the page locked if another modal is still open underneath
+ if (!['downloadModal', 'requirementsModal'].some(id =>
+ document.getElementById(id).classList.contains('active'))) {
+ document.body.style.overflow = '';
+ }
+ }
+ function goToContact() {
+ ['howtoModal', 'downloadModal', 'requirementsModal'].forEach(id =>
+ document.getElementById(id).classList.remove('active'));
+ document.body.style.overflow = '';
+ document.getElementById('contact').scrollIntoView({ behavior: 'smooth' });
+ }
+
function openWhitepaper() {
const modal = document.getElementById('whitepaperModal');
modal.classList.add('active');
@@ -2485,10 +2850,12 @@
document.body.style.overflow = '';
}
- // Escape closes only the topmost modal (requirements sits above download)
+ // Escape closes only the topmost modal
+ // (layering: requirements 110 > how-to 105 > download 100 > whitepaper 100)
document.addEventListener('keydown', (e) => {
if (e.key !== 'Escape') return;
if (document.getElementById('requirementsModal').classList.contains('active')) { closeRequirementsModal(); return; }
+ if (document.getElementById('howtoModal').classList.contains('active')) { closeHowtoModal(); return; }
if (document.getElementById('downloadModal').classList.contains('active')) { closeDownloadModal(); return; }
if (document.getElementById('whitepaperModal').classList.contains('active')) { closeWhitepaper(); }
});
@@ -2634,6 +3001,7 @@
initAuth();
initContactForm();
initCopyButtons();
+ renderHowtoVideos();
});