Files

19 lines
1.9 KiB
JavaScript

// PassiveDrip share image (it had none): art + title in the same clean style as the InstantAdPay / PolHunter cards.
import pkg from 'file:///D:/Projects/MarketingAgent/qa-tester/node_modules/playwright/index.js';
import fs from 'node:fs';
const { chromium } = pkg;
const D = 'D:/Projects/HighRisk/stackpol/mockup/og/';
const img = 'data:image/png;base64,' + fs.readFileSync(D + 'pd-art.png').toString('base64');
const b = await chromium.launch(); const p = await b.newPage({ viewport: { width: 1200, height: 630 } });
await p.setContent(`<!doctype html><html><head><link href="https://fonts.googleapis.com/css2?family=Sora:wght@700;800&family=Manrope:wght@500;600&display=swap" rel="stylesheet">
<style>*{margin:0;box-sizing:border-box}body{width:1200px;height:630px;position:relative;overflow:hidden;font-family:Manrope,sans-serif;color:#fff}
.bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.shade{position:absolute;inset:0;background:linear-gradient(90deg,rgba(10,8,30,.9) 0%,rgba(10,8,30,.7) 38%,rgba(10,8,30,0) 62%)}
.t{position:absolute;left:62px;top:0;bottom:0;width:560px;display:flex;flex-direction:column;justify-content:center;gap:16px}
.eb{font:600 20px Manrope;letter-spacing:.16em;text-transform:uppercase;color:#7fe3d6}
h1{font:800 84px/1 Sora,sans-serif;letter-spacing:-.02em}h1 em{font-style:normal;color:#b794ff}
.s{font:600 30px/1.3 Manrope;color:#e9e4ff}.u{font:600 18px Manrope;color:#c9c2e8;margin-top:6px}</style></head>
<body><img class="bg" src="${img}"><div class="shade"></div><div class="t"><div class="eb">Earn · faucet · offers</div><h1>Passive<em>Drip</em></h1><div class="s">Earn every day.<br>Paid out in POL to your wallet.</div><div class="u">passivedrip.com</div></div></body></html>`);
await p.evaluate(() => document.fonts.ready); await p.waitForTimeout(400);
await p.screenshot({ path: D + 'pd.src', type: 'jpeg', quality: 88 });
await b.close(); console.log('ok');