Kit noticias: variante sin banda con logo en esquina
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K9e6XVaQWrLD3vpXscNvs8
This commit is contained in:
parent
8cc5e43698
commit
013f068074
6 changed files with 37 additions and 10 deletions
|
|
@ -2,7 +2,8 @@
|
|||
// Uso: node noticia.mjs spec.json
|
||||
// spec = { out: "dir", prefix: "nombre", numbered: true,
|
||||
// slides: [ { photo: "ruta.jpg", pos: "50% 40%", kicker: "JEREZ · 30 OCT", title: "Titular",
|
||||
// sub: "Entradilla opcional", credit: "Foto: Diario de Jerez", ribbon: false, html: "" } ] }
|
||||
// sub: "Entradilla opcional", credit: "Foto: Diario de Jerez", ribbon: false, band: true, html: "" } ] }
|
||||
// band: false → sin banda: foto a toda la lámina y el logo pequeño en la esquina (estilo del pésame por el papa Francisco).
|
||||
// Una lámina sin photo usa fondo granate liso (para el cierre con logo o texto).
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
|
@ -44,7 +45,7 @@ h1 b{color:#F2C64B}
|
|||
.sub b{color:#F2C64B;font-weight:500}
|
||||
.cred{position:absolute;right:22px;top:162px;font-family:Garamond;font-style:italic;font-size:20px;color:#FBF3E4;opacity:.85;text-shadow:0 1px 4px #000;writing-mode:vertical-rl;transform:rotate(180deg);transform-origin:center}
|
||||
.num{position:absolute;right:70px;bottom:30px;font-family:Cinzel;font-weight:700;font-size:20px;letter-spacing:3px;color:#D9A63A}
|
||||
.ribbon{position:absolute;right:60px;top:200px;width:150px}
|
||||
.corner{position:absolute;left:34px;top:30px;width:150px;filter:drop-shadow(0 3px 8px rgba(0,0,0,.6))} .full{top:0} .ribbon{position:absolute;right:60px;top:200px;width:150px}
|
||||
`;
|
||||
|
||||
const browser = await chromium.launch({ executablePath: '/opt/pw-browsers/chromium', args: ['--no-sandbox'] });
|
||||
|
|
@ -55,8 +56,8 @@ const N = spec.slides.length;
|
|||
for (const [i, sl] of spec.slides.entries()) {
|
||||
const body = (sl.html || '').replaceAll('{{LOGO}}', LOGO).replaceAll('{{HORSE}}', HORSE);
|
||||
const html = `<style>${css}${spec.css || ''}</style><div class="s">
|
||||
${sl.photo ? `<div class="ph" style="background-image:url(${img(sl.photo)});background-position:${sl.pos || '50% 40%'}"></div><div class="fade"></div>` : ''}
|
||||
<div class="band"><div class="hd"><span>PARTIDO NACIONAL</span><img src="${HORSE}"><span>HISPANISTA</span></div></div>
|
||||
${sl.photo ? `<div class="ph${sl.band === false ? ' full' : ''}" style="background-image:url(${img(sl.photo)});background-position:${sl.pos || '50% 40%'}"></div><div class="fade"></div>` : ''}
|
||||
${sl.band === false ? `<img class="corner" src="${LOGO}">` : `<div class="band"><div class="hd"><span>PARTIDO NACIONAL</span><img src="${HORSE}"><span>HISPANISTA</span></div></div>`}
|
||||
${sl.credit ? `<div class="cred">${sl.credit}</div>` : ''}
|
||||
${sl.ribbon ? `<svg class="ribbon" viewBox="0 0 100 160"><path d="M50 8C30 8 22 30 30 52L62 152 80 140 50 62C60 40 72 30 70 20 66 10 58 8 50 8Z" fill="#111"/><path d="M50 8C70 8 78 30 70 52L38 152 20 140 50 62C40 40 28 30 30 20 34 10 42 8 50 8Z" fill="#000"/></svg>` : ''}
|
||||
${sl.title || sl.kicker ? `<div class="cap">${sl.kicker ? `<div class="kick">${sl.kicker}</div>` : ''}${sl.title ? `<h1>${sl.title}</h1>` : ''}${sl.sub ? `<div class="sub">${sl.sub}</div>` : ''}</div>` : ''}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue