app-store-screenshots by parthjadhav/app-store-screenshots
npx skills add https://github.com/parthjadhav/app-store-screenshots --skill app-store-screenshots构建一个 Next.js 页面,将 iOS App Store 截图渲染为广告(而非 UI 展示),并通过 html-to-image 以苹果要求的分辨率导出。截图是 App Store 上最重要的转化资产。
截图是广告,不是文档。 每张截图只推销一个想法。如果你在展示 UI,那你就做错了——你应该推销一种感觉、一种结果,或者解决一个痛点。
在编写任何代码之前,向用户提出以下所有问题。在获得答案之前不要继续:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
根据用户的风格方向、品牌颜色和 App 美学,决定:
ar, he, fa, ur),则有意镜像布局,而不仅仅是翻译文本重要提示: 如果用户在此过程中的任何阶段给出额外说明,请遵循。用户说明始终优先于技能默认设置。
检查可用的包管理器,使用此优先级:bun > pnpm > yarn > npm
# 按顺序检查
which bun && echo "use bun" || which pnpm && echo "use pnpm" || which yarn && echo "use yarn" || echo "use npm"
# 使用 bun:
bunx create-next-app@latest . --typescript --tailwind --app --src-dir --no-eslint --import-alias "@/*"
bun add html-to-image
# 使用 pnpm:
pnpx create-next-app@latest . --typescript --tailwind --app --src-dir --no-eslint --import-alias "@/*"
pnpm add html-to-image
# 使用 yarn:
yarn create next-app . --typescript --tailwind --app --src-dir --no-eslint --import-alias "@/*"
yarn add html-to-image
# 使用 npm:
npx create-next-app@latest . --typescript --tailwind --app --src-dir --no-eslint --import-alias "@/*"
npm install html-to-image
该技能包含一个预测量好的 iPhone 模型 mockup.png(与此 SKILL.md 文件位于同一目录)。将其复制到项目的 public/ 目录。模型文件与此技能文件位于同一目录。不需要 iPad 模型——iPad 框架仅使用 CSS。
project/
├── public/
│ ├── mockup.png # iPhone 框架(随技能提供)
│ ├── app-icon.png # 用户的 App 图标
│ ├── screenshots/ # iPhone App 截图
│ │ ├── home.png
│ │ ├── feature-1.png
│ │ └── ...
│ └── screenshots-ipad/ # iPad App 截图(可选)
│ ├── home.png
│ ├── feature-1.png
│ └── ...
├── src/app/
│ ├── layout.tsx # 字体设置
│ └── page.tsx # 截图生成器(单个文件)
└── package.json
注意: 不需要 iPad 模型 PNG 文件——iPad 框架使用 CSS 渲染(见下文 iPad 模型组件)。
多语言: 将截图按语言嵌套在对应的语言环境文件夹下。生成器切换 base 路径;所有幻灯片图片的 src 保持不变。
└── screenshots/
├── en/
│ ├── home.png
│ ├── feature-1.png
│ └── ...
├── de/
│ └── ...
└── {locale}/
如果 iPad 截图也进行了本地化,则镜像相同的语言环境结构:
└── screenshots-ipad/
├── en/
├── de/
└── {locale}/
整个生成器是一个单独的 page.tsx 文件。 没有路由,没有额外的布局,没有 API 路由。
添加 LOCALES 数组和语言环境标签到工具栏。每个幻灯片的 src 都使用 base——没有硬编码的路径:
const LOCALES = ["en", "de", "es"] as const; // 使用定义的语言
type Locale = typeof LOCALES[number];
// 在 ScreenshotsPage 中:
const [locale, setLocale] = useState<Locale>("en");
const base = `/screenshots/${locale}`;
// 工具栏标签:
{LOCALES.map(l => (
<button key={l} onClick={() => setLocale(l)}
style={{ fontWeight: locale === l ? 700 : 400 }}>
{l.toUpperCase()}
</button>
))}
// 在每个幻灯片中——单语言和多语言之间保持不变:
<Phone src={`${base}/home.png`} alt="Home" />
添加一个小的配置层,以便用户无需重写幻灯片组件即可切换主题和语言环境:
const LOCALES = ["en", "de", "ar"] as const;
type Locale = typeof LOCALES[number];
const RTL_LOCALES = new Set<Locale>(["ar"]);
const THEMES = {
"clean-light": {
bg: "#F6F1EA",
fg: "#171717",
accent: "#5B7CFA",
muted: "#6B7280",
},
"dark-bold": {
bg: "#0B1020",
fg: "#F8FAFC",
accent: "#8B5CF6",
muted: "#94A3B8",
},
"warm-editorial": {
bg: "#F7E8DA",
fg: "#2B1D17",
accent: "#D97706",
muted: "#7C5A47",
},
} as const;
type ThemeId = keyof typeof THEMES;
const COPY_BY_LOCALE = {
en: { hero: "Build better habits" },
de: { hero: "Baue bessere Gewohnheiten auf" },
ar: { hero: "ابنِ عادات أفضل" },
} satisfies Record<Locale, { hero: string }>;
const [themeId, setThemeId] = useState<ThemeId>("clean-light");
const [locale, setLocale] = useState<Locale>("en");
const theme = THEMES[themeId];
const copy = COPY_BY_LOCALE[locale];
const isRtl = RTL_LOCALES.has(locale);
在所有地方使用主题令牌,而不是硬编码颜色。对于 RTL 语言环境,在截图画布上设置 dir={isRtl ? "rtl" : "ltr"},并有意识地镜像非对称布局。
支持自动化查询参数:
// ?locale=de&theme=dark-bold&device=ipad
// src/app/layout.tsx
import { YourFont } from "next/font/google"; // 使用用户指定的任何字体
const font = YourFont({ subsets: ["latin"] });
export default function Layout({ children }: { children: React.ReactNode }) {
return <html><body className={font.className}>{children}</body></html>;
}
根据用户请求的幻灯片数量调整此框架。并非所有槽位都是必需的——选择适合的:
| 槽位 | 目的 | 备注 |
|---|---|---|
| #1 | 英雄 / 主要优势 | App 图标 + 标语 + 主屏幕。这是大多数人唯一看到的。 |
| #2 | 差异化 | 与竞争对手相比,此 App 的独特之处 |
| #3 | 生态系统 | 小组件、扩展、手表——超越主 App。如果不适用则跳过。 |
| #4+ | 核心功能 | 每张幻灯片一个功能,最重要的优先 |
| 倒数第二张 | 信任信号 | 身份/工艺——"专为 [X] 人群打造" |
| 最后一张 | 更多功能 | 列出额外功能的药丸状标签 + 即将推出。如果功能较少则跳过。 |
规则:
在构建布局之前,获得所有标题的批准。糟糕的文案会毁掉好的设计。
<br /> 控制换行位置。| 类型 | 作用 | 示例 |
|---|---|---|
| 描绘一个时刻 | 你想象自己正在做这件事 | "无需打开 App 即可查看咖啡状态。" |
| 陈述一个结果 | 之后你的生活是什么样子 | "为每一杯购买的咖啡建立一个家。" |
| 解决一个痛点 | 指出一个问题并解决它 | "绝不浪费一袋好咖啡。" |
在构建任何布局之前,使用这些模式重写薄弱的文案:
| 薄弱 | 更好 | 胜出原因 |
|---|---|---|
| Track habits and stay motivated | Keep your streak alive | 一个想法,更快解析 |
| Organize tasks with AI summaries and smart sorting | Turn notes into next steps | 结果导向,行话更少 |
| Save recipes with tags, filters, and favorites | Find dinner fast | 推销用户利益,而非 UI |
| Manage budgets and never miss payments | See where money goes | 更清晰的承诺,没有双重主张 |
| AI-powered wellness support | Feel calmer tonight | 具体的情感结果 |
如果用户给出薄弱或未充分说明的请求,请将其内部重塑为类似以下内容:
Build App Store screenshots for my habit tracker.
The app helps people stay consistent with simple daily routines.
I want 6 slides, clean/minimal style, warm neutrals, and a calm premium feel.
Generate App Store screenshots for my personal finance app.
The app's main strengths are fast expense capture, clear monthly trends, and shared budgets.
I want a sharp, modern style with high contrast and 7 slides.
Create exportable App Store screenshots for my AI note-taking app.
The core value is turning messy voice notes into clean summaries and action items.
I want bold copy, dark backgrounds, and a polished tech-forward look.
模式是:
page.tsx
├── 常量 (IPHONE_W/H, IPAD_W/H, SIZES, 设计令牌)
├── LOCALES / RTL_LOCALES / THEMES / COPY_BY_LOCALE
├── Phone 组件 (带有屏幕覆盖层的模型 PNG)
├── IPad 组件 (仅 CSS 框架,带有屏幕覆盖层)
├── Caption 组件 (标签 + 标题,接受 canvasW 用于缩放)
├── 装饰性组件 (斑点、光晕、形状——基于风格方向)
├── iPhoneSlide1..N 组件 (每张幻灯片一个)
├── iPadSlide1..N 组件 (相同的设计,针对 iPad 比例调整)
├── IPHONE_SCREENSHOTS / IPAD_SCREENSHOTS 数组 (注册表)
├── ScreenshotPreview (ResizeObserver 缩放 + 悬停导出)
└── ScreenshotsPage (网格 + 语言环境标签 + 主题标签 + 设备切换 + 导出逻辑)
const IPHONE_SIZES = [
{ label: '6.9"', w: 1320, h: 2868 },
{ label: '6.5"', w: 1284, h: 2778 },
{ label: '6.3"', w: 1206, h: 2622 },
{ label: '6.1"', w: 1125, h: 2436 },
] as const;
以最大尺寸(1320x2868)进行设计,并缩小导出。
如果用户提供 iPad 截图,也生成 iPad App Store 截图:
const IPAD_SIZES = [
{ label: '13" iPad', w: 2064, h: 2752 },
{ label: '12.9" iPad Pro', w: 2048, h: 2732 },
] as const;
以 2064x2752 设计 iPad 幻灯片并缩小。iPad 截图是可选的,但推荐使用——对于仅限 iPad 的 App 是必需的,并且可以提高通用 App 的列表质量。
当同时支持两种设备时,在工具栏中尺寸下拉菜单旁边添加一个切换按钮(iPhone / iPad)。尺寸下拉菜单应根据所选设备在 iPhone 和 iPad 尺寸之间切换。支持 ?device=ipad URL 参数用于无头/自动化捕获工作流。
将语言环境和主题选择器放在与设备 + 尺寸相同的工具栏中。这会将生成器变成一个小型控制面板,而不是一次性页面。
locale 切换截图文件夹和文案字典theme 仅切换设计令牌device 切换 iPhone/iPad 幻灯片注册表size 仅切换导出分辨率每张截图都以全分辨率(1320x2868px)设计。存在两个副本:
transform: scale() 缩放以适应网格卡片position: absolute; left: -9999px 在屏幕外以真实分辨率渲染包含的 mockup.png 具有以下预测量值:
const MK_W = 1022; // 模型图像宽度
const MK_H = 2082; // 模型图像高度
const SC_L = (52 / MK_W) * 100; // 屏幕左侧偏移 %
const SC_T = (46 / MK_H) * 100; // 屏幕顶部偏移 %
const SC_W = (918 / MK_W) * 100; // 屏幕宽度 %
const SC_H = (1990 / MK_H) * 100; // 屏幕高度 %
const SC_RX = (126 / 918) * 100; // 边框半径 x %
const SC_RY = (126 / 1990) * 100; // 边框半径 y %
function Phone({ src, alt, style, className = "" }: {
src: string; alt: string; style?: React.CSSProperties; className?: string;
}) {
return (
<div className={`relative ${className}`}
style={{ aspectRatio: `${MK_W}/${MK_H}`, ...style }}>
<img src="/mockup.png" alt=""
className="block w-full h-full" draggable={false} />
<div className="absolute z-10 overflow-hidden"
style={{
left: `${SC_L}%`, top: `${SC_T}%`,
width: `${SC_W}%`, height: `${SC_H}%`,
borderRadius: `${SC_RX}% / ${SC_RY}%`,
}}>
<img src={src} alt={alt}
className="block w-full h-full object-cover object-top"
draggable={false} />
</div>
</div>
);
}
与使用预测量 PNG 框架的 iPhone 模型不同,iPad 使用仅 CSS 框架。这避免了需要单独的模型资源,并且在任何分辨率下都看起来干净。
关键尺寸: 框架宽高比必须为 770/1000,以便内部屏幕区域(宽度的 92% × 高度的 94.4%)匹配 iPad 截图的 3:4 宽高比。使用不正确的比例会导致黑边或拉伸的截图。
function IPad({ src, alt, style, className = "" }: {
src: string; alt: string; style?: React.CSSProperties; className?: string;
}) {
return (
<div className={`relative ${className}`}
style={{ aspectRatio: "770/1000", ...style }}>
<div style={{
width: "100%", height: "100%", borderRadius: "5% / 3.6%",
background: "linear-gradient(180deg, #2C2C2E 0%, #1C1C1E 100%)",
position: "relative", overflow: "hidden",
boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.1), 0 8px 40px rgba(0,0,0,0.6)",
}}>
{/* 前置摄像头点 */}
<div style={{
position: "absolute", top: "1.2%", left: "50%",
transform: "translateX(-50%)", width: "0.9%", height: "0.65%",
borderRadius: "50%", background: "#111113",
border: "1px solid rgba(255,255,255,0.08)", zIndex: 20,
}} />
{/* 边框边缘高光 */}
<div style={{
position: "absolute", inset: 0, borderRadius: "5% / 3.6%",
border: "1px solid rgba(255,255,255,0.06)",
pointerEvents: "none", zIndex: 15,
}} />
{/* 屏幕区域 */}
<div style={{
position: "absolute", left: "4%", top: "2.8%",
width: "92%", height: "94.4%",
borderRadius: "2.2% / 1.6%", overflow: "hidden", background: "#000",
}}>
<img src={src} alt={alt}
style={{ display: "block", width: "100%", height: "100%",
objectFit: "cover", objectPosition: "top" }}
draggable={false} />
</div>
</div>
</div>
);
}
iPad 布局调整与 iPhone 对比:
width: "65-70%"(iPhone 为 82-86%)——iPad 相对于其高度更宽canvasW 缩放(iPad 为 2064,iPhone 为 1320)所有尺寸相对于画布宽度 W:
| 元素 | 尺寸 | 字重 | 行高 |
|---|---|---|---|
| 分类标签 | W * 0.028 | 600 (semibold) | 默认 |
| 标题 | W * 0.09 到 W * 0.1 | 700 (bold) | 1.0 |
| 英雄标题 | W * 0.1 | 700 (bold) | 0.92 |
跨幻灯片变化——切勿连续使用相同的布局两次:
居中手机(英雄,单功能):
bottom: 0, width: "82-86%", translateX(-50%) translateY(12-14%)
两部手机层叠(对比):
后部: left: "-8%", width: "65%", rotate(-4deg), opacity: 0.55
前部: right: "-4%", width: "82%", translateY(10%)
手机 + 浮动元素(仅当用户提供了组件 PNG 文件时):
卡片不应遮挡手机的主要内容。
放置在边缘,轻微旋转(2-5度),添加投影。
如果分散注意力,则部分移出屏幕或缩小。
深色/对比背景,带有 App 图标、标题("还有更多功能。")和功能药丸状标签。可以包含一个带有较暗药丸状标签的"即将推出"部分。
html2canvas 在 CSS 滤镜、渐变、投影、背景滤镜和复杂裁剪上会失效。html-to-image 使用原生浏览器 SVG 序列化——能正确处理所有 CSS。
import { toPng } from "html-to-image";
// 捕获前:将元素移到屏幕上
el.style.left = "0px";
el.style.opacity = "1";
el.style.zIndex = "-1";
const opts = { width: W, height: H, pixelRatio: 1, cacheBust: true };
// 关键:双重调用技巧——第一次预热字体/图像,第二次生成干净输出
await toPng(el, opts);
const dataUrl = await toPng(el, opts);
// 捕获后:移回屏幕外
el.style.left = "-9999px";
el.style.opacity = "";
el.style.zIndex = "";
如果项目支持多种语言环境和主题,添加批量导出助手,以便用户可以一次性导出所有内容:
const jobs = LOCALES.flatMap(locale =>
ACTIVE_THEME_IDS.flatMap(themeId =>
ACTIVE_DEVICES.flatMap(device =>
getSlidesFor(device).map((slide, index) => ({
locale,
themeId,
device,
index,
slide,
})),
),
),
);
命名文件,使其能清晰排序并保留元数据:
01-hero-en-clean-light-iphone-1320x2868.png
01-hero-ar-dark-bold-ipad-2064x2752.png
至少支持:
toPng() 延迟加载字体/图像。第二次生成干净输出。没有这个,导出会是空白的。toPng 之前,临时移动到 left: 0。position: absolute; left: -9999px(而不是 fixed)。fontFamily。01-hero-1320x2868.png、02-freshness-1320x2868.png 等。使用 String(index + 1).padStart(2, "0")。在将页面交还给用户之前,根据此清单审查每张幻灯片:
当您展示完成的工作时:
| 错误 | 修复 |
|---|---|
| 所有幻灯片看起来都一样 | 变化手机位置(居中、左侧、右侧、双手机、无手机) |
| 装饰元素不可见 | 增加尺寸和不透明度——宁可过于可见,也不可不可见 |
| 文案过于复杂 | "手臂长度外一秒"测试 |
| 浮动元素遮挡手机 | 移动到屏幕外边缘或手机上方 |
| 纯白/黑背景 | 使用渐变——即使是微妙的渐变也能增加深度 |
| 过于杂乱 | 移除浮动元素,简化为手机 + 标题 |
| 过于简单/空洞 | 添加更大的装饰元素,在边缘放置浮动项目 |
| 标题使用"和" | 拆分为两张幻灯片或选择一个想法 |
| 幻灯片之间没有视觉对比 | 混合使用浅色和深色背景 |
| 导出为空白 | 使用双重调用技巧;捕获前将元素移到屏幕上 |
每周安装量
2.6K
仓库
GitHub Stars
3.2K
首次出现
2026年3月7日
安全审计
安装于
codex2.3K
cursor2.3K
github-copilot2.3K
opencode2.2K
gemini-cli2.2K
kimi-cli2.2K
Build a Next.js page that renders iOS App Store screenshots as advertisements (not UI showcases) and exports them via html-to-image at Apple's required resolutions. Screenshots are the single most important conversion asset on the App Store.
Screenshots are advertisements, not documentation. Every screenshot sells one idea. If you're showing UI, you're doing it wrong — you're selling a feeling , an outcome , or killing a pain point.
Before writing ANY code, ask the user all of these. Do not proceed until you have answers:
Based on the user's style direction, brand colors, and app aesthetic, decide:
ar, he, fa, ur), mirror layout intentionally instead of just translating the textIMPORTANT: If the user gives additional instructions at any point during the process, follow them. User instructions always override skill defaults.
Check what's available, use this priority: bun > pnpm > yarn > npm
# Check in order
which bun && echo "use bun" || which pnpm && echo "use pnpm" || which yarn && echo "use yarn" || echo "use npm"
# With bun:
bunx create-next-app@latest . --typescript --tailwind --app --src-dir --no-eslint --import-alias "@/*"
bun add html-to-image
# With pnpm:
pnpx create-next-app@latest . --typescript --tailwind --app --src-dir --no-eslint --import-alias "@/*"
pnpm add html-to-image
# With yarn:
yarn create next-app . --typescript --tailwind --app --src-dir --no-eslint --import-alias "@/*"
yarn add html-to-image
# With npm:
npx create-next-app@latest . --typescript --tailwind --app --src-dir --no-eslint --import-alias "@/*"
npm install html-to-image
The skill includes a pre-measured iPhone mockup at mockup.png (co-located with this SKILL.md). Copy it to the project's public/ directory. The mockup file is in the same directory as this skill file. No iPad mockup is needed — the iPad frame is CSS-only.
project/
├── public/
│ ├── mockup.png # iPhone frame (included with skill)
│ ├── app-icon.png # User's app icon
│ ├── screenshots/ # iPhone app screenshots
│ │ ├── home.png
│ │ ├── feature-1.png
│ │ └── ...
│ └── screenshots-ipad/ # iPad app screenshots (optional)
│ ├── home.png
│ ├── feature-1.png
│ └── ...
├── src/app/
│ ├── layout.tsx # Font setup
│ └── page.tsx # The screenshot generator (single file)
└── package.json
Note: No iPad mockup PNG is needed — the iPad frame is rendered with CSS (see iPad Mockup Component below).
Multi-language: nest screenshots under a locale folder per language. The generator switches the base path; all slide image srcs stay identical.
└── screenshots/
├── en/
│ ├── home.png
│ ├── feature-1.png
│ └── ...
├── de/
│ └── ...
└── {locale}/
If iPad screenshots are localized too, mirror the same locale structure:
└── screenshots-ipad/
├── en/
├── de/
└── {locale}/
The entire generator is a singlepage.tsx file. No routing, no extra layouts, no API routes.
Add a LOCALES array and locale tabs to the toolbar. Every slide src uses base — no hardcoded paths:
const LOCALES = ["en", "de", "es"] as const; // use whatever langs were defined
type Locale = typeof LOCALES[number];
// In ScreenshotsPage:
const [locale, setLocale] = useState<Locale>("en");
const base = `/screenshots/${locale}`;
// Toolbar tabs:
{LOCALES.map(l => (
<button key={l} onClick={() => setLocale(l)}
style={{ fontWeight: locale === l ? 700 : 400 }}>
{l.toUpperCase()}
</button>
))}
// In every slide — unchanged between single and multi-language:
<Phone src={`${base}/home.png`} alt="Home" />
Add a small config layer so the user can switch theme and locale without rewriting slide components:
const LOCALES = ["en", "de", "ar"] as const;
type Locale = typeof LOCALES[number];
const RTL_LOCALES = new Set<Locale>(["ar"]);
const THEMES = {
"clean-light": {
bg: "#F6F1EA",
fg: "#171717",
accent: "#5B7CFA",
muted: "#6B7280",
},
"dark-bold": {
bg: "#0B1020",
fg: "#F8FAFC",
accent: "#8B5CF6",
muted: "#94A3B8",
},
"warm-editorial": {
bg: "#F7E8DA",
fg: "#2B1D17",
accent: "#D97706",
muted: "#7C5A47",
},
} as const;
type ThemeId = keyof typeof THEMES;
const COPY_BY_LOCALE = {
en: { hero: "Build better habits" },
de: { hero: "Baue bessere Gewohnheiten auf" },
ar: { hero: "ابنِ عادات أفضل" },
} satisfies Record<Locale, { hero: string }>;
const [themeId, setThemeId] = useState<ThemeId>("clean-light");
const [locale, setLocale] = useState<Locale>("en");
const theme = THEMES[themeId];
const copy = COPY_BY_LOCALE[locale];
const isRtl = RTL_LOCALES.has(locale);
Use theme tokens everywhere instead of hardcoding colors. For RTL locales, set dir={isRtl ? "rtl" : "ltr"} on the screenshot canvas and mirror asymmetric layouts intentionally.
Support query params for automation:
// ?locale=de&theme=dark-bold&device=ipad
// src/app/layout.tsx
import { YourFont } from "next/font/google"; // Use whatever font the user specified
const font = YourFont({ subsets: ["latin"] });
export default function Layout({ children }: { children: React.ReactNode }) {
return <html><body className={font.className}>{children}</body></html>;
}
Adapt this framework to the user's requested slide count. Not all slots are required — pick what fits:
| Slot | Purpose | Notes |
|---|---|---|
| #1 | Hero / Main Benefit | App icon + tagline + home screen. This is the ONLY one most people see. |
| #2 | Differentiator | What makes this app unique vs competitors |
| #3 | Ecosystem | Widgets, extensions, watch — beyond the main app. Skip if N/A. |
| #4+ | Core Features | One feature per slide, most important first |
| 2nd to last | Trust Signal | Identity/craft — "made for people who [X]" |
| Last | More Features | Pills listing extras + coming soon. Skip if few features. |
Rules:
Get all headlines approved before building layouts. Bad copy ruins good design.
<br />.| Type | What it does | Example |
|---|---|---|
| Paint a moment | You picture yourself doing it | "Check your coffee without opening the app." |
| State an outcome | What your life looks like after | "A home for every coffee you buy." |
| Kill a pain | Name a problem and destroy it | "Never waste a great bag of coffee." |
Use these patterns to rewrite weak copy before building any layout:
| Weak | Better | Why it wins |
|---|---|---|
| Track habits and stay motivated | Keep your streak alive | one idea, faster to parse |
| Organize tasks with AI summaries and smart sorting | Turn notes into next steps | outcome-first, less jargon |
| Save recipes with tags, filters, and favorites | Find dinner fast | sells the user benefit, not the UI |
| Manage budgets and never miss payments | See where money goes | cleaner promise, no dual claim |
| AI-powered wellness support | Feel calmer tonight | concrete emotional outcome |
If the user gives a weak or underspecified request, reshape it internally into something like:
Build App Store screenshots for my habit tracker.
The app helps people stay consistent with simple daily routines.
I want 6 slides, clean/minimal style, warm neutrals, and a calm premium feel.
Generate App Store screenshots for my personal finance app.
The app's main strengths are fast expense capture, clear monthly trends, and shared budgets.
I want a sharp, modern style with high contrast and 7 slides.
Create exportable App Store screenshots for my AI note-taking app.
The core value is turning messy voice notes into clean summaries and action items.
I want bold copy, dark backgrounds, and a polished tech-forward look.
The pattern is:
page.tsx
├── Constants (IPHONE_W/H, IPAD_W/H, SIZES, design tokens)
├── LOCALES / RTL_LOCALES / THEMES / COPY_BY_LOCALE
├── Phone component (mockup PNG with screen overlay)
├── IPad component (CSS-only frame with screen overlay)
├── Caption component (label + headline, accepts canvasW for scaling)
├── Decorative components (blobs, glows, shapes — based on style direction)
├── iPhoneSlide1..N components (one per slide)
├── iPadSlide1..N components (same designs, adjusted for iPad proportions)
├── IPHONE_SCREENSHOTS / IPAD_SCREENSHOTS arrays (registries)
├── ScreenshotPreview (ResizeObserver scaling + hover export)
└── ScreenshotsPage (grid + locale tabs + theme tabs + device toggle + export logic)
const IPHONE_SIZES = [
{ label: '6.9"', w: 1320, h: 2868 },
{ label: '6.5"', w: 1284, h: 2778 },
{ label: '6.3"', w: 1206, h: 2622 },
{ label: '6.1"', w: 1125, h: 2436 },
] as const;
Design at the LARGEST size (1320x2868) and scale down for export.
If the user provides iPad screenshots, also generate iPad App Store screenshots:
const IPAD_SIZES = [
{ label: '13" iPad', w: 2064, h: 2752 },
{ label: '12.9" iPad Pro', w: 2048, h: 2732 },
] as const;
Design iPad slides at 2064x2752 and scale down. iPad screenshots are optional but recommended — they're required for iPad-only apps and improve listing quality for universal apps.
When supporting both devices, add a toggle (iPhone / iPad) in the toolbar next to the size dropdown. The size dropdown should switch between iPhone and iPad sizes based on the selected device. Support a ?device=ipad URL parameter for headless/automated capture workflows.
Place locale and theme selectors in the same toolbar as device + size. This turns the generator into a small control panel instead of a one-off page.
locale switches screenshot folders and copy dictionariestheme switches design tokens onlydevice switches iPhone/iPad slide registriessize switches export resolution onlyEach screenshot is designed at full resolution (1320x2868px). Two copies exist:
transform: scale() via ResizeObserver to fit a grid cardposition: absolute; left: -9999px at true resolutionThe included mockup.png has these pre-measured values:
const MK_W = 1022; // mockup image width
const MK_H = 2082; // mockup image height
const SC_L = (52 / MK_W) * 100; // screen left offset %
const SC_T = (46 / MK_H) * 100; // screen top offset %
const SC_W = (918 / MK_W) * 100; // screen width %
const SC_H = (1990 / MK_H) * 100; // screen height %
const SC_RX = (126 / 918) * 100; // border-radius x %
const SC_RY = (126 / 1990) * 100; // border-radius y %
function Phone({ src, alt, style, className = "" }: {
src: string; alt: string; style?: React.CSSProperties; className?: string;
}) {
return (
<div className={`relative ${className}`}
style={{ aspectRatio: `${MK_W}/${MK_H}`, ...style }}>
<img src="/mockup.png" alt=""
className="block w-full h-full" draggable={false} />
<div className="absolute z-10 overflow-hidden"
style={{
left: `${SC_L}%`, top: `${SC_T}%`,
width: `${SC_W}%`, height: `${SC_H}%`,
borderRadius: `${SC_RX}% / ${SC_RY}%`,
}}>
<img src={src} alt={alt}
className="block w-full h-full object-cover object-top"
draggable={false} />
</div>
</div>
);
}
Unlike the iPhone mockup which uses a pre-measured PNG frame, the iPad uses a CSS-only frame. This avoids needing a separate mockup asset and looks clean at any resolution.
Critical dimension: The frame aspect ratio must be 770/1000 so the inner screen area (92% width × 94.4% height) matches the 3:4 aspect ratio of iPad screenshots. Using incorrect proportions causes black bars or stretched screenshots.
function IPad({ src, alt, style, className = "" }: {
src: string; alt: string; style?: React.CSSProperties; className?: string;
}) {
return (
<div className={`relative ${className}`}
style={{ aspectRatio: "770/1000", ...style }}>
<div style={{
width: "100%", height: "100%", borderRadius: "5% / 3.6%",
background: "linear-gradient(180deg, #2C2C2E 0%, #1C1C1E 100%)",
position: "relative", overflow: "hidden",
boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.1), 0 8px 40px rgba(0,0,0,0.6)",
}}>
{/* Front camera dot */}
<div style={{
position: "absolute", top: "1.2%", left: "50%",
transform: "translateX(-50%)", width: "0.9%", height: "0.65%",
borderRadius: "50%", background: "#111113",
border: "1px solid rgba(255,255,255,0.08)", zIndex: 20,
}} />
{/* Bezel edge highlight */}
<div style={{
position: "absolute", inset: 0, borderRadius: "5% / 3.6%",
border: "1px solid rgba(255,255,255,0.06)",
pointerEvents: "none", zIndex: 15,
}} />
{/* Screen area */}
<div style={{
position: "absolute", left: "4%", top: "2.8%",
width: "92%", height: "94.4%",
borderRadius: "2.2% / 1.6%", overflow: "hidden", background: "#000",
}}>
<img src={src} alt={alt}
style={{ display: "block", width: "100%", height: "100%",
objectFit: "cover", objectPosition: "top" }}
draggable={false} />
</div>
</div>
</div>
);
}
iPad layout adjustments vs iPhone:
width: "65-70%" for iPad mockups (vs 82-86% for iPhone) — iPad is wider relative to its heightcanvasW (which is 2064 for iPad vs 1320 for iPhone)All sizing relative to canvas width W:
| Element | Size | Weight | Line Height |
|---|---|---|---|
| Category label | W * 0.028 | 600 (semibold) | default |
| Headline | W * 0.09 to W * 0.1 | 700 (bold) | 1.0 |
| Hero headline | W * 0.1 | 700 (bold) | 0.92 |
Vary across slides — NEVER use the same layout twice in a row:
Centered phone (hero, single-feature):
bottom: 0, width: "82-86%", translateX(-50%) translateY(12-14%)
Two phones layered (comparison):
Back: left: "-8%", width: "65%", rotate(-4deg), opacity: 0.55
Front: right: "-4%", width: "82%", translateY(10%)
Phone + floating elements (only if user provided component PNGs):
Cards should NOT block the phone's main content.
Position at edges, slight rotation (2-5deg), drop shadows.
If distracting, push partially off-screen or make smaller.
Dark/contrast background with app icon, headline ("And so much more."), and feature pills. Can include a "Coming Soon" section with dimmer pills.
html2canvas breaks on CSS filters, gradients, drop-shadow, backdrop-filter, and complex clipping. html-to-image uses native browser SVG serialization — handles all CSS faithfully.
import { toPng } from "html-to-image";
// Before capture: move element on-screen
el.style.left = "0px";
el.style.opacity = "1";
el.style.zIndex = "-1";
const opts = { width: W, height: H, pixelRatio: 1, cacheBust: true };
// CRITICAL: Double-call trick — first warms up fonts/images, second produces clean output
await toPng(el, opts);
const dataUrl = await toPng(el, opts);
// After capture: move back off-screen
el.style.left = "-9999px";
el.style.opacity = "";
el.style.zIndex = "";
If the project supports multiple locales and themes, add bulk export helpers so the user can export everything in one pass:
const jobs = LOCALES.flatMap(locale =>
ACTIVE_THEME_IDS.flatMap(themeId =>
ACTIVE_DEVICES.flatMap(device =>
getSlidesFor(device).map((slide, index) => ({
locale,
themeId,
device,
index,
slide,
})),
),
),
);
Name files so they sort cleanly and preserve metadata:
01-hero-en-clean-light-iphone-1320x2868.png
01-hero-ar-dark-bold-ipad-2064x2752.png
At minimum, support:
toPng() loads fonts/images lazily. Second produces clean output. Without this, exports are blank.left: 0 before calling toPng.position: absolute; left: -9999px (not fixed).fontFamily on the offscreen container.01-hero-1320x2868.png, 02-freshness-1320x2868.png, etc. Use .Before handing the page back to the user, review every slide against this checklist:
When you present the finished work:
| Mistake | Fix |
|---|---|
| All slides look the same | Vary phone position (center, left, right, two-phone, no-phone) |
| Decorative elements invisible | Increase size and opacity — better too visible than invisible |
| Copy is too complex | "One second at arm's length" test |
| Floating elements block the phone | Move off-screen edges or above the phone |
| Plain white/black background | Use gradients — even subtle ones add depth |
| Too cluttered | Remove floating elements, simplify to phone + caption |
| Too simple/empty | Add larger decorative elements, floating items at edges |
| Headlines use "and" | Split into two slides or pick one idea |
| No visual contrast across slides | Mix light and dark backgrounds |
| Export is blank | Use double-call trick; move element on-screen before capture |
Weekly Installs
2.6K
Repository
GitHub Stars
3.2K
First Seen
Mar 7, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex2.3K
cursor2.3K
github-copilot2.3K
opencode2.2K
gemini-cli2.2K
kimi-cli2.2K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
String(index + 1).padStart(2, "0")