// Build an animated portrait promo from the captured screenshots and record it // to webm with Playwright. (ffmpeg then encodes it to mp4 — see the run step.) const { chromium } = require("playwright"); const fs = require("fs"); const path = require("path"); const ASSETS = path.join(__dirname, "..", "store-assets"); const OUT = path.join(__dirname, "promo"); fs.mkdirSync(OUT, { recursive: true }); const b64 = (f) => "data:image/png;base64," + fs.readFileSync(path.join(ASSETS, f)).toString("base64"); const icon = b64("icon-512.png"); // type: intro | slide | outro const SLIDES = [ { type: "intro", title: "برگ وسط", sub: "بازی حکم آنلاین ایرانی" }, { type: "slide", img: b64("01-home.png"), cap: "سه حالت بازی در یک اپ" }, { type: "slide", img: b64("06-game.png"), cap: "حکمِ واقعی، کارتهای زیبا" }, { type: "slide", img: b64("02-leaderboard.png"), cap: "در لیگها بالا برو و رکورد بزن" }, { type: "slide", img: b64("04-shop.png"), cap: "آواتار و آیتمهای ویژه" }, { type: "slide", img: b64("03-achievements.png"), cap: "دستاوردها و جایزهی روزانه" }, { type: "slide", img: b64("05-profile.png"), cap: "پروفایل کامل خودت را بساز" }, { type: "outro", title: "همین حالا رایگان نصب کن!", sub: "برگ وسط", icon: true }, ]; const DUR = 2600; // ms per slide const FADE = 700; const slideHtml = (s, i) => { if (s.type === "intro" || s.type === "outro") return `
`; return ``; }; const html = `