mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-17 20:51:19 -08:00
Release 3.1.1: relicense under Apache 2.0 and rewrite the README and site around the six steps
AI Assisted
This commit is contained in:
1 parent
e9679c47b9
commit
26a87bec32
73 files changed
+1998
-1880
No files matched your search
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env node
|
||||
// Writes the 1280px-wide variants of the landing page's hero pictures next to
|
||||
// the 2560px originals (`<name>-1280.webp`), for the page's srcset. Dev-only.
|
||||
//
|
||||
// node scripts/make-site-images.mjs [--browser <path>]
|
||||
//
|
||||
// Rerun it after capture-screenshots.mjs. Playwright has no WebP encoder of
|
||||
// its own, so the browser's canvas does the resize and the WebP export.
|
||||
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { launchBrowser } from "./browser.mjs";
|
||||
|
||||
const ROOT = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
|
||||
const DIR = path.join(ROOT, "docs", "screenshots");
|
||||
const HERO = ["dashboard-plan-dark", "question-dark", "build-dark", "signoff-dark"];
|
||||
|
||||
const flag = process.argv.indexOf("--browser");
|
||||
const browser = await launchBrowser(flag > 0 ? { executablePath: process.argv[flag + 1] } : {});
|
||||
try {
|
||||
const page = await browser.newPage();
|
||||
for (const name of HERO) {
|
||||
const src = "data:image/webp;base64," + fs.readFileSync(path.join(DIR, `${name}.webp`)).toString("base64");
|
||||
const data = await page.evaluate(async (url) => {
|
||||
const img = new Image();
|
||||
img.src = url;
|
||||
await img.decode();
|
||||
const c = document.createElement("canvas");
|
||||
c.width = 1280;
|
||||
c.height = Math.round((img.naturalHeight * 1280) / img.naturalWidth);
|
||||
const g = c.getContext("2d");
|
||||
g.imageSmoothingQuality = "high";
|
||||
g.drawImage(img, 0, 0, c.width, c.height);
|
||||
return c.toDataURL("image/webp", 0.85).split(",")[1];
|
||||
}, src);
|
||||
const out = path.join(DIR, `${name}-1280.webp`);
|
||||
fs.writeFileSync(out, Buffer.from(data, "base64"));
|
||||
console.log(`${path.basename(out)} ${Math.round(fs.statSync(out).size / 1024)} KB`);
|
||||
}
|
||||
} finally {
|
||||
await browser.close();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env node
|
||||
// Renders scripts/social-card.html to docs/social-card.png (1200x630), the
|
||||
// image the landing page's og:image points at (twitter:card falls back to it). Dev-only.
|
||||
//
|
||||
// node scripts/make-social-card.mjs [--browser <path>]
|
||||
//
|
||||
// Rerun it after docs/screenshots/signoff-dark.webp changes. Needs
|
||||
// playwright-core (a root devDependency) and a local Chrome or Edge.
|
||||
|
||||
import path from "node:path";
|
||||
import { fileURLToPath, pathToFileURL } from "node:url";
|
||||
import { launchBrowser } from "./browser.mjs";
|
||||
|
||||
const ROOT = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
|
||||
const flag = process.argv.indexOf("--browser");
|
||||
const browser = await launchBrowser(flag > 0 ? { executablePath: process.argv[flag + 1] } : {});
|
||||
try {
|
||||
const page = await browser.newPage({ viewport: { width: 1200, height: 630 }, deviceScaleFactor: 1 });
|
||||
await page.goto(pathToFileURL(path.join(ROOT, "scripts", "social-card.html")).href);
|
||||
await page.evaluate(() => document.fonts.ready);
|
||||
await page.waitForFunction(() => [...document.images].every((i) => i.complete && i.naturalWidth > 0));
|
||||
const out = path.join(ROOT, "docs", "social-card.png");
|
||||
await page.screenshot({ path: out, clip: { x: 0, y: 0, width: 1200, height: 630 } });
|
||||
console.log(`wrote ${path.relative(ROOT, out)}`);
|
||||
} finally {
|
||||
await browser.close();
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Plan2Code social card</title>
|
||||
<style>
|
||||
@font-face { font-family: "Archivo"; src: url("../docs/fonts/archivo-latin.woff2") format("woff2"); font-weight: 300 900; font-stretch: 62% 125%; }
|
||||
* { box-sizing: border-box; margin: 0; }
|
||||
html, body { width: 1200px; height: 630px; overflow: hidden; }
|
||||
body {
|
||||
background: radial-gradient(900px 500px at 85% 10%, #1a4596 0%, #0b2150 55%, #071634 100%);
|
||||
font-family: "Archivo", system-ui, sans-serif;
|
||||
color: #eef4ff;
|
||||
position: relative;
|
||||
}
|
||||
.grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(170,200,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(170,200,255,.08) 1px, transparent 1px); background-size: 40px 40px; }
|
||||
.copy { position: absolute; left: 64px; top: 120px; width: 500px; }
|
||||
.brand { font-size: 26px; font-weight: 700; letter-spacing: .02em; color: #b9cbee; margin-bottom: 28px; }
|
||||
h1 { font-size: 76px; line-height: 1.02; font-weight: 800; font-stretch: 100%; letter-spacing: -.01em; }
|
||||
h1 span { display: block; }
|
||||
h1 .mark { color: #ffd45e; }
|
||||
p { margin-top: 28px; font-size: 26px; line-height: 1.35; color: #b9cbee; }
|
||||
.shot { position: absolute; left: 620px; top: 150px; width: 700px; border-radius: 14px; border: 1px solid rgba(170,200,255,.35); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
|
||||
</style>
|
||||
<div class="grid"></div>
|
||||
<div class="copy">
|
||||
<div class="brand">Plan2Code</div>
|
||||
<h1><span>Plan it.</span><span>Approve it.</span><span class="mark">Let it build.</span></h1>
|
||||
<p>Plan, approve and build with your AI agent, on one page.</p>
|
||||
</div>
|
||||
<img class="shot" src="../docs/screenshots/signoff-dark.webp" alt="">
|
||||
Reference in new issue
Block a user