Add How-To pop-out: setup instructions + video gallery with lazy YouTube embeds

This commit is contained in:
Z User 2026-10-23 22:48:21 +00:00
parent 436f8e8dc1
commit d7dff9e01a

View File

@ -784,6 +784,223 @@
} }
} }
/* HOW-TO / INSTRUCTIONS MODAL */
.howto-steps {
display: flex;
flex-direction: column;
gap: 0.75rem;
margin-bottom: 1.75rem;
}
.howto-step {
display: flex;
gap: 0.9rem;
align-items: flex-start;
padding: 0.9rem 1.1rem;
background: rgba(15, 23, 42, 0.6);
border: 1px solid rgba(148, 163, 184, 0.1);
border-radius: 1.25rem;
}
.howto-step-num {
width: 30px;
height: 30px;
flex-shrink: 0;
border-radius: 50%;
background: rgba(52, 211, 153, 0.12);
border: 1px solid rgba(52, 211, 153, 0.35);
color: #6ee7b7;
font-weight: 700;
font-size: 0.85rem;
display: flex;
align-items: center;
justify-content: center;
}
.howto-step-title {
font-weight: 600;
color: #f8fafc;
font-size: 0.92rem;
margin-bottom: 2px;
}
.howto-step-text {
color: #94a3b8;
font-size: 0.8rem;
line-height: 1.55;
}
.howto-step-text a,
.howto-inline-link {
color: #34d399;
font-weight: 600;
text-decoration: none;
border-bottom: 1px dotted rgba(52, 211, 153, 0.5);
cursor: pointer;
}
.howto-step-text a:hover,
.howto-inline-link:hover {
color: #6ee7b7;
}
.howto-section-title {
font-family: 'Space Grotesk', sans-serif;
font-size: 1.15rem;
font-weight: 600;
color: #f8fafc;
margin: 0 0 0.9rem;
}
.howto-video-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.875rem;
}
.howto-video-card {
text-align: left;
background: rgba(15, 23, 42, 0.6);
border: 1px solid rgba(148, 163, 184, 0.12);
border-radius: 1.25rem;
overflow: hidden;
cursor: pointer;
transition: all 200ms ease;
padding: 0;
font-family: inherit;
display: flex;
flex-direction: column;
}
.howto-video-card:hover {
border-color: rgba(52, 211, 153, 0.4);
transform: translateY(-2px);
}
.howto-thumb {
position: relative;
display: block;
aspect-ratio: 16 / 9;
background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
width: 100%;
}
.howto-thumb img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.howto-thumb iframe {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
border: 0;
}
.howto-play {
position: absolute;
inset: 0;
margin: auto;
width: 52px;
height: 52px;
border-radius: 50%;
background: rgba(52, 211, 153, 0.9);
color: #020617;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
transition: all 200ms ease;
}
.howto-video-card:hover .howto-play {
background: #6ee7b7;
transform: scale(1.06);
}
.howto-play svg {
width: 22px;
height: 22px;
margin-left: 3px;
}
.howto-duration {
position: absolute;
right: 8px;
bottom: 8px;
background: rgba(2, 6, 23, 0.85);
color: #e2e8f0;
font-size: 0.68rem;
font-weight: 600;
padding: 0.2em 0.55em;
border-radius: 0.5rem;
}
.howto-video-info {
padding: 0.85rem 1rem 1rem;
}
.howto-video-title {
display: block;
font-weight: 600;
color: #f8fafc;
font-size: 0.88rem;
line-height: 1.35;
}
.howto-video-desc {
display: block;
color: #64748b;
font-size: 0.75rem;
line-height: 1.5;
margin-top: 3px;
}
.howto-empty {
grid-column: 1 / -1;
text-align: center;
padding: 2rem 1rem;
border: 1px dashed rgba(148, 163, 184, 0.25);
border-radius: 1.25rem;
color: #94a3b8;
font-size: 0.85rem;
line-height: 1.6;
}
.howto-empty svg {
width: 34px;
height: 34px;
color: #34d399;
margin-bottom: 0.5rem;
}
.howto-empty strong {
color: #e2e8f0;
}
.howto-footer-strip {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0.35rem 0.9rem;
margin-top: 1.5rem;
font-size: 0.78rem;
color: #94a3b8;
padding: 0.65rem 1rem;
background: rgba(148, 163, 184, 0.06);
border: 1px solid rgba(148, 163, 184, 0.1);
border-radius: 0.9rem;
}
@media (max-width: 640px) {
.howto-video-grid {
grid-template-columns: 1fr;
}
}
.dl-eula-divider { .dl-eula-divider {
border: none; border: none;
border-top: 1px solid rgba(148, 163, 184, 0.15); border-top: 1px solid rgba(148, 163, 184, 0.15);
@ -1027,6 +1244,14 @@
</svg> </svg>
Whitepaper Whitepaper
</button> </button>
<button onclick="openHowtoModal()" class="hover:text-emerald-400 flex items-center gap-1.5">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="10" stroke-width="2" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 8l6 4-6 4V8z">
</path>
</svg>
How-To
</button>
<button onclick="openDownloadModal()" class="hover:text-emerald-400 flex items-center gap-1.5"> <button onclick="openDownloadModal()" class="hover:text-emerald-400 flex items-center gap-1.5">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
@ -1380,6 +1605,76 @@
</div> </div>
</div> </div>
<!-- HOW-TO / INSTRUCTIONS MODAL -->
<div id="howtoModal" class="dl-modal-overlay" style="z-index:105;" onclick="if(event.target===this)closeHowtoModal()">
<div class="dl-modal-card" style="max-width: 760px;">
<div class="dl-modal-header">
<div>
<h2
style="font-family:'Space Grotesk',sans-serif; font-size:1.65rem; font-weight:600; color:#f8fafc; margin:0; line-height:1.3;">
Instructions &amp; how-to videos</h2>
<p style="color:#6ee7b7; font-size:0.9rem; margin-top:0.4rem;">Everything you need to get Moxie
running on your machine.</p>
</div>
<button class="dl-modal-close" onclick="closeHowtoModal()" aria-label="Close">&times;</button>
</div>
<div class="dl-modal-body">
<h3 class="howto-section-title">Get started in four steps</h3>
<div class="howto-steps">
<div class="howto-step">
<span class="howto-step-num">1</span>
<div>
<div class="howto-step-title">Pick your edition</div>
<div class="howto-step-text"><strong>Moxie Desktop</strong> for the full experience — 32 GB
RAM and an NVIDIA RTX 3060 or newer for the multimedia section. <strong>Moxie-Lite</strong>
if you have 16 GB RAM and no GPU — the same app without multimedia.
<a onclick="openRequirementsModal()">Compare system requirements</a></div>
</div>
</div>
<div class="howto-step">
<span class="howto-step-num">2</span>
<div>
<div class="howto-step-title">Download &amp; install</div>
<div class="howto-step-text">Open the <a
onclick="closeHowtoModal(); openDownloadModal();">downloads</a> and grab the
installer for your platform. Run it and follow the prompts — you'll be set up in a
couple of minutes.</div>
</div>
</div>
<div class="howto-step">
<span class="howto-step-num">3</span>
<div>
<div class="howto-step-title">Launch and start chatting</div>
<div class="howto-step-text">Moxie runs locally from the start — lightweight tasks are
handled on-device, and only the heavy ones are offloaded to Moxie-Server. Your data
never leaves your machine.</div>
</div>
</div>
<div class="howto-step">
<span class="howto-step-num">4</span>
<div>
<div class="howto-step-title">Go further</div>
<div class="howto-step-text">On Desktop, the multimedia section generates image &amp; video
— up to 720p on an 8 GB VRAM card, 1080p with a recommended 12 GB. On Moxie-Lite,
everything else works identically.</div>
</div>
</div>
</div>
<h3 class="howto-section-title">How-to videos</h3>
<div id="videoGrid" class="howto-video-grid"></div>
<div class="howto-footer-strip">
<span>Ready to install?</span>
<a class="dl-req-link" onclick="closeHowtoModal(); openDownloadModal();">Open the downloads</a>
<span style="opacity:0.4;">&bull;</span>
<span>Stuck?</span>
<a class="dl-req-link" onclick="goToContact()">Ask us a question</a>
<span style="opacity:0.4;">&bull;</span>
<span>We usually reply within one business day.</span>
</div>
</div>
</div>
</div>
<!-- SYSTEM REQUIREMENTS MODAL --> <!-- SYSTEM REQUIREMENTS MODAL -->
<div id="requirementsModal" class="dl-modal-overlay" style="z-index:110;" onclick="if(event.target===this)closeRequirementsModal()"> <div id="requirementsModal" class="dl-modal-overlay" style="z-index:110;" onclick="if(event.target===this)closeRequirementsModal()">
<div class="dl-modal-card" style="max-width: 640px;"> <div class="dl-modal-card" style="max-width: 640px;">
@ -1561,6 +1856,10 @@
<button class="dl-platform-btn coming-soon">Coming Soon</button> <button class="dl-platform-btn coming-soon">Coming Soon</button>
</div> </div>
</div> </div>
<div class="dl-req-strip" style="justify-content:space-between;">
<span>New to Moxie? Follow the setup instructions &amp; watch the how-to videos</span>
<a class="dl-req-link" onclick="openHowtoModal()">Open How-To</a>
</div>
<hr class="dl-eula-divider"> <hr class="dl-eula-divider">
<div class="dl-eula"> <div class="dl-eula">
<h2>End User License Agreement</h2> <h2>End User License Agreement</h2>
@ -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 = '<div class="howto-empty">' +
'<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"></path></svg>' +
'<div><strong>How-to videos are on the way.</strong><br>We are recording walkthroughs now &mdash; the steps above will get you running in the meantime.</div>' +
'</div>';
return;
}
grid.innerHTML = HOWTO_VIDEOS.map((v, i) =>
'<button type="button" class="howto-video-card" data-index="' + i + '" onclick="playHowtoVideo(this)">' +
'<span class="howto-thumb">' +
(v.yt ? '<img src="https://i.ytimg.com/vi/' + v.yt + '/hqdefault.jpg" alt="" loading="lazy">' : '') +
'<span class="howto-play"><svg fill="currentColor" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg></span>' +
(v.duration ? '<span class="howto-duration">' + v.duration + '</span>' : '') +
'</span>' +
'<span class="howto-video-info">' +
'<span class="howto-video-title">' + v.title + '</span>' +
(v.desc ? '<span class="howto-video-desc">' + v.desc + '</span>' : '') +
'</span>' +
'</button>'
).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 = '<iframe src="https://www.youtube-nocookie.com/embed/' + v.yt +
'?autoplay=1&rel=0" title="' + v.title.replace(/"/g, '&quot;') +
'" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
} 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() { function openWhitepaper() {
const modal = document.getElementById('whitepaperModal'); const modal = document.getElementById('whitepaperModal');
modal.classList.add('active'); modal.classList.add('active');
@ -2485,10 +2850,12 @@
document.body.style.overflow = ''; 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) => { document.addEventListener('keydown', (e) => {
if (e.key !== 'Escape') return; if (e.key !== 'Escape') return;
if (document.getElementById('requirementsModal').classList.contains('active')) { closeRequirementsModal(); 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('downloadModal').classList.contains('active')) { closeDownloadModal(); return; }
if (document.getElementById('whitepaperModal').classList.contains('active')) { closeWhitepaper(); } if (document.getElementById('whitepaperModal').classList.contains('active')) { closeWhitepaper(); }
}); });
@ -2634,6 +3001,7 @@
initAuth(); initAuth();
initContactForm(); initContactForm();
initCopyButtons(); initCopyButtons();
renderHowtoVideos();
}); });
</script> </script>
<script src="js/config.js"></script> <script src="js/config.js"></script>