'use strict'; /** tools/demo-video/capture_titles.js: erzeugt Titel-, Android- und Abspannbild für das Demo-Video. */ const { app, BrowserWindow } = require('electron'); const fs = require('fs'); const path = require('path'); const OUT = path.resolve(process.argv[2] || path.join(__dirname, 'frames')); const VERSION = process.argv[3] || ''; fs.mkdirSync(OUT, { recursive: true }); const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); const page = (body) => 'data:text/html;charset=utf-8,' + encodeURIComponent(`
Das Helpdesk-System zum Selbsthosten
Demo mit erfundenen Beispieldaten ${VERSION ? '· Version ' + VERSION : ''}
`], ['40_android', `Installationsanleitung und Funktionen: siehe README
`], ]; for (const [name, body] of cards) { await win.loadURL(page(body)); await sleep(500); fs.writeFileSync(path.join(OUT, name + '.png'), (await win.webContents.capturePage()).toPNG()); } console.log(`${cards.length} Titelbilder in ${OUT}`); app.quit(); });