Преглед на файлове

feat(landing): slider de capturas por menú + fixes + SEO

- Slider de capturas de la app por menú (overview, routers, devices, topology, alerts, settings) x ES/EN x light/dark (24 webp en web/assets/), con miniaturas y flechas
- Fix overflow móvil (min-width:0 en grid del install) y contraste --text-muted AA (light y dark)
- Botón copiar fuera del codebox (debajo), con feedback 'Copiado al portapapeles'
- hreflang es/en/x-default + FAQPage JSON-LD
gnacho преди 4 месеца
родител
ревизия
cc2739ba86

+ 49 - 0
web/app.js

@@ -1273,6 +1273,7 @@ function applyTheme() {
   root.classList.toggle('light', light)
   const meta = document.querySelector('meta[name="theme-color"]')
   if (meta) meta.content = light ? '#F3F5F9' : '#070B12'
+  if (typeof renderShot === 'function') renderShot()
 }
 function applyAccent() { document.documentElement.dataset.accent = accentId }
 function updateAppearancePanel() {
@@ -1344,6 +1345,53 @@ function initTrafficRanges() {
   })
 }
 
+/* ---------- slider de capturas ---------- */
+const SHOT_SLIDES = ['overview', 'routers', 'devices', 'topology', 'alerts', 'settings']
+const SHOT_ALT = {
+  overview: { es: 'Panel de NetPulse: salud, tráfico y dispositivos de la red', en: 'NetPulse overview: network health, traffic and devices' },
+  routers: { es: 'Vista de routers: flota, salud y métricas por router', en: 'Routers view: fleet, health and per-router metrics' },
+  devices: { es: 'Vista de dispositivos: clientes, banda y señal', en: 'Devices view: clients, band and signal' },
+  topology: { es: 'Topología: el mapa vivo de tu red, inferido del FDB', en: 'Topology: the live map of your network, inferred from the FDB' },
+  alerts: { es: 'Feed de alertas: lo que pasa en tu red, en vivo', en: 'Alerts feed: what happens in your network, live' },
+  settings: { es: 'Ajustes: apariencia, usuarios, routers y servicios', en: 'Settings: appearance, users, routers and services' },
+}
+let shotIndex = 0
+
+function shotUrl(view) {
+  const lang = (document.documentElement.lang || 'en').slice(0, 2)
+  const theme = document.documentElement.classList.contains('light') ? 'light' : 'dark'
+  return `assets/shot-${view}-${lang}-${theme}.webp`
+}
+
+function renderShot(i) {
+  if (typeof i === 'number') shotIndex = (i + SHOT_SLIDES.length) % SHOT_SLIDES.length
+  const view = SHOT_SLIDES[shotIndex]
+  const img = document.getElementById('shotImg')
+  const cap = document.getElementById('shotCaption')
+  if (!img) return
+  const lang = (document.documentElement.lang || 'en').slice(0, 2)
+  img.src = shotUrl(view)
+  img.alt = (SHOT_ALT[view] && SHOT_ALT[view][lang]) || view
+  if (cap) cap.textContent = t(`shots.s${shotIndex + 1}`)
+  document.querySelectorAll('#shotThumbs .thumb').forEach((th, idx) => {
+    th.classList.toggle('active', idx === shotIndex)
+  })
+}
+
+function initSlider() {
+  const img = document.getElementById('shotImg')
+  if (!img) return
+  document.querySelectorAll('#shotThumbs img[data-view]').forEach((el) => {
+    el.src = shotUrl(el.dataset.view)
+  })
+  document.getElementById('shotPrev').addEventListener('click', () => renderShot(shotIndex - 1))
+  document.getElementById('shotNext').addEventListener('click', () => renderShot(shotIndex + 1))
+  document.querySelectorAll('#shotThumbs .thumb').forEach((th) => {
+    th.addEventListener('click', () => renderShot(parseInt(th.dataset.slide, 10)))
+  })
+  renderShot(0)
+}
+
 document.addEventListener('DOMContentLoaded', () => {
   initAppearance()
   initBackgroundCanvas()
@@ -1354,5 +1402,6 @@ document.addEventListener('DOMContentLoaded', () => {
   initCopy()
   initKofi()
   initTrafficRanges()
+  initSlider()
   heroCountUps()
 })

BIN
web/assets/shot-alerts-en-dark.webp


BIN
web/assets/shot-alerts-en-light.webp


BIN
web/assets/shot-alerts-es-dark.webp


BIN
web/assets/shot-alerts-es-light.webp


BIN
web/assets/shot-devices-en-dark.webp


BIN
web/assets/shot-devices-en-light.webp


BIN
web/assets/shot-devices-es-dark.webp


BIN
web/assets/shot-devices-es-light.webp


BIN
web/assets/shot-overview-en-dark.webp


BIN
web/assets/shot-overview-en-light.webp


BIN
web/assets/shot-overview-es-dark.webp


BIN
web/assets/shot-overview-es-light.webp


BIN
web/assets/shot-routers-en-dark.webp


BIN
web/assets/shot-routers-en-light.webp


BIN
web/assets/shot-routers-es-dark.webp


BIN
web/assets/shot-routers-es-light.webp


BIN
web/assets/shot-settings-en-dark.webp


BIN
web/assets/shot-settings-en-light.webp


BIN
web/assets/shot-settings-es-dark.webp


BIN
web/assets/shot-settings-es-light.webp


BIN
web/assets/shot-topology-en-dark.webp


BIN
web/assets/shot-topology-en-light.webp


BIN
web/assets/shot-topology-es-dark.webp


BIN
web/assets/shot-topology-es-light.webp


+ 29 - 2
web/i18n.js

@@ -126,7 +126,20 @@ const I18N = {
       kofi: 'Support the project on Ko-fi', rights: 'AGPL-3.0 · Built at home, for home networks.',
     },
     appearance: { title: 'Appearance', theme: 'Theme', dark: 'Dark', light: 'Light', system: 'Auto', accent: 'Accent', note: 'Same tokens as the app — try it live.' },
-    misc: { lang: 'Language', copy: 'Copy', copied: 'Copied!', demoBadge: 'demo data' },
+    misc: { lang: 'Language', copy: 'Copy', copied: 'Copied to clipboard', demoBadge: 'demo data' },
+    shots: {
+      eyebrow: 'The app',
+      title: 'A look at the interface',
+      lead: 'NetPulse screenshots in demo mode, in the theme you pick. One per menu.',
+      prev: 'Previous screenshot',
+      next: 'Next screenshot',
+      s1: 'Overview · a glance at your network health',
+      s2: 'Routers · fleet, health and per-router metrics',
+      s3: 'Devices · clients, band and signal',
+      s4: 'Topology · the live map of your network, inferred from the FDB',
+      s5: 'Alerts · the feed of what happens in your network',
+      s6: 'Settings · appearance, users, routers and services',
+    },
   },
 
   /* ---------------- ESPAÑOL ---------------- */
@@ -217,7 +230,20 @@ const I18N = {
       kofi: 'Apoya el proyecto en Ko-fi', rights: 'AGPL-3.0 · Hecho en casa, para redes de casa.',
     },
     appearance: { title: 'Apariencia', theme: 'Tema', dark: 'Oscuro', light: 'Claro', system: 'Auto', accent: 'Acento', note: 'Mismos tokens que la app — pruébalo en vivo.' },
-    misc: { lang: 'Idioma', copy: 'Copiar', copied: '¡Copiado!', demoBadge: 'datos demo' },
+    misc: { lang: 'Idioma', copy: 'Copiar', copied: 'Copiado al portapapeles', demoBadge: 'datos demo' },
+    shots: {
+      eyebrow: 'La app',
+      title: 'Un vistazo a la interfaz',
+      lead: 'Capturas de NetPulse en modo demo, con el tema que elijas. Una por menú.',
+      prev: 'Captura anterior',
+      next: 'Captura siguiente',
+      s1: 'Panel · un vistazo a la salud de tu red',
+      s2: 'Routers · flota, salud y métricas por router',
+      s3: 'Dispositivos · clientes, banda y señal',
+      s4: 'Topología · el mapa vivo de tu red, inferido del FDB',
+      s5: 'Alertas · el feed de lo que pasa en tu red',
+      s6: 'Ajustes · apariencia, usuarios, routers y servicios',
+    },
   },
 
   /* ---------------- 中文 (简体) ---------------- */
@@ -1081,6 +1107,7 @@ function applyLang(lang) {
   if (typeof renderRouterNames === 'function') renderRouterNames()
   if (typeof renderTopoNames === 'function') renderTopoNames()
   if (typeof renderAdGuardTexts === 'function') renderAdGuardTexts()
+  if (typeof renderShot === 'function') renderShot()
   if (typeof updateAppearancePanel === 'function') updateAppearancePanel()
 }
 

+ 34 - 1
web/index.html

@@ -441,6 +441,37 @@
     </div>
   </section>
 
+  <!-- ============ CAPTURAS ============ -->
+  <section class="block" id="shots" style="padding-top:1rem;">
+    <div class="container">
+      <div class="reveal">
+        <span class="eyebrow" data-i18n="shots.eyebrow">La app</span>
+        <h2 class="font-display text-balance" data-i18n="shots.title">Un vistazo a la interfaz</h2>
+        <p class="lead" data-i18n="shots.lead">Capturas de NetPulse en modo demo, con el tema que elijas. Una por menú.</p>
+      </div>
+      <div class="slider reveal">
+        <div class="slider-main">
+          <button class="slider-arrow prev" id="shotPrev" aria-label="Captura anterior" data-i18n-aria="shots.prev">
+            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" width="20" height="20" aria-hidden="true"><polyline points="15 18 9 12 15 6"/></svg>
+          </button>
+          <img id="shotImg" src="assets/shot-overview-es-light.webp" alt="" width="1440" height="900">
+          <button class="slider-arrow next" id="shotNext" aria-label="Captura siguiente" data-i18n-aria="shots.next">
+            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" width="20" height="20" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>
+          </button>
+        </div>
+        <p class="shot-caption" id="shotCaption"></p>
+        <div class="slider-thumbs" id="shotThumbs" aria-label="Miniaturas">
+          <button class="thumb active" data-slide="0" aria-label="Overview"><img data-view="overview" src="assets/shot-overview-es-light.webp" alt="Overview" width="300" height="188"></button>
+          <button class="thumb" data-slide="1" aria-label="Routers"><img data-view="routers" src="assets/shot-routers-es-light.webp" alt="Routers" width="300" height="188"></button>
+          <button class="thumb" data-slide="2" aria-label="Devices"><img data-view="devices" src="assets/shot-devices-es-light.webp" alt="Devices" width="300" height="188"></button>
+          <button class="thumb" data-slide="3" aria-label="Topology"><img data-view="topology" src="assets/shot-topology-es-light.webp" alt="Topology" width="300" height="188"></button>
+          <button class="thumb" data-slide="4" aria-label="Alerts"><img data-view="alerts" src="assets/shot-alerts-es-light.webp" alt="Alerts" width="300" height="188"></button>
+          <button class="thumb" data-slide="5" aria-label="Settings"><img data-view="settings" src="assets/shot-settings-es-light.webp" alt="Settings" width="300" height="188"></button>
+        </div>
+      </div>
+    </div>
+  </section>
+
   <!-- ============ INSTALACIÓN ============ -->
   <section class="block" id="install">
     <div class="container">
@@ -455,7 +486,9 @@
           <div class="codebox">
             <span class="prompt font-mono">$</span>
             <code id="installCmd">curl -fsSL https://raw.githubusercontent.com/gnacho/netpulse/main/install.sh | sh</code>
-            <button class="copybtn" id="copyBtn" data-i18n-aria="misc.copy">Copiar</button>
+          </div>
+          <div class="code-actions">
+            <button class="copybtn" id="copyBtn" data-i18n="misc.copy" data-i18n-aria="misc.copy">Copiar</button>
           </div>
           <p class="install-note">
             <span data-i18n="install.inspector">El instalador es shell plano y legible —</span>

+ 28 - 2
web/styles.css

@@ -13,7 +13,7 @@
   --border-strong: 42 58 82;
   --text-primary: 232 238 247;
   --text-secondary: 154 168 188;
-  --text-muted: 91 107 130;
+  --text-muted: 122 140 165;
   --accent: 34 211 238;
   --tunnel: 167 139 250;
   --ok: 52 211 153;
@@ -33,7 +33,7 @@ html.light {
   --border-strong: 203 213 225;
   --text-primary: 15 23 42;
   --text-secondary: 71 85 105;
-  --text-muted: 100 116 139;
+  --text-muted: 76 88 104;
   --accent: 8 145 178;
   --tunnel: 124 58 237;
   --ok: 5 150 105;
@@ -375,6 +375,7 @@ html[dir="rtl"] .alert-item { transform: translateX(14px); }
 
 /* instalación */
 .install-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.25rem; margin-top: 2.75rem; }
+.install-grid > * { min-width: 0; }
 @media (max-width: 860px) { .install-grid { grid-template-columns: 1fr; } }
 .codecard { padding: 1.6rem; }
 .codecard h3 { font-family: "Space Grotesk", sans-serif; font-size: 1.15rem; margin: 0 0 1.15rem; }
@@ -385,6 +386,7 @@ html[dir="rtl"] .alert-item { transform: translateX(14px); }
 }
 .codebox code { font-family: "JetBrains Mono", monospace; font-size: 0.85rem; color: rgb(var(--text-primary)); white-space: nowrap; }
 .codebox .prompt { color: rgb(var(--text-muted)); user-select: none; }
+.code-actions { display: flex; justify-content: flex-end; margin: 0.6rem 0 0.75rem; }
 .copybtn {
   flex-shrink: 0; border: 1px solid rgb(var(--border-strong)); background: rgb(var(--elevated));
   color: rgb(var(--text-secondary)); border-radius: calc(var(--radius) - 2px);
@@ -495,3 +497,27 @@ html[dir="rtl"] .honest { border-left: none; border-right: 3px solid rgb(var(--w
   .mini-stat { border: none; padding: 0; }
   .features { grid-template-columns: 1fr; }
 }
+
+/* ---------- slider de capturas ---------- */
+.slider { user-select: none; }
+.slider-main { position: relative; border: 1px solid rgb(var(--border)); border-radius: var(--radius); overflow: hidden; background: rgb(var(--elevated)); }
+.slider-main img { width: 100%; height: auto; display: block; }
+.slider-arrow {
+  position: absolute; top: 50%; transform: translateY(-50%);
+  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
+  border: 1px solid rgb(var(--border)); border-radius: 50%;
+  background: rgb(var(--canvas) / 0.85); color: rgb(var(--text-primary)); cursor: pointer; z-index: 5;
+}
+.slider-arrow.prev { left: 14px; }
+.slider-arrow.next { right: 14px; }
+.slider-arrow:hover { color: rgb(var(--accent)); border-color: rgb(var(--accent)); }
+.shot-caption { margin: 0.75rem 0 0; font-size: 0.92rem; color: rgb(var(--text-secondary)); text-align: center; }
+.slider-thumbs { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1rem; }
+.thumb { width: 150px; border: 2px solid transparent; border-radius: var(--radius); padding: 0; background: transparent; cursor: pointer; overflow: hidden; opacity: 0.65; transition: opacity 180ms ease, border-color 180ms ease; }
+.thumb img { width: 100%; height: auto; display: block; }
+.thumb:hover { opacity: 1; }
+.thumb.active { border-color: rgb(var(--accent)); opacity: 1; }
+@media (max-width: 720px) {
+  .slider-thumbs { justify-content: flex-start; overflow-x: auto; padding-bottom: 0.5rem; }
+  .thumb { width: 110px; flex: none; }
+}