20N: carrusel José Antonio y Lorca (propuesta); kit admite {{IMG:archivo}}
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K9e6XVaQWrLD3vpXscNvs8
This commit is contained in:
parent
98fafe7b0e
commit
508fd41c24
11 changed files with 51 additions and 2 deletions
BIN
kit/assets/japr.jpg
Normal file
BIN
kit/assets/japr.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 97 KiB |
BIN
kit/assets/lorca.jpg
Normal file
BIN
kit/assets/lorca.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
48
kit/referencia/20_jose_antonio_lorca.json
Normal file
48
kit/referencia/20_jose_antonio_lorca.json
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"out": "../../_preview",
|
||||
"prefix": "20_jose_antonio_lorca",
|
||||
"footerLeft": "20 DE NOVIEMBRE",
|
||||
"numbered": true,
|
||||
"css": ".lead{font-family:Garamond;font-style:italic;font-size:44px;line-height:1.25;color:#F2C64B;text-align:center} .stat{font-family:Cinzel;font-weight:900;font-size:150px;line-height:1;color:#F2C64B;text-shadow:0 4px 14px rgba(0,0,0,.5)} .src{font-family:Garamond;font-style:italic;font-size:24px;color:#D9A63A;opacity:.85} .ph{position:absolute;left:360px;top:165px;width:360px;height:450px;border:3px solid #D9A63A;box-shadow:0 0 0 10px rgba(75,0,0,.6),0 0 0 12px #D9A63A,0 18px 40px rgba(0,0,0,.6);object-fit:cover;filter:sepia(.25) contrast(1.05)} .nm{font-family:Cinzel;font-weight:900;font-size:54px;line-height:1.08;color:#FBF3E4;text-shadow:0 3px 10px rgba(0,0,0,.5)} .yr{font-family:Cinzel;font-weight:700;font-size:28px;letter-spacing:6px;color:#D9A63A;margin-top:12px} .lem{font-family:Garamond;font-style:italic;font-size:36px;color:#F2C64B;margin-top:16px} .ph2{float:right;width:230px;height:288px;margin:0 0 10px 30px;border:2px solid #D9A63A;object-fit:cover;filter:sepia(.25)} .names{font-family:Garamond;font-size:34px;line-height:1.35;color:#FBF3E4} .names b{font-family:Cinzel;font-size:24px;letter-spacing:4px;color:#D9A63A;font-weight:700}",
|
||||
"slides": [
|
||||
{
|
||||
"cross": 0.18,
|
||||
"halo": [
|
||||
540,
|
||||
400,
|
||||
360
|
||||
],
|
||||
"html": "<img class='ph' src='{{IMG:japr.jpg}}'><div class='center' style='top:660px'><div class='kick' style='font-size:24px;letter-spacing:7px'>20 DE NOVIEMBRE DE 1936</div><div class='nm' style='margin-top:14px'>JOSÉ ANTONIO<br>PRIMO DE RIVERA</div><div class='yr'>1903 · 1936</div><div class='lem'>Víctima de una guerra entre hermanos.</div></div>"
|
||||
},
|
||||
{
|
||||
"html": "<div class='txt' style='gap:26px'><div class='kick'>ALICANTE, 20 DE NOVIEMBRE DE 1936</div><h1>Tenía 33 años.</h1><p>Abogado y político madrileño, de <b>raíces jerezanas</b>. Llevaba preso desde marzo de 1936. Lo juzgó un <b>tribunal popular de la República</b>, que lo condenó a muerte. Fue fusilado al amanecer en el patio de la prisión de Alicante.</p><div class='src'>Fuente: Real Academia de la Historia, Diccionario Biográfico.</div></div>"
|
||||
},
|
||||
{
|
||||
"cross": 0.18,
|
||||
"halo": [
|
||||
540,
|
||||
400,
|
||||
360
|
||||
],
|
||||
"html": "<img class='ph' src='{{IMG:lorca.jpg}}'><div class='center' style='top:660px'><div class='kick' style='font-size:24px;letter-spacing:7px'>AGOSTO DE 1936</div><div class='nm' style='margin-top:14px'>FEDERICO<br>GARCÍA LORCA</div><div class='yr'>1898 · 1936</div><div class='lem'>Víctima de una guerra entre hermanos.</div></div>"
|
||||
},
|
||||
{
|
||||
"html": "<div class='txt' style='gap:26px'><div class='kick'>VÍZNAR, AGOSTO DE 1936</div><h1>Tenía 38 años.</h1><p>Poeta y dramaturgo de Fuente Vaqueros, Granada. Lo detuvieron en Granada en plena guerra y lo mataron en el camino de Víznar a Alfacar. <b>Su cuerpo nunca ha aparecido.</b></p><div class='src'>Fuente: Real Academia de la Historia, Diccionario Biográfico.</div></div>"
|
||||
},
|
||||
{
|
||||
"html": "<div class='txt' style='gap:30px'><div class='kick'>DOS JÓVENES, DOS BANDOS</div><h1 style='font-size:50px'>A José Antonio lo condenó un tribunal de la República.</h1><h1 style='font-size:50px'>A Lorca lo mataron el odio y las rencillas de una guerra entre vecinos.</h1><p>Se conocieron, y cuentan quienes los trataron que se admiraban. Antes que la ideología, ponían <b>la cultura</b>.</p></div>"
|
||||
},
|
||||
{
|
||||
"html": "<div class='txt' style='gap:24px'><div class='kick'>LO QUE PERDIMOS</div><h1 style='font-size:52px'>La guerra se llevó lo mejor de una generación.</h1><div class='names'><b>FUSILADOS</b><br>García Lorca, Ramiro de Maeztu, Pedro Muñoz Seca…</div><div class='names'><b>EN EL EXILIO</b><br>Antonio Machado, Juan Ramón Jiménez, Ortega y Gasset…</div><p>De un lado y del otro. Todos eran <b>España</b>.</p></div>"
|
||||
},
|
||||
{
|
||||
"cross": 0.2,
|
||||
"halo": [
|
||||
540,
|
||||
470,
|
||||
300
|
||||
],
|
||||
"html": "<img src='{{LOGO}}' style='position:absolute;left:390px;top:220px;width:300px'><div class='center' style='top:570px;left:110px;right:110px'><div class='kick' style='font-size:26px;letter-spacing:7px'>NI DE UN BANDO NI DE OTRO</div><div class='big' style='font-size:72px;margin-top:18px'>DE ESPAÑA</div><div class='lem' style='margin-top:22px;font-size:38px'>Recordamos a todas las víctimas.<br>Sin rencor.</div></div>"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
// Uso: node render.mjs spec.json
|
||||
// spec = { out: "dir", prefix: "nombre", footerLeft: "29N · VOTO EN BLANCO", numbered: true,
|
||||
// slides: [ { html: "<div class='txt'>...</div>", cross: 0.13, halo: false, footer: true } ] }
|
||||
// En el html se pueden usar {{LOGO}} y {{HORSE}} (data URIs) y las clases CSS de abajo.
|
||||
// En el html se pueden usar {{LOGO}}, {{HORSE}} y {{IMG:archivo}} (data URIs de assets/) y las clases CSS de abajo.
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
|
@ -98,7 +98,8 @@ const pg = await browser.newPage({ viewport: { width: 1080, height: H }, deviceS
|
|||
const n = spec.slides.length, files = [];
|
||||
for (let i = 0; i < n; i++) {
|
||||
const sl = spec.slides[i];
|
||||
const html = (sl.html || '').replaceAll('{{LOGO}}', LOGO).replaceAll('{{HORSE}}', HORSE);
|
||||
const html = (sl.html || '').replaceAll('{{LOGO}}', LOGO).replaceAll('{{HORSE}}', HORSE)
|
||||
.replace(/\{\{IMG:([^}]+)\}\}/g, (_, f) => `data:image/${f.endsWith('.png') ? 'png' : 'jpeg'};base64,` + asset(f));
|
||||
await pg.setContent(`<!doctype html><html><head><meta charset="utf-8"><style>${css}${spec.css || ''}</style></head><body><div class="s">${frame(i + 1, n, sl)}${html}</div></body></html>`);
|
||||
await pg.evaluate(() => document.fonts.ready); await pg.waitForTimeout(150);
|
||||
const f = path.join(out, `${spec.prefix || 'pnh'}${n > 1 ? '_' + (i + 1) : ''}.png`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue