Text to vertical video in 100+ styles: AI codes each scene (HTML/SVG/WebGL), renders a 9:16 MP4 with music and English/Vietnamese voice. MCP, CLI and REST for AI agents.
// Chụp từng mục ở 375px (ảnh cả trang trên mobile dài quá giới hạn của Chrome).
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import puppeteer from 'puppeteer-core';
const OUT = path.join(path.dirname(path.dirname(fileURLToPath(import.meta.url))), 'shots');
const URL = process.argv[2] || 'http://127.0.0.1:8765/';
const chrome = ['C:/Program Files/Google/Chrome/Application/chrome.exe', 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe', path.join(process.env.LOCALAPPDATA || '', 'Google/Chrome/Application/chrome.exe')].find((p) => fs.existsSync(p));
const b = await puppeteer.launch({ executablePath: chrome, headless: true });
for (const scheme of ['light', 'dark']) {
const p = await b.newPage();
await p.setViewport({ width: 375, height: 812, deviceScaleFactor: 2, isMobile: true, hasTouch: true });
await p.emulateMediaFeatures([{ name: 'prefers-color-scheme', value: scheme }]);
await p.goto(URL, { waitUntil: 'networkidle2' });
for (const id of ['mau', 'cach', 'agent', 'cai']) {
await p.$eval('#' + id, (el) => el.scrollIntoView());
await new Promise((r) => setTimeout(r, 1200));
await p.screenshot({ path: path.join(OUT, `375-${scheme}-${id}.png`) });
}
await p.close();
}
await b.close();
console.log('ok');