Files
deskhub/DeskHub-Webseite/tools/demo-video/capture_titles.js
T
2026-10-23 17:50:23 +00:00

35 lines
2.5 KiB
JavaScript

'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(`<!doctype html><meta charset="utf-8"><style>
html,body{margin:0;width:1440px;height:900px;overflow:hidden;font-family:Segoe UI,Arial,sans-serif;color:#fff;background:linear-gradient(135deg,#0E7FBF,#12A594)}
.c{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;text-align:center;padding:0 120px;box-sizing:border-box}
h1{font-size:92px;margin:0 0 18px;letter-spacing:-2px}h1 span{color:#FFD79A}
p{font-size:34px;margin:8px 0;opacity:.95}.small{font-size:24px;opacity:.8;margin-top:36px}
ul{list-style:none;padding:0;margin:26px 0 0;text-align:left;font-size:34px;line-height:1.6}li:before{content:"✔";margin-right:18px;color:#FFD79A}
h2{font-size:64px;margin:0}</style><div class="c">${body}</div>`);
app.whenReady().then(async () => {
const win = new BrowserWindow({ width: 1440, height: 900, show: true, useContentSize: true });
const cards = [
['00_intro', `<h1>Desk<span>Hub</span></h1><p>Das Helpdesk-System zum Selbsthosten</p><p class="small">Demo mit erfundenen Beispieldaten ${VERSION ? '· Version ' + VERSION : ''}</p>`],
['40_android', `<h2>Android-App</h2><ul><li>Neues, helles Design mit schwebender Navigation</li><li>Start, Tickets, Chat, Kunden und Verwaltung nach Rechten</li><li>Wiedervorlage, Beobachten und „Dazu passend“</li><li>Digitalen Assistenten komplett verwalten</li><li>Widget in drei Größen, hell und dunkel</li></ul>`],
['99_outro', `<h2>Alles aus einer Hand</h2><ul><li>Kundenportal mit Wissensdatenbank und Assistent</li><li>Weboberfläche, Windows-Programm und Android-App</li><li>E-Mail-Import, SLA, Regeln, Berichte, Plugins</li></ul><p class="small">Installationsanleitung und Funktionen: siehe README</p>`],
];
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();
});