Kaynağa Gözat

feat(web): promo below the hero, new master and muted play fallback (#2303)

* feat(web): add the 40 second promo to the hero

* feat(web): move the promo below the hero and update the master
Nacho 7 saat önce
ebeveyn
işleme
2a1e796beb

+ 100 - 6
web/app.js

@@ -1505,12 +1505,6 @@ function renderShot(i) {
     const lang = (document.documentElement.lang || 'en').slice(0, 2);
     img.src = shotUrl(view);
     img.alt = (SHOT_ALT[view] && SHOT_ALT[view][lang]) || view;
-    // captura del hero: siempre la vista "overview", siguiendo idioma y tema
-    const hero = document.getElementById('heroShot');
-    if (hero) {
-        hero.src = shotUrl('overview');
-        hero.alt = (SHOT_ALT.overview && SHOT_ALT.overview[lang]) || 'NetPulse overview';
-    }
     if (cap)
         cap.textContent = t(`shots.s${shotIndex + 1}`);
     document.querySelectorAll('#shotThumbs .thumb').forEach((th, idx) => {
@@ -1672,6 +1666,105 @@ function initNav() {
             setOpen(false);
     });
 }
+/* ---------- hero: vídeo de 40 s ----------
+   En silencio y en bucle solo mientras se ve; "con sonido" lo reinicia con
+   audio y controles. Con movimiento reducido o ahorro de datos no arranca solo. */
+function initHeroVideo() {
+    const video = document.getElementById('heroVideo');
+    const sound = document.getElementById('heroSound');
+    const playBtn = document.getElementById('heroPlay');
+    if (!video || !sound)
+        return;
+    const saveData = navigator.connection?.saveData;
+    const showPlay = () => { if (playBtn)
+        playBtn.hidden = false; };
+    const hidePlay = () => { if (playBtn)
+        playBtn.hidden = true; };
+    const play = () => {
+        const p = video.play();
+        if (p && typeof p.catch === 'function')
+            p.catch(() => { showPlay(); });
+    };
+    const pause = () => video.pause();
+    video.addEventListener('playing', hidePlay);
+    if (reduceMotion || saveData) {
+        video.loop = false;
+        video.controls = true;
+        hidePlay();
+    }
+    else {
+        // El vídeo vive debajo del hero: precarga al acercarse, no al cargar.
+        if ('IntersectionObserver' in window) {
+            const warm = new IntersectionObserver((entries) => {
+                entries.forEach((e) => {
+                    if (!e.isIntersecting)
+                        return;
+                    warm.disconnect();
+                    if (video.paused && video.preload !== 'auto') {
+                        video.preload = 'auto';
+                        try {
+                            video.load();
+                        }
+                        catch { /* noop */ }
+                    }
+                });
+            }, { rootMargin: '150px 0px' });
+            warm.observe(video);
+        }
+        let inView = false;
+        // Histéresis: arranca al 50% visible y para al 20%, para no parpadear
+        // en el borde. Con sonido no se reanuda solo: manda el usuario.
+        const setState = (ratio) => {
+            if (ratio >= 0.5) {
+                inView = true;
+                if (video.muted) {
+                    play();
+                    // Hay navegadores que ignoran play() en silencio sin rechazar.
+                    window.setTimeout(() => { if (video.muted && video.paused)
+                        showPlay(); }, 1200);
+                }
+            }
+            else if (ratio <= 0.2) {
+                inView = false;
+                pause();
+            }
+        };
+        if ('IntersectionObserver' in window) {
+            new IntersectionObserver((entries) => {
+                entries.forEach((e) => setState(e.isIntersecting ? e.intersectionRatio : 0));
+            }, { threshold: [0, 0.2, 0.5] }).observe(video);
+        }
+        else {
+            inView = true;
+            play();
+        }
+        document.addEventListener('visibilitychange', () => {
+            if (document.visibilityState === 'hidden')
+                pause();
+            else if (inView && video.muted)
+                play();
+        });
+    }
+    sound.addEventListener('click', () => {
+        hidePlay();
+        video.muted = false;
+        video.loop = false;
+        video.controls = true;
+        try {
+            video.currentTime = 0;
+        }
+        catch { /* noop */ }
+        play();
+        video.parentElement?.classList.add('has-sound');
+    });
+    if (playBtn) {
+        playBtn.addEventListener('click', () => {
+            hidePlay();
+            video.muted = true;
+            play();
+        });
+    }
+}
 document.addEventListener('DOMContentLoaded', () => {
     initAppearance();
     initNav();
@@ -1687,4 +1780,5 @@ document.addEventListener('DOMContentLoaded', () => {
     initDemoEvent();
     heroCountUps();
     initGhMeta();
+    initHeroVideo();
 });

BIN
web/assets/netpulse-promo-40s-en.mp4


BIN
web/assets/promo-poster-en.webp


+ 4 - 0
web/build-langs.mjs

@@ -46,7 +46,11 @@ const urlFor = (lang, slug, esSlug) =>
 function fixAssets(html) {
   return html
     .replace(/src="(?!\/|https?:|data:)([^"]*)"/g, 'src="/$1"')
+    .replace(/poster="(?!\/|https?:|data:)([^"]*)"/g, 'poster="/$1"')
     .replace(/href="(?!\/|https?:|data:|#)([^"]*)"/g, 'href="/$1"')
+    // El prerender corre en un viewport ancho y el JS deja el video en
+    // preload="auto". Se guarda metadata y el runtime lo sube en escritorio.
+    .replace(/preload="auto"/g, 'preload="metadata"')
 }
 
 // Sustituye el bloque canonical/hreflang por el de la URL limpia del idioma.

+ 30 - 10
web/i18n.js

@@ -82,7 +82,8 @@ const I18N = {
         hero: {
             eyebrow: 'Live monitoring for your OpenWrt home network',
             t1: 'Your network’s pulse.',
-            t2: 'Real time. No cloud.',
+            t2: 'Real time.',
+            t3: 'No cloud.',
             sub: 'NetPulse watches over OpenWrt routers, maps your topology, scores your network health and alerts you, all from a single self-hosted binary. Nothing leaves your LAN.',
             cta1: 'Install on your network', cta2: 'View on GitHub', cta3: 'Try the live demo',
         },
@@ -264,7 +265,8 @@ const I18N = {
         hero: {
             eyebrow: 'Monitorización en vivo para tu red doméstica OpenWrt',
             t1: 'El pulso de tu red.',
-            t2: 'En tiempo real. Sin nube.',
+            t2: 'En tiempo real.',
+            t3: 'Sin nube.',
             sub: 'NetPulse vigila tus routers OpenWrt, dibuja la topología, puntúa la salud de la red y te avisa, todo desde un único binario autoalojado. Nada sale de tu LAN.',
             cta1: 'Instalar en tu red', cta2: 'Ver en GitHub', cta3: 'Probar la demo en vivo',
         },
@@ -381,7 +383,8 @@ const I18N = {
         hero: {
             eyebrow: 'OpenWrt 家庭网络的实时监控',
             t1: '你网络的脉搏。',
-            t2: '实时呈现,无云端。',
+            t2: '实时呈现',
+            t3: '无云端。',
             sub: 'NetPulse 监视你的 OpenWrt 路由器,绘制拓扑,评估网络健康并提醒你——全部来自一个自托管的二进制文件。数据绝不离开你的局域网。',
             cta1: '安装到你的网络', cta2: '在 GitHub 查看', cta3: '试用在线演示',
         },
@@ -470,7 +473,8 @@ const I18N = {
         hero: {
             eyebrow: 'مراقبة مباشرة لشبكة منزلك على OpenWrt',
             t1: 'نبض شبكتك.',
-            t2: 'في الوقت الحقيقي. بلا سحابة.',
+            t2: 'في الوقت الحقيقي.',
+            t3: 'بلا سحابة.',
             sub: 'يراقب NetPulse راوترات OpenWrt، ويرسم خريطة الطوبولوجيا، ويقيّم صحة شبكتك وينبّهك - كل ذلك من ملف ثنائي واحد تستضيفه بنفسك. لا شيء يغادر شبكتك المحلية.',
             cta1: 'ثبّت على شبكتك', cta2: 'شاهده على GitHub', cta3: 'جرّب العرض الحي',
         },
@@ -559,7 +563,8 @@ const I18N = {
         hero: {
             eyebrow: 'आपके OpenWrt होम नेटवर्क के लिए लाइव मॉनिटरिंग',
             t1: 'आपके नेटवर्क की धड़कन।',
-            t2: 'रियल टाइम। बिना क्लाउड।',
+            t2: 'रियल टाइम।',
+            t3: 'बिना क्लाउड।',
             sub: 'NetPulse आपके OpenWrt राउटरों पर नज़र रखता है, टोपोलॉजी बनाता है, नेटवर्क स्वास्थ्य का स्कोर देता है और आपको सूचित करता है - सब कुछ एक सेल्फ-होस्टेड बाइनरी से। कुछ भी आपके LAN से बाहर नहीं जाता।',
             cta1: 'अपने नेटवर्क पर इंस्टॉल करें', cta2: 'GitHub पर देखें', cta3: 'लाइव डेमो आज़माएँ',
         },
@@ -648,7 +653,8 @@ const I18N = {
         hero: {
             eyebrow: 'Monitorização em direto da tua rede doméstica OpenWrt',
             t1: 'O pulso da sua rede.',
-            t2: 'Em tempo real. Sem nuvem.',
+            t2: 'Em tempo real.',
+            t3: 'Sem nuvem.',
             sub: 'O NetPulse vigia seus roteadores OpenWrt, desenha a topologia, avalia a saúde da rede e avisa você - tudo a partir de um único binário auto-hospedado. Nada sai da sua LAN.',
             cta1: 'Instalar na sua rede', cta2: 'Ver no GitHub', cta3: 'Testar a demo ao vivo',
         },
@@ -737,7 +743,8 @@ const I18N = {
         hero: {
             eyebrow: 'Supervision en direct de votre réseau domestique OpenWrt',
             t1: 'Le pouls de votre réseau.',
-            t2: 'En temps réel. Sans cloud.',
+            t2: 'En temps réel.',
+            t3: 'Sans cloud.',
             sub: 'NetPulse surveille vos routeurs OpenWrt, dessine la topologie, note la santé du réseau et vous alerte - le tout depuis un seul binaire auto-hébergé. Rien ne quitte votre LAN.',
             cta1: 'Installer sur votre réseau', cta2: 'Voir sur GitHub', cta3: 'Essayer la démo en direct',
         },
@@ -826,7 +833,8 @@ const I18N = {
         hero: {
             eyebrow: 'OpenWrtホームネットワークのライブ監視',
             t1: 'あなたのネットワークの鼓動。',
-            t2: 'リアルタイム。クラウドなし。',
+            t2: 'リアルタイム。',
+            t3: 'クラウドなし。',
             sub: 'NetPulse は OpenWrt ルーターを見守り、トポロジーを描き、ネットワークの健全性をスコア化して通知します - すべて単一のセルフホスト バイナリから。データはあなたの LAN から出ません。',
             cta1: '自分のネットワークに導入', cta2: 'GitHub で見る', cta3: 'ライブデモを試す',
         },
@@ -915,7 +923,8 @@ const I18N = {
         hero: {
             eyebrow: 'Мониторинг вашей домашней сети OpenWrt в реальном времени',
             t1: 'Пульс вашей сети.',
-            t2: 'В реальном времени. Без облака.',
+            t2: 'В реальном времени.',
+            t3: 'Без облака.',
             sub: 'NetPulse следит за роутерами OpenWrt, рисует топологию, оценивает здоровье сети и предупреждает вас - всё из одного self-hosted бинарника. Ничего не покидает вашу LAN.',
             cta1: 'Установить в своей сети', cta2: 'Смотреть на GitHub', cta3: 'Попробовать живое демо',
         },
@@ -1004,7 +1013,8 @@ const I18N = {
         hero: {
             eyebrow: 'Live-Monitoring für dein OpenWrt-Heimnetz',
             t1: 'Der Puls deines Netzwerks.',
-            t2: 'In Echtzeit. Ohne Cloud.',
+            t2: 'In Echtzeit.',
+            t3: 'Ohne Cloud.',
             sub: 'NetPulse überwacht deine OpenWrt-Router, zeichnet die Topologie, bewertet die Netzwerkgesundheit und warnt dich - alles aus einer einzigen selbst gehosteten Binärdatei. Nichts verlässt dein LAN.',
             cta1: 'In deinem Netz installieren', cta2: 'Auf GitHub ansehen', cta3: 'Live-Demo testen',
         },
@@ -1121,6 +1131,7 @@ let CURRENT = detectLang();
    ============================================================ */
 const I18N_EXTRA = {
     en: {
+        hero: { sound: 'Watch with sound', video: '40-second video: NetPulse in action', play: 'Play' },
         nav: { how: 'How it works', free: 'Free', faq: 'FAQ' },
         how: {
             eyebrow: 'How it works',
@@ -1454,6 +1465,7 @@ const I18N_EXTRA = {
         },
     },
     es: {
+        hero: { sound: 'Verlo con sonido', video: 'Vídeo de 40 segundos: NetPulse en acción', play: 'Reproducir' },
         nav: { how: 'Cómo funciona', free: 'Gratis', faq: 'FAQ' },
         how: {
             eyebrow: 'Cómo funciona',
@@ -1787,6 +1799,7 @@ const I18N_EXTRA = {
         },
     },
     zh: {
+        hero: { sound: '有声观看', video: '40 秒视频:NetPulse 实际运行', play: '播放' },
         nav: { how: '工作原理', free: '免费', faq: '常见问题' },
         how: {
             eyebrow: '工作原理',
@@ -1841,6 +1854,7 @@ const I18N_EXTRA = {
         install: { auto: '更新自动完成:内置自动更新器每 24 小时检查一次,以原子交换方式应用新版本。你也可以重新运行安装脚本,或用 sh install.sh --uninstall 卸载。' },
     },
     ar: {
+        hero: { sound: 'شاهده مع الصوت', video: 'فيديو مدته 40 ثانية: NetPulse أثناء العمل', play: 'تشغيل' },
         nav: { how: 'كيف يعمل', free: 'مجاني', faq: 'الأسئلة الشائعة' },
         how: {
             eyebrow: 'كيف يعمل',
@@ -1895,6 +1909,7 @@ const I18N_EXTRA = {
         install: { auto: 'التحديثات تعتني بنفسها: المحدّث التلقائي المدمج يفحص كل 24 ساعة ويطبق الإصدارات الجديدة بتبديل ذري. ويمكنك أيضًا إعادة تشغيل المثبّت أو الإزالة عبر sh install.sh --uninstall.' },
     },
     hi: {
+        hero: { sound: 'आवाज़ के साथ देखें', video: '40 सेकंड का वीडियो: NetPulse काम करते हुए', play: 'चलाएँ' },
         nav: { how: 'कैसे काम करता है', free: 'मुफ़्त', faq: 'सामान्य प्रश्न' },
         how: {
             eyebrow: 'कैसे काम करता है',
@@ -1949,6 +1964,7 @@ const I18N_EXTRA = {
         install: { auto: 'अपडेट अपने आप होते हैं: बिल्ट-इन ऑटो-अपडेटर हर 24 घंटे जांचता है और नए वर्शन एटॉमिक स्वैप से लागू करता है। आप इंस्टॉलर दोबारा चला सकते हैं या sh install.sh --uninstall से हटा सकते हैं।' },
     },
     pt: {
+        hero: { sound: 'Ver com som', video: 'Vídeo de 40 segundos: o NetPulse em ação', play: 'Reproduzir' },
         nav: { how: 'Como funciona', free: 'Grátis', faq: 'FAQ' },
         how: {
             eyebrow: 'Como funciona',
@@ -2003,6 +2019,7 @@ const I18N_EXTRA = {
         install: { auto: 'As atualizações cuidam de si: o auto-updater integrado verifica a cada 24 h e aplica novas versões com troca atómica. Também pode reexecutar o instalador ou desinstalar com sh install.sh --uninstall.' },
     },
     fr: {
+        hero: { sound: 'Regarder avec le son', video: 'Vidéo de 40 secondes : NetPulse en action', play: 'Lire' },
         nav: { how: 'Fonctionnement', free: 'Gratuit', faq: 'FAQ' },
         how: {
             eyebrow: 'Fonctionnement',
@@ -2057,6 +2074,7 @@ const I18N_EXTRA = {
         install: { auto: 'Les mises à jour se gèrent seules : l’auto-updater intégré vérifie toutes les 24 h et applique les nouvelles versions par échange atomique. Vous pouvez aussi relancer l’installateur ou désinstaller avec sh install.sh --uninstall.' },
     },
     ja: {
+        hero: { sound: '音声付きで見る', video: '40秒の動画:動作中の NetPulse', play: '再生' },
         nav: { how: '仕組み', free: '無料', faq: 'よくある質問' },
         how: {
             eyebrow: '仕組み',
@@ -2111,6 +2129,7 @@ const I18N_EXTRA = {
         install: { auto: '更新は自動です:内蔵アップデーターが24時間ごとに確認し、新バージョンをアトミックスワップで適用します。インストーラーの再実行や sh install.sh --uninstall での削除も可能です。' },
     },
     ru: {
+        hero: { sound: 'Смотреть со звуком', video: '40-секундное видео: NetPulse в работе', play: 'Воспроизвести' },
         nav: { how: 'Как работает', free: 'Бесплатно', faq: 'FAQ' },
         how: {
             eyebrow: 'Как работает',
@@ -2165,6 +2184,7 @@ const I18N_EXTRA = {
         install: { auto: 'Обновления происходят сами: встроенный авто-апдейтер проверяет каждые 24 ч и применяет новые версии атомарной заменой. Можно также перезапустить установщик или удалить через sh install.sh --uninstall.' },
     },
     de: {
+        hero: { sound: 'Mit Ton ansehen', video: '40-Sekunden-Video: NetPulse in Aktion', play: 'Abspielen' },
         nav: { how: 'So funktioniert’s', free: 'Kostenlos', faq: 'FAQ' },
         how: {
             eyebrow: 'So funktioniert’s',

+ 28 - 11
web/index.html

@@ -34,7 +34,7 @@
   <meta name="twitter:image" content="https://netpulse.cloudless.club/og.png" />
   <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96' fill='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='10' y1='78' x2='90' y2='20' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%2322D3EE'/%3E%3Cstop offset='1' stop-color='%23A78BFA'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M10 60 H27 L33 60 L40 38 L48 78 L54 48 L58 60 H64' stroke='url(%23g)' stroke-width='5.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='73' cy='60' r='6' fill='url(%23g)'/%3E%3Cpath d='M62.4 49.4 A15 15 0 0 1 83.6 49.4' stroke='url(%23g)' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M55.3 39.7 A25 25 0 0 1 90.7 39.7' stroke='url(%23g)' stroke-width='5' stroke-linecap='round' opacity='0.6'/%3E%3C/svg%3E" />
   <link rel="stylesheet" href="fonts/fonts.css" />
-  <link rel="stylesheet" href="styles.css?v=20261121a" />
+  <link rel="stylesheet" href="styles.css?v=20261206b" />
   <script type="application/ld+json">
   {
     "@context": "https://schema.org",
@@ -134,10 +134,11 @@
   <header class="hero mesh-bg">
     <div class="hero-halo" aria-hidden="true"></div>
     <div class="container">
+      <div class="hero-copy">
       <span class="eyebrow" data-i18n="hero.eyebrow">Monitorización en vivo para tu red doméstica OpenWrt</span>
       <h1 class="font-display text-balance">
         <span data-i18n="hero.t1">El pulso de tu red.</span><br />
-        <span class="text-accent" data-i18n="hero.t2">En tiempo real. Sin nube.</span>
+        <span class="text-accent" data-i18n="hero.t2">En tiempo real.</span> <span class="text-accent hero-title-last" data-i18n="hero.t3">Sin nube.</span>
       </h1>
       <p class="hero-sub" data-i18n="hero.sub">NetPulse vigila tus routers OpenWrt, dibuja la topología, puntúa la salud de la red y te avisa, todo desde un único binario autoalojado. Nada sale de tu LAN.</p>
       <div class="hero-actions">
@@ -149,7 +150,7 @@
           <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
           <span data-i18n="hero.cta1">Instalar en tu red</span>
         </a>
-        <a class="btn-ghost" href="https://github.com/gnacho/netpulse" target="_blank" rel="noopener">
+        <a class="btn-ghost hero-cta-gh" href="https://github.com/gnacho/netpulse" target="_blank" rel="noopener">
           <svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor"><path d="M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56 0-.27-.01-1.17-.02-2.12-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.28-1.68-1.28-1.68-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.19 1.76 1.19 1.03 1.75 2.69 1.25 3.34.95.1-.74.4-1.25.72-1.54-2.55-.29-5.23-1.28-5.23-5.68 0-1.26.45-2.28 1.19-3.09-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.17 1.18a11 11 0 0 1 5.78 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.59.23 2.76.11 3.05.74.81 1.19 1.83 1.19 3.09 0 4.41-2.69 5.38-5.25 5.66.41.35.77 1.05.77 2.12 0 1.53-.01 2.76-.01 3.14 0 .31.21.67.8.56A11.52 11.52 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5z"/></svg>
           <span data-i18n="hero.cta2">Ver en GitHub</span>
         </a>
@@ -165,6 +166,8 @@
         </a>
       </div>
 
+      </div>
+
       <div class="hero-facts">
         <span class="chip"><svg viewBox="0 0 24 24" fill="none" stroke="rgb(var(--ok))" stroke-width="1.75" stroke-linecap="round"><path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"/><line x1="4" y1="4" x2="20" y2="20"/></svg><span data-i18n="facts.noCloud">Sin nube</span></span>
         <span class="chip"><svg viewBox="0 0 24 24" fill="none" stroke="rgb(var(--accent))" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg><span data-i18n="facts.free">100% libre · AGPL-3.0</span></span>
@@ -197,15 +200,29 @@
         </div>
       </div>
 
-      <div class="hero-shot reveal">
-        <div class="browser-frame card glow-accent">
-          <div class="bf-bar" aria-hidden="true"><span class="bf-dots"><i></i><i></i><i></i></span><span class="bf-url font-mono">netpulse · 192.168.8.1:3000</span></div>
-          <img id="heroShot" src="assets/shot-overview-en-dark.webp" alt="NetPulse - overview" width="1440" height="900" decoding="async" />
-        </div>
-      </div>
     </div>
   </header>
 
+  <section class="hero-video-section">
+    <div class="container">
+        <div class="hero-media reveal">
+          <div class="hero-video card glow-accent">
+            <video id="heroVideo" muted loop playsinline preload="metadata" poster="assets/promo-poster-en.webp" width="1440" height="810" aria-label="40-second video: NetPulse in action" data-i18n-aria="hero.video">
+              <source src="assets/netpulse-promo-40s-en.mp4" type="video/mp4" />
+            </video>
+            <button class="hero-play" id="heroPlay" type="button" hidden aria-label="Reproducir el vídeo" data-i18n-aria="hero.play">
+              <svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><polygon points="5 3 19 12 5 21 5 3"/></svg>
+              <span data-i18n="hero.play">Reproducir</span>
+            </button>
+            <button class="hero-sound" id="heroSound" type="button">
+              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 5 6 9H2v6h4l5 4V5Z"/><path d="M15.5 8.5a5 5 0 0 1 0 7"/><path d="M19 5a10 10 0 0 1 0 14"/></svg>
+              <span data-i18n="hero.sound">Verlo con sonido</span>
+            </button>
+          </div>
+        </div>
+    </div>
+  </section>
+
   <!-- ============ TICKER ============ -->
   <div class="ticker-wrap" aria-hidden="true">
     <div class="ticker" id="ticker"></div>
@@ -888,8 +905,8 @@
     <p class="lightbox-caption" id="lightboxCaption"></p>
   </div>
 
-  <script src="i18n.js?v=20261113a"></script>
-  <script src="app.js?v=20261117a"></script>
+  <script src="i18n.js?v=20261206b"></script>
+  <script src="app.js?v=20261206d"></script>
 <script defer src="https://stat.domatix.com/script.js" data-website-id="b9a57c48-cfbb-59fb-af00-e21b868371d9" integrity="sha384-FeSgFWhRpNmUWqmtRLZpDSRTuxgovbVqlyM0OaJpq2IanhF2u3xjYziXsyXR9Kg/" crossorigin="anonymous"></script>
 </body>
 </html>

+ 84 - 6
web/src/app.ts

@@ -1378,12 +1378,6 @@ function renderShot(i?: number) {
   const lang = (document.documentElement.lang || 'en').slice(0, 2)
   img.src = shotUrl(view)
   img.alt = (SHOT_ALT[view] && SHOT_ALT[view][lang]) || view
-  // captura del hero: siempre la vista "overview", siguiendo idioma y tema
-  const hero = document.getElementById('heroShot') as HTMLImageElement
-  if (hero) {
-    hero.src = shotUrl('overview')
-    hero.alt = (SHOT_ALT.overview && SHOT_ALT.overview[lang]) || 'NetPulse overview'
-  }
   if (cap) cap.textContent = t(`shots.s${shotIndex + 1}`)
   document.querySelectorAll('#shotThumbs .thumb').forEach((th, idx) => {
     th.classList.toggle('active', idx === shotIndex)
@@ -1528,6 +1522,89 @@ function initNav() {
   })
 }
 
+/* ---------- hero: vídeo de 40 s ----------
+   En silencio y en bucle solo mientras se ve; "con sonido" lo reinicia con
+   audio y controles. Con movimiento reducido o ahorro de datos no arranca solo. */
+function initHeroVideo() {
+  const video = document.getElementById('heroVideo') as HTMLVideoElement | null
+  const sound = document.getElementById('heroSound') as HTMLButtonElement | null
+  const playBtn = document.getElementById('heroPlay') as HTMLButtonElement | null
+  if (!video || !sound) return
+  const saveData = (navigator as Navigator & { connection?: { saveData?: boolean } }).connection?.saveData
+  const showPlay = () => { if (playBtn) playBtn.hidden = false }
+  const hidePlay = () => { if (playBtn) playBtn.hidden = true }
+  const play = () => {
+    const p = video.play()
+    if (p && typeof p.catch === 'function') p.catch(() => { showPlay() })
+  }
+  const pause = () => video.pause()
+  video.addEventListener('playing', hidePlay)
+  if (reduceMotion || saveData) {
+    video.loop = false
+    video.controls = true
+    hidePlay()
+  } else {
+    // El vídeo vive debajo del hero: precarga al acercarse, no al cargar.
+    if ('IntersectionObserver' in window) {
+      const warm = new IntersectionObserver((entries) => {
+        entries.forEach((e) => {
+          if (!e.isIntersecting) return
+          warm.disconnect()
+          if (video.paused && video.preload !== 'auto') {
+            video.preload = 'auto'
+            try { video.load() } catch { /* noop */ }
+          }
+        })
+      }, { rootMargin: '150px 0px' })
+      warm.observe(video)
+    }
+    let inView = false
+    // Histéresis: arranca al 50% visible y para al 20%, para no parpadear
+    // en el borde. Con sonido no se reanuda solo: manda el usuario.
+    const setState = (ratio: number) => {
+      if (ratio >= 0.5) {
+        inView = true
+        if (video.muted) {
+          play()
+          // Hay navegadores que ignoran play() en silencio sin rechazar.
+          window.setTimeout(() => { if (video.muted && video.paused) showPlay() }, 1200)
+        }
+      } else if (ratio <= 0.2) {
+        inView = false
+        pause()
+      }
+    }
+    if ('IntersectionObserver' in window) {
+      new IntersectionObserver((entries) => {
+        entries.forEach((e) => setState(e.isIntersecting ? e.intersectionRatio : 0))
+      }, { threshold: [0, 0.2, 0.5] }).observe(video)
+    } else {
+      inView = true
+      play()
+    }
+    document.addEventListener('visibilitychange', () => {
+      if (document.visibilityState === 'hidden') pause()
+      else if (inView && video.muted) play()
+    })
+  }
+  sound.addEventListener('click', () => {
+    hidePlay()
+    video.muted = false
+    video.loop = false
+    video.controls = true
+    try { video.currentTime = 0 } catch { /* noop */ }
+    play()
+    video.parentElement?.classList.add('has-sound')
+  })
+  if (playBtn) {
+    playBtn.addEventListener('click', () => {
+      hidePlay()
+      video.muted = true
+      play()
+    })
+  }
+}
+
 document.addEventListener('DOMContentLoaded', () => {
   initAppearance()
   initNav()
@@ -1543,4 +1620,5 @@ document.addEventListener('DOMContentLoaded', () => {
   initDemoEvent()
   heroCountUps()
   initGhMeta()
+  initHeroVideo()
 })

+ 30 - 10
web/src/i18n.ts

@@ -85,7 +85,8 @@ const I18N = {
     hero: {
       eyebrow: 'Live monitoring for your OpenWrt home network',
       t1: 'Your network’s pulse.',
-      t2: 'Real time. No cloud.',
+      t2: 'Real time.',
+      t3: 'No cloud.',
       sub: 'NetPulse watches over OpenWrt routers, maps your topology, scores your network health and alerts you, all from a single self-hosted binary. Nothing leaves your LAN.',
       cta1: 'Install on your network', cta2: 'View on GitHub', cta3: 'Try the live demo',
     },
@@ -268,7 +269,8 @@ const I18N = {
     hero: {
       eyebrow: 'Monitorización en vivo para tu red doméstica OpenWrt',
       t1: 'El pulso de tu red.',
-      t2: 'En tiempo real. Sin nube.',
+      t2: 'En tiempo real.',
+      t3: 'Sin nube.',
       sub: 'NetPulse vigila tus routers OpenWrt, dibuja la topología, puntúa la salud de la red y te avisa, todo desde un único binario autoalojado. Nada sale de tu LAN.',
       cta1: 'Instalar en tu red', cta2: 'Ver en GitHub', cta3: 'Probar la demo en vivo',
     },
@@ -386,7 +388,8 @@ const I18N = {
     hero: {
       eyebrow: 'OpenWrt 家庭网络的实时监控',
       t1: '你网络的脉搏。',
-      t2: '实时呈现,无云端。',
+      t2: '实时呈现',
+      t3: '无云端。',
       sub: 'NetPulse 监视你的 OpenWrt 路由器,绘制拓扑,评估网络健康并提醒你——全部来自一个自托管的二进制文件。数据绝不离开你的局域网。',
       cta1: '安装到你的网络', cta2: '在 GitHub 查看', cta3: '试用在线演示',
     },
@@ -476,7 +479,8 @@ const I18N = {
     hero: {
       eyebrow: 'مراقبة مباشرة لشبكة منزلك على OpenWrt',
       t1: 'نبض شبكتك.',
-      t2: 'في الوقت الحقيقي. بلا سحابة.',
+      t2: 'في الوقت الحقيقي.',
+      t3: 'بلا سحابة.',
       sub: 'يراقب NetPulse راوترات OpenWrt، ويرسم خريطة الطوبولوجيا، ويقيّم صحة شبكتك وينبّهك - كل ذلك من ملف ثنائي واحد تستضيفه بنفسك. لا شيء يغادر شبكتك المحلية.',
       cta1: 'ثبّت على شبكتك', cta2: 'شاهده على GitHub', cta3: 'جرّب العرض الحي',
     },
@@ -566,7 +570,8 @@ const I18N = {
     hero: {
       eyebrow: 'आपके OpenWrt होम नेटवर्क के लिए लाइव मॉनिटरिंग',
       t1: 'आपके नेटवर्क की धड़कन।',
-      t2: 'रियल टाइम। बिना क्लाउड।',
+      t2: 'रियल टाइम।',
+      t3: 'बिना क्लाउड।',
       sub: 'NetPulse आपके OpenWrt राउटरों पर नज़र रखता है, टोपोलॉजी बनाता है, नेटवर्क स्वास्थ्य का स्कोर देता है और आपको सूचित करता है - सब कुछ एक सेल्फ-होस्टेड बाइनरी से। कुछ भी आपके LAN से बाहर नहीं जाता।',
       cta1: 'अपने नेटवर्क पर इंस्टॉल करें', cta2: 'GitHub पर देखें', cta3: 'लाइव डेमो आज़माएँ',
     },
@@ -656,7 +661,8 @@ const I18N = {
     hero: {
       eyebrow: 'Monitorização em direto da tua rede doméstica OpenWrt',
       t1: 'O pulso da sua rede.',
-      t2: 'Em tempo real. Sem nuvem.',
+      t2: 'Em tempo real.',
+      t3: 'Sem nuvem.',
       sub: 'O NetPulse vigia seus roteadores OpenWrt, desenha a topologia, avalia a saúde da rede e avisa você - tudo a partir de um único binário auto-hospedado. Nada sai da sua LAN.',
       cta1: 'Instalar na sua rede', cta2: 'Ver no GitHub', cta3: 'Testar a demo ao vivo',
     },
@@ -746,7 +752,8 @@ const I18N = {
     hero: {
       eyebrow: 'Supervision en direct de votre réseau domestique OpenWrt',
       t1: 'Le pouls de votre réseau.',
-      t2: 'En temps réel. Sans cloud.',
+      t2: 'En temps réel.',
+      t3: 'Sans cloud.',
       sub: 'NetPulse surveille vos routeurs OpenWrt, dessine la topologie, note la santé du réseau et vous alerte - le tout depuis un seul binaire auto-hébergé. Rien ne quitte votre LAN.',
       cta1: 'Installer sur votre réseau', cta2: 'Voir sur GitHub', cta3: 'Essayer la démo en direct',
     },
@@ -836,7 +843,8 @@ const I18N = {
     hero: {
       eyebrow: 'OpenWrtホームネットワークのライブ監視',
       t1: 'あなたのネットワークの鼓動。',
-      t2: 'リアルタイム。クラウドなし。',
+      t2: 'リアルタイム。',
+      t3: 'クラウドなし。',
       sub: 'NetPulse は OpenWrt ルーターを見守り、トポロジーを描き、ネットワークの健全性をスコア化して通知します - すべて単一のセルフホスト バイナリから。データはあなたの LAN から出ません。',
       cta1: '自分のネットワークに導入', cta2: 'GitHub で見る', cta3: 'ライブデモを試す',
     },
@@ -926,7 +934,8 @@ const I18N = {
     hero: {
       eyebrow: 'Мониторинг вашей домашней сети OpenWrt в реальном времени',
       t1: 'Пульс вашей сети.',
-      t2: 'В реальном времени. Без облака.',
+      t2: 'В реальном времени.',
+      t3: 'Без облака.',
       sub: 'NetPulse следит за роутерами OpenWrt, рисует топологию, оценивает здоровье сети и предупреждает вас - всё из одного self-hosted бинарника. Ничего не покидает вашу LAN.',
       cta1: 'Установить в своей сети', cta2: 'Смотреть на GitHub', cta3: 'Попробовать живое демо',
     },
@@ -1016,7 +1025,8 @@ const I18N = {
     hero: {
       eyebrow: 'Live-Monitoring für dein OpenWrt-Heimnetz',
       t1: 'Der Puls deines Netzwerks.',
-      t2: 'In Echtzeit. Ohne Cloud.',
+      t2: 'In Echtzeit.',
+      t3: 'Ohne Cloud.',
       sub: 'NetPulse überwacht deine OpenWrt-Router, zeichnet die Topologie, bewertet die Netzwerkgesundheit und warnt dich - alles aus einer einzigen selbst gehosteten Binärdatei. Nichts verlässt dein LAN.',
       cta1: 'In deinem Netz installieren', cta2: 'Auf GitHub ansehen', cta3: 'Live-Demo testen',
     },
@@ -1131,6 +1141,7 @@ let CURRENT = detectLang()
    ============================================================ */
 const I18N_EXTRA = {
   en: {
+    hero: { sound: 'Watch with sound', video: '40-second video: NetPulse in action', play: 'Play' },
     nav: { how: 'How it works', free: 'Free', faq: 'FAQ' },
     how: {
       eyebrow: 'How it works',
@@ -1464,6 +1475,7 @@ const I18N_EXTRA = {
     },
   },
   es: {
+    hero: { sound: 'Verlo con sonido', video: 'Vídeo de 40 segundos: NetPulse en acción', play: 'Reproducir' },
     nav: { how: 'Cómo funciona', free: 'Gratis', faq: 'FAQ' },
     how: {
       eyebrow: 'Cómo funciona',
@@ -1797,6 +1809,7 @@ const I18N_EXTRA = {
     },
   },
   zh: {
+    hero: { sound: '有声观看', video: '40 秒视频:NetPulse 实际运行', play: '播放' },
     nav: { how: '工作原理', free: '免费', faq: '常见问题' },
     how: {
       eyebrow: '工作原理',
@@ -1851,6 +1864,7 @@ const I18N_EXTRA = {
     install: { auto: '更新自动完成:内置自动更新器每 24 小时检查一次,以原子交换方式应用新版本。你也可以重新运行安装脚本,或用 sh install.sh --uninstall 卸载。' },
   },
   ar: {
+    hero: { sound: 'شاهده مع الصوت', video: 'فيديو مدته 40 ثانية: NetPulse أثناء العمل', play: 'تشغيل' },
     nav: { how: 'كيف يعمل', free: 'مجاني', faq: 'الأسئلة الشائعة' },
     how: {
       eyebrow: 'كيف يعمل',
@@ -1905,6 +1919,7 @@ const I18N_EXTRA = {
     install: { auto: 'التحديثات تعتني بنفسها: المحدّث التلقائي المدمج يفحص كل 24 ساعة ويطبق الإصدارات الجديدة بتبديل ذري. ويمكنك أيضًا إعادة تشغيل المثبّت أو الإزالة عبر sh install.sh --uninstall.' },
   },
   hi: {
+    hero: { sound: 'आवाज़ के साथ देखें', video: '40 सेकंड का वीडियो: NetPulse काम करते हुए', play: 'चलाएँ' },
     nav: { how: 'कैसे काम करता है', free: 'मुफ़्त', faq: 'सामान्य प्रश्न' },
     how: {
       eyebrow: 'कैसे काम करता है',
@@ -1959,6 +1974,7 @@ const I18N_EXTRA = {
     install: { auto: 'अपडेट अपने आप होते हैं: बिल्ट-इन ऑटो-अपडेटर हर 24 घंटे जांचता है और नए वर्शन एटॉमिक स्वैप से लागू करता है। आप इंस्टॉलर दोबारा चला सकते हैं या sh install.sh --uninstall से हटा सकते हैं।' },
   },
   pt: {
+    hero: { sound: 'Ver com som', video: 'Vídeo de 40 segundos: o NetPulse em ação', play: 'Reproduzir' },
     nav: { how: 'Como funciona', free: 'Grátis', faq: 'FAQ' },
     how: {
       eyebrow: 'Como funciona',
@@ -2013,6 +2029,7 @@ const I18N_EXTRA = {
     install: { auto: 'As atualizações cuidam de si: o auto-updater integrado verifica a cada 24 h e aplica novas versões com troca atómica. Também pode reexecutar o instalador ou desinstalar com sh install.sh --uninstall.' },
   },
   fr: {
+    hero: { sound: 'Regarder avec le son', video: 'Vidéo de 40 secondes : NetPulse en action', play: 'Lire' },
     nav: { how: 'Fonctionnement', free: 'Gratuit', faq: 'FAQ' },
     how: {
       eyebrow: 'Fonctionnement',
@@ -2067,6 +2084,7 @@ const I18N_EXTRA = {
     install: { auto: 'Les mises à jour se gèrent seules : l’auto-updater intégré vérifie toutes les 24 h et applique les nouvelles versions par échange atomique. Vous pouvez aussi relancer l’installateur ou désinstaller avec sh install.sh --uninstall.' },
   },
   ja: {
+    hero: { sound: '音声付きで見る', video: '40秒の動画:動作中の NetPulse', play: '再生' },
     nav: { how: '仕組み', free: '無料', faq: 'よくある質問' },
     how: {
       eyebrow: '仕組み',
@@ -2121,6 +2139,7 @@ const I18N_EXTRA = {
     install: { auto: '更新は自動です:内蔵アップデーターが24時間ごとに確認し、新バージョンをアトミックスワップで適用します。インストーラーの再実行や sh install.sh --uninstall での削除も可能です。' },
   },
   ru: {
+    hero: { sound: 'Смотреть со звуком', video: '40-секундное видео: NetPulse в работе', play: 'Воспроизвести' },
     nav: { how: 'Как работает', free: 'Бесплатно', faq: 'FAQ' },
     how: {
       eyebrow: 'Как работает',
@@ -2175,6 +2194,7 @@ const I18N_EXTRA = {
     install: { auto: 'Обновления происходят сами: встроенный авто-апдейтер проверяет каждые 24 ч и применяет новые версии атомарной заменой. Можно также перезапустить установщик или удалить через sh install.sh --uninstall.' },
   },
   de: {
+    hero: { sound: 'Mit Ton ansehen', video: '40-Sekunden-Video: NetPulse in Aktion', play: 'Abspielen' },
     nav: { how: 'So funktioniert’s', free: 'Kostenlos', faq: 'FAQ' },
     how: {
       eyebrow: 'So funktioniert’s',

+ 72 - 2
web/styles.css

@@ -618,7 +618,7 @@ html[dir="rtl"] .honest { border-left: none; border-right: 3px solid rgb(var(--w
 .hero-badges { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-top: 1.1rem; }
 .chip-link { text-decoration: none; transition: border-color .2s, background .2s; }
 .chip-link:hover { border-color: rgb(var(--border-strong)); background: rgb(var(--hover)); }
-.hero-shot { margin-top: 3.25rem; }
+
 .browser-frame { overflow: hidden; padding: 0 !important; }
 .bf-bar {
   display: flex; align-items: center; gap: 0.85rem;
@@ -718,7 +718,7 @@ html[dir="rtl"] .honest { border-left: none; border-right: 3px solid rgb(var(--w
   .statband { grid-template-columns: repeat(2, 1fr); }
   .free-grid { grid-template-columns: 1fr; }
   .free-list { grid-template-columns: 1fr; }
-  .hero-shot { margin-top: 2.25rem; }
+  
 }
 
 /* ============================================================
@@ -790,3 +790,73 @@ html[dir="rtl"] .honest-list li::before { left: auto; right: 0; }
 .changelog-body code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.9em; background: rgb(var(--surface-2, var(--surface))); padding: 0.1rem 0.3rem; border-radius: 4px; }
 .changelog-body pre { background: rgb(var(--surface-2, var(--surface))); padding: 0.75rem; border-radius: 8px; overflow-x: auto; }
 .changelog-body a { color: rgb(var(--accent)); text-decoration: underline; }
+
+/* ============================================================
+   v3 - hero con vídeo: mensaje a la izquierda y el vídeo de 40 s
+   a la derecha desde 1200 px; por debajo, apilado. Las pastillas y
+   la tira de datos en vivo pasan debajo, a todo el ancho.
+   ============================================================ */
+.hero > .container { width: 100%; }
+.hero-copy { width: 100%; max-width: 56rem; margin: 0 auto; text-align: center; }
+.hero-sub { margin-left: auto; margin-right: auto; }
+.hero-actions, .hero-badges, .hero-facts, .demo-strip { justify-content: center; }
+.hero-video-section { padding: 0 0 4.5rem; }
+.hero-video-section .container { width: 100%; max-width: 1320px; }
+.hero-video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; padding: 0; border-radius: 1.1rem; background: #060a10; }
+.hero-video video { display: block; width: 100%; height: 100%; object-fit: cover; }
+.hero-sound {
+  position: absolute; left: 1rem; bottom: 1rem; display: inline-flex; align-items: center; gap: 0.5rem;
+  padding: 0.6rem 1rem; border-radius: 999px; cursor: pointer; font: 600 0.875rem/1 inherit;
+  color: #fff; background: rgb(6 10 16 / 0.72); border: 1px solid rgb(255 255 255 / 0.22); backdrop-filter: blur(6px);
+  transition: background-color 150ms ease, transform 150ms ease;
+}
+.hero-sound:hover { background: rgb(6 10 16 / 0.9); transform: translateY(-1px); }
+.hero-play {
+  position: absolute; inset: 0; margin: auto; z-index: 2;
+  display: inline-flex; align-items: center; gap: 0.55rem; width: fit-content; height: fit-content;
+  padding: 0.75rem 1.15rem; border-radius: 999px; cursor: pointer;
+  color: #fff; background: rgb(6 10 16 / 0.8); border: 1px solid rgb(255 255 255 / 0.24);
+  backdrop-filter: blur(6px); font-weight: 600; font-size: 0.95rem; line-height: 1;
+  transition: background-color 150ms ease, transform 150ms ease;
+}
+.hero-play:hover { background: rgb(6 10 16 / 0.95); transform: scale(1.03); }
+.hero-play[hidden] { display: none; }
+.hero-video.has-sound .hero-play { display: none; }
+.hero-video.has-sound .hero-sound { display: none; }
+[dir="rtl"] .hero-sound { left: auto; right: 1rem; }
+@media (min-width: 1200px) {
+  .hero { padding: 6.5rem 0 3.5rem; }
+  .hero h1 { font-size: clamp(3.2rem, 4.9vw, 5.2rem); line-height: 0.98; }
+  .hero-sub { font-size: 1.2rem; max-width: 34rem; }
+  .hero-actions { margin-top: 2rem; }
+  .hero-facts { margin-top: 2.75rem; }
+}
+@media (max-width: 640px) {
+  .hero-video { border-radius: 0.8rem; }
+  .hero-sound { left: 0.6rem; bottom: 0.6rem; padding: 0.5rem 0.8rem; font-size: 0.8rem; }
+  /* A 390 px el titular a 14vw parte "En tiempo real." en dos lineas. */
+  .hero h1 { font-size: clamp(2.5rem, 12vw, 3.4rem); }
+}
+/* En dos columnas GitHub ya está en la barra (Star): el hero se queda con dos botones. */
+@media (min-width: 1200px) {
+  .hero-cta-gh { display: none; }
+  .hero h1 { font-size: clamp(3rem, 4.2vw, 4.6rem); }
+}
+/* Tablet y portátil pequeño: titular más contenido para que el vídeo asome. */
+@media (min-width: 861px) and (max-width: 1199px) {
+  .hero { min-height: auto; padding: 6rem 0 3rem; }
+  .hero h1 { font-size: clamp(3.2rem, 7.5vw, 5.6rem); }
+}
+/* El menú no cabía entre 861 y 1180 px y partía los enlaces en dos líneas. */
+@media (min-width: 861px) and (max-width: 1180px) {
+  .nav-links { gap: 1rem; }
+  .nav-links a { white-space: nowrap; font-size: 0.82rem; }
+  .nav-star { display: none; }
+}
+
+/* Tercera línea del titular solo en dos columnas, para que "Sin nube." no
+   quede huérfano al estrecharse la columna. */
+.hero-title-last { display: inline; }
+@media (max-width: 860px), (min-width: 1200px) {
+  .hero-title-last { display: block; }
+}