diff --git a/2026/10/28_pesame_urda_historia.png b/2026/10/28_pesame_urda_historia.png new file mode 100644 index 0000000..e5322e9 Binary files /dev/null and b/2026/10/28_pesame_urda_historia.png differ diff --git a/kit/referencia/28_pesame_urda_historia.json b/kit/referencia/28_pesame_urda_historia.json new file mode 100644 index 0000000..4fb5364 --- /dev/null +++ b/kit/referencia/28_pesame_urda_historia.json @@ -0,0 +1,19 @@ +{ + "out": "../../_preview", + "prefix": "28_pesame_urda_historia", + "height": 1920, + "footerLeft": "UNIDAD, FE Y DESTINO", + "footerCenter": true, + "slides": [ + { + "cross": 0.06, + "halo": [ + 540, + 480, + 330 + ], + "svg": "\n\n\n\n", + "html": "
COMUNICADO · 28 DE OCTUBRE DE 2026
Accidente ferroviario
de Urda (Toledo)
Desde el Partido Nacional Hispanista expresamos nuestro más sincero pésame a los familiares y amigos de las víctimas del accidente ferroviario ocurrido esta mañana en Urda, y deseamos una pronta recuperación a todos los heridos.
Agradecemos la labor de los servicios de emergencia, los sanitarios y los vecinos que ayudan desde el primer momento.
Para cualquier consulta sobre afectados, acudid solo a los canales oficiales de Adif, Renfe e Iryo.
Ante una tragedia así, todos los españoles debemos permanecer unidos.
Descansen en paz.
" + } + ] +} \ No newline at end of file diff --git a/kit/render.mjs b/kit/render.mjs index de05187..f7725ec 100644 --- a/kit/render.mjs +++ b/kit/render.mjs @@ -1,4 +1,4 @@ -// PNH · generador de carteles 1080x1080 con el marco oficial. +// PNH · generador de carteles con el marco oficial. spec.height: 1080 (feed, por defecto) o 1920 (historia 9:16). // Uso: node render.mjs spec.json // spec = { out: "dir", prefix: "nombre", footerLeft: "29N · VOTO EN BLANCO", numbered: true, // slides: [ { html: "
...
", cross: 0.13, halo: false, footer: true } ] } @@ -29,7 +29,8 @@ function raggedBar(x0, y0, x1, y1, w) { } return 'M' + pts.map(p => p.map(v => v.toFixed(1)).join(',')).join('L') + 'Z'; } -const CROSS = raggedBar(-60, -60, 1140, 1140, 110) + raggedBar(1140, -60, -60, 1140, 110); +const H = spec.height || 1080; +const CROSS = raggedBar(-60, -60, 1140, H + 60, 110) + raggedBar(1140, -60, -60, H + 60, 110); const css = ` @font-face{font-family:Cinzel;font-weight:700;src:url(data:font/woff2;base64,${font('cinzel/files/cinzel-latin-700-normal.woff2')})} @@ -39,7 +40,7 @@ const css = ` @font-face{font-family:Garamond;font-style:italic;font-weight:500;src:url(data:font/woff2;base64,${font('eb-garamond/files/eb-garamond-latin-500-italic.woff2')})} @font-face{font-family:Garamond;font-style:italic;font-weight:600;src:url(data:font/woff2;base64,${font('eb-garamond/files/eb-garamond-latin-600-italic.woff2')})} html,body{margin:0;background:#2a0508} -.s{position:relative;width:1080px;height:1080px;overflow:hidden;color:#FBF3E4} +.s{position:relative;width:1080px;height:${H}px;overflow:hidden;color:#FBF3E4} .s>svg{position:absolute;inset:0} /* bloque de texto estándar (zona útil 96..984 x 215..930) */ .txt{position:absolute;left:96px;right:96px;top:215px;bottom:150px;display:flex;flex-direction:column;justify-content:center;gap:34px} @@ -63,22 +64,22 @@ p b,.gold{font-weight:600;color:#F2C64B} function frame(i, n, sl) { const footer = sl.footer === false ? '' : ` - -${sl.footerText || spec.footerLeft || ''} -${spec.numbered && n > 1 ? `${i} / ${n}${i < n ? ' →' : ''}` : ''}`; - return ` + +${sl.footerText || spec.footerLeft || ''} +${spec.numbered && n > 1 ? `${i} / ${n}${i < n ? ' →' : ''}` : ''}`; + return ` - + - + ${sl.halo ? `` : ''} ${sl.svg || ''} - - + + PARTIDO NACIONAL HISPANISTA @@ -93,7 +94,7 @@ ${footer} const out = path.resolve(path.dirname(process.argv[2]), spec.out || '.'); fs.mkdirSync(out, { recursive: true }); const browser = await chromium.launch({ executablePath: process.env.CHROMIUM || '/opt/pw-browsers/chromium' }); -const pg = await browser.newPage({ viewport: { width: 1080, height: 1080 }, deviceScaleFactor: spec.scale || 1 }); +const pg = await browser.newPage({ viewport: { width: 1080, height: H }, deviceScaleFactor: spec.scale || 1 }); const n = spec.slides.length, files = []; for (let i = 0; i < n; i++) { const sl = spec.slides[i]; @@ -101,7 +102,7 @@ for (let i = 0; i < n; i++) { await pg.setContent(`
${frame(i + 1, n, sl)}${html}
`); await pg.evaluate(() => document.fonts.ready); await pg.waitForTimeout(150); const f = path.join(out, `${spec.prefix || 'pnh'}${n > 1 ? '_' + (i + 1) : ''}.png`); - await pg.screenshot({ path: f, clip: { x: 0, y: 0, width: 1080, height: 1080 } }); + await pg.screenshot({ path: f, clip: { x: 0, y: 0, width: 1080, height: H } }); files.push(f); } await browser.close();