← back to Wallpaper Paint Antics
series2/memes.mjs
22 lines
import fs from 'node:fs';
import path from 'node:path';
import crypto from 'node:crypto';
import {execFileSync} from 'node:child_process';
const root=import.meta.dirname,dir=path.join(root,'memes');
fs.mkdirSync(dir,{recursive:true});
const source=JSON.parse(fs.readFileSync(path.join(root,'meme-sources.json')));
const manifest=source.map(m=>{
const data=fs.readFileSync(m.generatedSource),file=m.id+'.png';
if(data.toString('hex',0,8)!=='89504e470d0a1a0a')throw Error('Invalid PNG '+m.id);
fs.copyFileSync(m.generatedSource,path.join(dir,file));
return {...m,file,width:data.readUInt32BE(16),height:data.readUInt32BE(20),bytes:data.length,sha256:crypto.createHash('sha256').update(data).digest('hex'),created_at:fs.statSync(m.generatedSource).birthtime.toISOString(),provenance:'Generated with image_gen from original Wallo and Pippa character reference. Wallpaper in these cartoons is illustrative, not a product representation.'};
});
fs.writeFileSync(path.join(dir,'manifest.json'),JSON.stringify(manifest,null,2)+'\n');
const esc=s=>s.replaceAll('&','&').replaceAll('<','<').replaceAll('"','"');
fs.writeFileSync(path.join(dir,'index.html'),`<!doctype html><html lang="en"><head><meta charset="utf-8"><link rel="icon" href="data:,"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Installer follies — Wallo & Pippa</title><style>
*{box-sizing:border-box}body{margin:0;background:#eeeae2;color:#243a3b;font:16px/1.6 system-ui,sans-serif}main{max-width:1320px;margin:auto;padding:32px 24px 80px}nav{display:flex;gap:24px;flex-wrap:wrap;border-bottom:1px solid #b9b6aa;padding-bottom:18px;font-size:13px}a{color:#284f4b;text-underline-offset:4px}h1{font:clamp(42px,6vw,80px)/1.08 Georgia,serif;letter-spacing:-.04em;margin:40px 0 16px}header p{max-width:640px}.download{display:inline-block;background:#284f4b;color:#fff;padding:12px 22px;text-decoration:none;margin:8px 0 32px}.memes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:42px 26px}figure{margin:0}figure img{display:block;width:100%;height:auto;box-shadow:0 8px 25px #243a3b14}figcaption{display:flex;justify-content:space-between;gap:14px;padding:12px 0;font-size:14px}.note{margin-top:40px;font-size:13px;max-width:720px}@media(max-width:680px){.memes{grid-template-columns:1fr}main{padding:24px 18px 50px}}
</style></head><body><main><nav><a href="../watch.html">Wallo’s wallcovering presentation</a><a href="../../watch.html">Original animated shorts</a><span>WALLO & PIPPA / INSTALLER FOLLIES</span></nav><header><h1>It was going so well.</h1><p>Ten familiar decorating disasters. Paste with ambitions. Ladders with parking problems. One last strip with an attitude.</p><a class="download" href="installer-follies-10-memes.zip" download>Download all 10 memes · ZIP</a></header><div class="memes">${manifest.map((m,i)=>`<figure id="${m.id}"><a href="${m.file}" target="_blank" rel="noopener" aria-label="Open meme ${i+1} full size"><img src="${m.file}" width="${m.width}" height="${m.height}" alt="${esc(m.top+' '+m.bottom)}" loading="${i<2?'eager':'lazy'}"></a><figcaption><span>${String(i+1).padStart(2,'0')} / ${m.width} × ${m.height}</span><a href="${m.file}" download>Download PNG</a></figcaption></figure>`).join('')}</div><p class="note">Original illustrated comedy featuring Wallo & Pippa. Wallpaper in these cartoons is illustrative. For real products from Designer Wallcoverings, see Wallo’s presentation. Created September 5, 2026.</p></main></body></html>`);
fs.writeFileSync(path.join(dir,'README.txt'),'Wallo & Pippa — Installer Follies\nTen original square PNG memes.\n\n'+manifest.map(m=>m.file+'\n'+m.top+'\n'+m.bottom).join('\n\n')+'\n\nCreated September 5, 2026. Original generated illustrations; wallpaper is illustrative.\n');
execFileSync('zip',['-q','-j',path.join(dir,'installer-follies-10-memes.zip'),...manifest.map(m=>path.join(dir,m.file)),path.join(dir,'README.txt')]);
console.log('Packaged '+manifest.length+' original memes and ZIP.');