Laboratorio de Wireshark sin conexión: capturas sintéticas de un pentest, filtros validados al instante, retos guiados y un megalodón 3D en WebGL2.
JavaScript blue-teamcybersecurityewptjavascriptlearning-labnetwork-securityoffline-firstpacket-analysispcappentestingsocspanishtcp-ipwireshark
Encuadra la ilustración para que el texto no pise al tiburón con fuentes anchas
Yoandy Ramírez Delgado1329d97ac901
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 695aa4f..98de062 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -6,7 +6,7 @@ Formato [Keep a Changelog](https://keepachangelog.com/es-ES/1.1.0/) y versionado### Cambiado- **La portada vuelve a la ilustración** del megalodón como plano técnico azul, ahora en mejor calidad: AVIF y WebP de 1983 × 793 px, de unos 70 KB cada uno, codificados desde el original (PSNR de 40 y 38 dB).-- **Encuadre con la barra lateral:** el tiburón queda a la derecha del título a 1280, 1440 y 1920 px, también con la barra plegada.+- **Encuadre con la barra lateral:** la ilustración se alinea al 62 % (antes al 78 %) para que el tiburón empiece a la derecha del título y del texto de entrada a 1280, 1440 y 1920 px, también con la barra plegada y con fuentes del sistema anchas como DejaVu Sans.### Eliminado- **El megalodón 3D en WebGL2** (`src/app/48-shark.js`), con su vista «Plano técnico», el botón de pausa y sus notas (`docs/megalodon-3d.md`). No convencía visualmente. La página pesa unos 100 KB menos (de 655 a 550 KB) y ya no necesita WebGL.@@ -14,7 +14,7 @@ Formato [Keep a Changelog](https://keepachangelog.com/es-ES/1.1.0/) y versionado### Pruebas- Sustituyen a las del 3D:- la ilustración carga con su tamaño y su texto alternativo, y no queda ningún lienzo;- - el tiburón no queda bajo el título en cuatro encuadres;+ - el tiburón no queda bajo el texto en seis encuadres, dos de ellos con una fuente ancha (así lo detectó la CI de GitHub, que no tiene Inter);- con «reducir movimiento», la ilustración queda quieta.## [1.3.0] - 2026-11-25diff --git a/dist/index.html b/dist/index.htmlindex e898ffb..fbb713b 100644--- a/dist/index.html+++ b/dist/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">-<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'sha256-eQ6p6xmFTuutRGA/Y2kQmE54sQu6zj3VthIziND8ip0='; style-src 'sha256-tMcRJYDaG9sHho5xeUb1nNe0+K/5PvpfQxfmJlHo6Mw='; img-src data: blob:; connect-src 'none'; font-src 'none'; object-src 'none'; frame-src 'none'; base-uri 'none'; form-action 'none'">+<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'sha256-eQ6p6xmFTuutRGA/Y2kQmE54sQu6zj3VthIziND8ip0='; style-src 'sha256-2RsALOCXS/rS2FrQPQWQ5m9P84VbB5kiaXRmF5oQ72E='; img-src data: blob:; connect-src 'none'; font-src 'none'; object-src 'none'; frame-src 'none'; base-uri 'none'; form-action 'none'"><meta name="referrer" content="no-referrer"><meta name="color-scheme" content="dark light"><meta name="description" content="Megalodon: laboratorio de Wireshark sin conexión. Capturas de un pentest, filtros con validación al instante y retos guiados del saludo TCP a los ataques web.">@@ -173,7 +173,7 @@ button:disabled { cursor: not-allowed; }}.hero-art { position: absolute; inset: 0; z-index: -2; overflow: hidden; }.hero-art picture, .hero-img { display: block; width: 100%; height: 100%; }-.hero-img { object-fit: cover; object-position: 78% 50%; transform-origin: 72% 46%; animation: hero-drift 36s var(--ease-in-out) infinite alternate; will-change: transform; }+.hero-img { object-fit: cover; object-position: 62% 50%; transform-origin: 74% 46%; animation: hero-drift 36s var(--ease-in-out) infinite alternate; will-change: transform; }@keyframes hero-drift { from { transform: scale(1.001); } to { transform: scale(1.06) translate3d(-0.8%, -0.6%, 0); } }.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;background: linear-gradient(90deg, var(--hero-bg) 0%, color-mix(in srgb, var(--hero-bg) 92%, transparent) 34%, color-mix(in srgb, var(--hero-bg) 55%, transparent) 50%, transparent 68%),diff --git a/docs/capturas/beacon.webp b/docs/capturas/beacon.webpindex 09071c6..8735c7e 100644Binary files a/docs/capturas/beacon.webp and b/docs/capturas/beacon.webp differdiff --git a/docs/capturas/inicio-claro.webp b/docs/capturas/inicio-claro.webpindex c0375ce..ca04087 100644Binary files a/docs/capturas/inicio-claro.webp and b/docs/capturas/inicio-claro.webp differdiff --git a/docs/capturas/inicio-oscuro.webp b/docs/capturas/inicio-oscuro.webpindex 78b617f..d12203f 100644Binary files a/docs/capturas/inicio-oscuro.webp and b/docs/capturas/inicio-oscuro.webp differdiff --git a/docs/capturas/lateral-plegado.webp b/docs/capturas/lateral-plegado.webpindex 6739bd7..91cf72f 100644Binary files a/docs/capturas/lateral-plegado.webp and b/docs/capturas/lateral-plegado.webp differdiff --git a/docs/capturas/modulo-1.webp b/docs/capturas/modulo-1.webpindex 9563f84..0e3aa11 100644Binary files a/docs/capturas/modulo-1.webp and b/docs/capturas/modulo-1.webp differdiff --git a/megalodon.html b/megalodon.htmlindex e898ffb..fbb713b 100644--- a/megalodon.html+++ b/megalodon.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">-<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'sha256-eQ6p6xmFTuutRGA/Y2kQmE54sQu6zj3VthIziND8ip0='; style-src 'sha256-tMcRJYDaG9sHho5xeUb1nNe0+K/5PvpfQxfmJlHo6Mw='; img-src data: blob:; connect-src 'none'; font-src 'none'; object-src 'none'; frame-src 'none'; base-uri 'none'; form-action 'none'">+<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'sha256-eQ6p6xmFTuutRGA/Y2kQmE54sQu6zj3VthIziND8ip0='; style-src 'sha256-2RsALOCXS/rS2FrQPQWQ5m9P84VbB5kiaXRmF5oQ72E='; img-src data: blob:; connect-src 'none'; font-src 'none'; object-src 'none'; frame-src 'none'; base-uri 'none'; form-action 'none'"><meta name="referrer" content="no-referrer"><meta name="color-scheme" content="dark light"><meta name="description" content="Megalodon: laboratorio de Wireshark sin conexión. Capturas de un pentest, filtros con validación al instante y retos guiados del saludo TCP a los ataques web.">@@ -173,7 +173,7 @@ button:disabled { cursor: not-allowed; }}.hero-art { position: absolute; inset: 0; z-index: -2; overflow: hidden; }.hero-art picture, .hero-img { display: block; width: 100%; height: 100%; }-.hero-img { object-fit: cover; object-position: 78% 50%; transform-origin: 72% 46%; animation: hero-drift 36s var(--ease-in-out) infinite alternate; will-change: transform; }+.hero-img { object-fit: cover; object-position: 62% 50%; transform-origin: 74% 46%; animation: hero-drift 36s var(--ease-in-out) infinite alternate; will-change: transform; }@keyframes hero-drift { from { transform: scale(1.001); } to { transform: scale(1.06) translate3d(-0.8%, -0.6%, 0); } }.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;background: linear-gradient(90deg, var(--hero-bg) 0%, color-mix(in srgb, var(--hero-bg) 92%, transparent) 34%, color-mix(in srgb, var(--hero-bg) 55%, transparent) 50%, transparent 68%),diff --git a/src/styles.css b/src/styles.cssindex 95a594f..5c98e47 100644--- a/src/styles.css+++ b/src/styles.css@@ -161,7 +161,7 @@ button:disabled { cursor: not-allowed; }}.hero-art { position: absolute; inset: 0; z-index: -2; overflow: hidden; }.hero-art picture, .hero-img { display: block; width: 100%; height: 100%; }-.hero-img { object-fit: cover; object-position: 78% 50%; transform-origin: 72% 46%; animation: hero-drift 36s var(--ease-in-out) infinite alternate; will-change: transform; }+.hero-img { object-fit: cover; object-position: 62% 50%; transform-origin: 74% 46%; animation: hero-drift 36s var(--ease-in-out) infinite alternate; will-change: transform; }@keyframes hero-drift { from { transform: scale(1.001); } to { transform: scale(1.06) translate3d(-0.8%, -0.6%, 0); } }.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;background: linear-gradient(90deg, var(--hero-bg) 0%, color-mix(in srgb, var(--hero-bg) 92%, transparent) 34%, color-mix(in srgb, var(--hero-bg) 55%, transparent) 50%, transparent 68%),diff --git a/tests/e2e.mjs b/tests/e2e.mjsindex 3415065..bd383d9 100644--- a/tests/e2e.mjs+++ b/tests/e2e.mjs@@ -19,7 +19,7 @@ async function t(name, fn) {const assert = (c, m) => { if (!c) throw new Error(m); };async function page(browser, opts = {}) {- const ctx = await browser.newContext({ bypassCSP: !!opts.axe, viewport: opts.viewport || { width: 1280, height: 800 }, colorScheme: opts.theme || 'dark', reducedMotion: opts.reduced ? 'reduce' : 'no-preference' });+ const ctx = await browser.newContext({ bypassCSP: !!(opts.axe || opts.bypass), viewport: opts.viewport || { width: 1280, height: 800 }, colorScheme: opts.theme || 'dark', reducedMotion: opts.reduced ? 'reduce' : 'no-preference' });const p = await ctx.newPage();p.errors = [];p.on('pageerror', e => p.errors.push(e.message));@@ -60,23 +60,29 @@ await t('inicio: carga sin errores con la ilustración de la portada', async ()await p.close2();});-await t('portada: el tiburón de la ilustración queda a la derecha del título, sin taparse', async () => {- // zona del tiburón en la imagen original (1983 × 793): de la punta del hocico al borde de la aleta caudal- const SHARK_BOX = { x0: 1215, x1: 1760, y0: 45, y1: 760 };- for (const [w, side] of [[1280, false], [1440, false], [1920, false], [1280, true]]) {- const p = await page(browser, { viewport: { width: w, height: Math.round(w * .62) } });+await t('portada: el tiburón de la ilustración queda a la derecha del texto, sin taparse', async () => {+ // zona del tiburón en la imagen original (1983 × 793): de la punta de la aleta pectoral a la cola+ const SHARK_BOX = { x0: 1215, x1: 1760 };+ // también con una fuente del sistema ancha (DejaVu Sans, la de Linux sin Inter): el texto crece hacia la derecha+ for (const [w, side, wide] of [[1280, false, false], [1440, false, false], [1920, false, false], [1280, true, false], [1280, false, true], [1440, false, true]]) {+ const p = await page(browser, { viewport: { width: w, height: Math.round(w * .62) }, bypass: wide });+ if (wide) await p.addStyleTag({ content: '.hero-copy, .hero-copy * { font-family: "DejaVu Sans", Verdana, sans-serif !important; }' });if (side) { await p.keyboard.press('['); await p.waitForTimeout(450); }await p.waitForFunction(() => { const i = document.querySelector('.hero-img'); return i && i.complete && i.naturalWidth > 0; });const r = await p.evaluate(B => {- const img = document.querySelector('.hero-img'), box = img.getBoundingClientRect(), t = document.querySelector('#hero-t').getBoundingClientRect();- // object-fit: cover con object-position leído del CSS- const [px, py] = getComputedStyle(img).objectPosition.split(' ').map(v => parseFloat(v) / 100);+ const img = document.querySelector('.hero-img'), box = img.getBoundingClientRect();+ const textRight = Math.max(...['#hero-t', '.hero-copy .lead', '.hero-copy .cta'].map(q => {+ const el = document.querySelector(q), rg = document.createRange(); rg.selectNodeContents(el);+ return Math.max(...[...rg.getClientRects()].map(c => c.right)); // el texto real, no la caja del bloque+ }));+ const [px] = getComputedStyle(img).objectPosition.split(' ').map(v => parseFloat(v) / 100);const s = Math.max(box.width / img.naturalWidth, box.height / img.naturalHeight);- const ox = box.left + (box.width - img.naturalWidth * s) * px, oy = box.top + (box.height - img.naturalHeight * s) * py;- return { titleRight: t.right, sharkLeft: ox + B.x0 * s, sharkRight: ox + B.x1 * s, heroRight: box.right };+ const ox = box.left + (box.width - img.naturalWidth * s) * px;+ return { textRight, sharkLeft: ox + B.x0 * s, sharkRight: ox + B.x1 * s, heroRight: box.right };}, SHARK_BOX);- assert(r.sharkLeft > r.titleRight - 10, `${w}px${side ? ' (lateral plegado)' : ''}: el tiburón (${Math.round(r.sharkLeft)}) queda bajo el título (${Math.round(r.titleRight)})`);- assert(r.sharkRight < r.heroRight + 60, `${w}px: el tiburón se sale por la derecha`);+ const tag = `${w}px${side ? ' con la barra plegada' : ''}${wide ? ' con fuente ancha' : ''}`;+ assert(r.sharkLeft > r.textRight + 8, `${tag}: el tiburón (${Math.round(r.sharkLeft)}) queda bajo el texto (${Math.round(r.textRight)})`);+ assert(r.sharkRight < r.heroRight + 24, `${tag}: la cola se sale por la derecha (${Math.round(r.sharkRight)} > ${Math.round(r.heroRight)})`);await p.close2();}});