跳到正文
VibeFather
免费注册

用这个模板做的 2 个案例

同一份提示词,不同的 [VARIABLES] 变量。点一个在上方预览。

关于这个模板

发票生成器工具是一个单页工作区,面向需要精美发票但不想注册账号的自由职业者和小团队。左栏用于填写业务信息、客户信息、发票元数据、明细项、税费和折扣。右栏是实时文档预览,每次编辑都会准确显示在打印时的位置。货币选择器在本地完成格式化,界面会明确提示:切换货币不会进行汇率换算。

视觉设计将暖灰色应用画布与清爽的白色发票纸张搭配。Source Serif 4 赋予文档编辑出版物的气质,Inter 让密集的表单控件易于扫读,IBM Plex Mono 则对齐数量、单价和总计。深绿色操作按钮、细线分隔、紧凑标签和克制的动效让工具显得专注而非装饰性。

模板包含本地 logo 上传、可复用的已保存客户、草稿自动保存、明细项合计、固定金额或百分比折扣,以及一个打印样式表,可将发票单独隔离出来用于浏览器打印或保存为 PDF。在较小屏幕上,编辑和预览标签页让工作流保持可用,而不必把两栏挤在一起。

通过六个变量调整生成器的品牌、示例开票方、客户、地点、服务类型和初始货币。示例内容从设计工作室发票切换到自行车维修服务,展示同一布局可支持不同业务。由于预览和编辑器共享同一状态,打印文档始终反映最新的可见更改。一切都在浏览器中通过 localStorage 运行;没有后端、云同步、收款或外部汇率服务。

模板提示词

在线演示就是用这份提示词原样做出来的,没有额外补充。其他案例只是改了 [VARIABLES] 变量的值。 提示词保持英文原版,国内常用的 AI 编程工具都能直接理解;下面附中文参考译文。

# Invoice Generator Tool

Build this website exactly as described below. Replace the [VARIABLES] with your own values; keep everything else.

## Brief
Build an original, complete single-page invoice generator branded [BRAND]. A structured editor on the left controls a polished live invoice on the right. Include editable issuer and client details, invoice metadata, local logo upload, line items, tax, fixed or percentage discounts, currency formatting, saved clients, draft persistence, and browser printing or saving as PDF. The invoice itself is the first-screen visual anchor; do not add a marketing hero.

- Audience: Freelancers, independent studios, tradespeople, and small business owners who want a focused invoice workflow without accounts, cloud setup, or payment processing.
- Goal: Let a visitor create a coherent invoice from the supplied sample, see every calculation update immediately, reuse client records after a reload, and produce a clean printed or PDF document using only browser capabilities.
- Tone: Quietly capable, precise, approachable, and paper-inspired. Use direct labels and practical helper text, with no promotional slogans, fake cloud claims, or financial advice.

## Stack
- Framework: Vite 6 + React 19 + TypeScript
- Styling: Tailwind CSS 4.1
- Libraries: lucide-react (ISC), @fontsource-variable/inter (OFL), @fontsource-variable/source-serif-4 (OFL), @fontsource/ibm-plex-mono (OFL)
- Build: `npm run build` → static files in `dist/`. No backend, no server code, no external APIs.
- Setup:
  - Set Vite base to './' and build.sourcemap to false; emit the production site to dist/ with relative asset paths and no src/ directory copied into it.
  - Use Tailwind CSS 4 with its Vite plugin and define the color, typography, radius, and shadow tokens in src/index.css; keep print rules in a dedicated stylesheet imported locally.
  - Keep all default copy, sample details, line items, currency choices, and UI labels in src/content.ts. Use the supplied variable values for [BRAND], [ISSUER_NAME], [ISSUER_LOCATION], [CLIENT_NAME], [SERVICE_TYPE], and [CURRENCY], and rewrite service-specific sample rows, addresses, and notes to remain coherent when those values change.
  - Define one canonical InvoiceDraft type and pure calculation helpers. Store monetary values in integer minor units, use the selected currency's precision, calculate the discount before tax, round tax once at currency precision, and never render NaN, negative totals, or stale amounts.
  - Persist the current draft, uploaded logo data URL, and saved clients under separate versioned localStorage keys. Guard malformed JSON, unavailable storage, and quota errors with a nonblocking status message; saved clients must survive a New invoice reset.
  - Use a plain document title containing [BRAND], an original code-drawn SVG favicon, and an ASSETS.md that lists each third-party font and icon package with its local path or package, source URL, author, and license.

## Variables
- [BRAND] — Generator brand (default: "Tallyfold"). Invented product name shown in the app header and document title.
- [ISSUER_NAME] — Sample issuer (default: "Hearth & Field Studio"). Fictional business that issues the initial invoice.
- [ISSUER_LOCATION] — Issuer location (default: "Portland, Oregon"). City and region used in the sample billing address.
- [CLIENT_NAME] — Sample client (default: "Moss & Marker Workshop"). Fictional client billed by the initial invoice.
- [SERVICE_TYPE] — Service type (default: "brand design services"). Trade used to write the initial line items and invoice notes.
- [CURRENCY] — Starting currency (default: "USD"). Initial ISO currency code; the selector also supports EUR, GBP, CAD, AUD, and JPY.
- [CREDIT] — keep a small "Template by VibeFather" link to https://vibefather.ai/t/invoice-generator-tool in the footer (default: yes; delete this line to remove it)

The copy under Pages & Sections is written for the default values. If your values differ, rewrite every headline, paragraph, label and image for them — same length, tone and structure. Layout, colors, type and motion stay as described.
Keep all copy, image paths and links in one content file (for example `src/content.ts`), keyed by section, so the content can be swapped later without touching components.

## Design
### Colors
- Canvas `#F3F0E9` — Warm gray application background behind the workspace.
- Panel `#FBFAF7` — Editor cards, drawers, and restrained secondary surfaces.
- Paper `#FFFFFF` — Live invoice sheet and all printed pages.
- Ink `#18201D` — Primary text, invoice heading, and high-emphasis borders.
- Muted `#68716B` — Helper text, metadata, and secondary labels with readable contrast.
- Rule `#D9DDD6` — Input borders, table rules, and separators.
- Accent `#1F6F54` — Primary buttons, active tabs, focus rings, and selected actions.
- Accent Soft `#DDEBE3` — Saved-state background, active field tint, and subtle invoice accent block.
- Danger `#A54732` — Delete and remove actions only.

### Typography
- Document display and invoice totals: Source Serif 4 Variable (OFL), weights 600/700
- Application UI, labels, inputs, and body copy: Inter Variable (OFL), weights 400/500/600/700
- Quantities, rates, invoice number, and aligned amounts: IBM Plex Mono (OFL), weights 400/500/600

### Layout & motion
- Spacing: Use a 4px base scale. Desktop page padding is 28px, the top bar is 64px high, editor cards have 20px padding, form sections are separated by 24px, inputs are at least 44px high, and the workspace columns have a 24px gap. The invoice sheet uses 48px padding on desktop and 28px on mobile. Mobile page padding is 16px with 16px card padding and 12px field gaps.
- Radius: Use 10px for editor cards and primary buttons, 8px for inputs and secondary buttons, 999px only for the small saved-status pill, and 2px for the invoice sheet. Avoid excessive pill shapes and floating rounded containers.
- Motion: Use 120–160ms ease-out transitions for button hover, border color, focus rings, tabs, and drawer overlays; never animate calculated digits or delay their update.
- Motion: New line-item rows fade and translate upward 6px over 160ms, and removed rows exit without a large layout jump.
- Motion: Toasts enter from the bottom with a 180ms fade and 8px rise; the saved-client drawer slides 16px from the right on desktop and fades in as a full-screen sheet on mobile.
- Motion: Under prefers-reduced-motion, remove sliding and row entrance motion and make all state changes immediate.
- Imagery: Use no stock or generated images. The first-screen visual anchor is the rich live invoice itself: a crisp white paper sheet, original issuer monogram, fine rules, structured line items, and a precise totals block above a soft 0 18px 50px rgba(24,32,29,0.10) shadow. Before upload, derive a simple two-letter issuer monogram from [ISSUER_NAME] inside an Accent Soft square. The upload control accepts a local PNG, JPEG, or WebP up to 2 MB and displays that image only in the invoice logo position. Use Lucide icons for controls and draw the [BRAND] mark as an original geometric receipt-and-check SVG; never use real business or payment-service marks.

## Pages & Sections
### Invoice workspace (`index.html`)
1. **App header and draft actions** — Show the original geometric [BRAND] mark, [BRAND], and the plain descriptor Invoice generator at the left. On the right provide Saved clients, New invoice, and the primary Print / Save PDF button with a printer icon. Below the bar, show Create invoice as the workspace heading, a muted Draft stored only in this browser note, and a live status pill that changes from Saving… to Saved locally after a 300ms debounce. New invoice opens a confirmation dialog explaining that the current draft will reset while saved clients remain. Print / Save PDF calls window.print and never pretends to download a file directly.
   Layout: Use a full-width 64px top bar with a bottom Rule border, followed by a max-width 1480px workspace header with 28px horizontal padding and 20px vertical spacing. Keep actions in one row on desktop. At 390px, wrap the heading and buttons cleanly, make Print / Save PDF full width, and place a sticky Edit / Preview segmented control directly below the workspace header; no horizontal scrolling.
   Motion: Only subtle 120ms button and focus transitions. The save-status pill crossfades its text without changing width or delaying persistence.
2. **Business, client, and invoice details editor** — The first editor card is Business & client. Include a logo upload drop button with Upload logo helper text PNG, JPEG, or WebP · max 2 MB, a small preview, and Remove logo when present. Provide labeled fields for Issuer name, Issuer address, Issuer email, Client name, Client address, and Client email. Defaults use [ISSUER_NAME], the invented address 184 Rowan Lane · [ISSUER_LOCATION] 97209, [email protected], [CLIENT_NAME], 27 Alder Street · Seattle, Washington 98101, and [email protected]; rewrite these details when the variables change. Add Save current client and Choose saved client actions. The second card is Invoice settings with Invoice number default INV-1048, Issue date default 2026-05-14, Due date default 2026-05-28, and Currency initialized from [CURRENCY]. Include USD, EUR, GBP, CAD, AUD, and JPY options and the note Currency changes formatting only; amounts are not converted.
   Layout: Place these cards in the left editor column, which is 430px wide at 1440px and collapses to the full available width on mobile. Stack Business & client above Invoice settings. Use a two-column grid for issuer/client pairs only when each field remains at least 180px wide; otherwise use one column. Invoice number spans the full width, issue and due dates share a row, and currency spans the full width. Every input has a persistent visible label and a strong keyboard focus state.
   Motion: Logo preview fades in over 160ms. Inline validation appears without shifting the overall column more than necessary; no decorative motion.
3. **Line items and calculation editor** — Title this card Line items and provide column labels Description, Qty, Rate, and Amount. Default rows for [SERVICE_TYPE] are Brand strategy workshop at 1 × 650.00, Homepage design at 1 × 1200.00, and Print-ready style guide at 1 × 480.00; for alternate service types, replace all three descriptions with equally specific services from that trade. Each row has editable description, quantity, and unit-rate fields, a computed amount, and a labeled delete icon. Provide an Add line item button and keep at least one empty editable row if all rows are removed. Below, include Discount type with Fixed and Percentage options, default Fixed, Discount default 100.00, and Tax rate default 8.25%. Show the live calculation summary: Subtotal 2330.00, Discount −100.00, Tax 183.98, and Total 2413.98 in the starting USD case. Compute tax on the discounted subtotal, cap percentage discount at 100 and fixed discount at the subtotal, and allow zero values but not negative inputs.
   Layout: Keep this as the third and final card in the left column. On desktop, use a compact grid with description taking the remaining width, quantity 64px, rate 104px, amount 96px, and delete 36px. On narrow screens, make each item a bordered block with description full width and quantity, rate, and amount below; do not create a wide table. Put discount and tax inputs in a two-column row, then align the calculation summary to the right with Total emphasized in Ink and Source Serif 4.
   Motion: Added rows use the specified 160ms entrance. Amounts update synchronously on every valid keystroke with no count-up animation. Delete buttons gain a Danger-colored hover state.
4. **Live invoice preview** — Render a complete invoice from the same canonical state, not a second copy of the data. The sheet begins with the uploaded logo or derived issuer monogram, [ISSUER_NAME], issuer address and email, a large INVOICE heading, and the current invoice number. A two-column Bill to and Invoice details block shows [CLIENT_NAME] and client details alongside issue date, due date, and currency. The item table repeats Description, Qty, Rate, and Amount with the three default rows. A lower-right totals block shows Subtotal, Discount, Tax, and the bold Total due 2413.98 for the unchanged default. Finish with Payment notes, the generic note Payment due within 14 days. Please include the invoice number in the transfer reference., and Thank you for the opportunity to work together. Add a small footer line Prepared with [BRAND] · Stored locally in your browser. All visible invoice values must update immediately when edited.
   Layout: On desktop the right preview column fills the remaining width and is sticky 24px below the top bar while the editor scrolls. Center a white sheet with a maximum width of 780px, minimum readable document proportions, 48px padding, and a subtle paper shadow; allow the page to scroll vertically so the full sheet is never clipped. Use Source Serif 4 700 at 44px for INVOICE and 28px for Total due, with IBM Plex Mono for numeric columns. Below 900px, show either editor or preview according to the Edit / Preview tabs. On mobile, use a fluid 28px-padded sheet, stack metadata blocks, and convert item rows into readable stacked blocks rather than scaling down an A4 image. The print stylesheet hides every app element except the invoice, removes shadows and backgrounds, sets white paper and black text, preserves the table and totals, avoids breaking individual item rows, and uses sensible A4/Letter margins.
   Motion: The preview does not animate on each keystroke. Mobile Edit / Preview uses an optional 120ms crossfade, disabled for reduced motion. Printing has no animation.
5. **Saved clients drawer and feedback** — Saved clients opens a drawer titled Saved clients with the explanation Reuse billing details without creating an account. Save current client adds or updates a record using the current client name, address, and email, with duplicate names confirmed before overwriting. Each saved row shows the client name and email plus Apply and Delete actions; Apply fills only the client fields and closes the drawer, while Delete asks for confirmation. Include an empty state: No saved clients yet. Fill in the client details and choose Save current client. Restore saved records and the active draft after reload. Use short toasts for Client saved, Client applied, Client deleted, Logo removed, and storage failures.
   Layout: Use a 380px right-side drawer on desktop with a translucent Ink overlay, a close button, and a scrollable list. On mobile use a full-screen sheet with the same controls and at least 44px tap targets. Trap keyboard focus in the open drawer or confirmation dialog, close on Escape, return focus to the invoking button, and never allow background interaction while modal UI is open.
   Motion: Drawer and toast transitions follow the design motion rules and become immediate under reduced motion.

## Assets
- icon: Install and import lucide-react (ISC) for Plus, Trash2, Users, Upload, X, Printer, RotateCcw, Check, and ChevronDown. Keep icons inline and local through the npm package, add accessible names to icon-only buttons, and use no brand or payment-service icons. Draw the original [BRAND] receipt-and-check mark and issuer monogram in SVG/CSS.
- font: Self-host Inter Variable, Source Serif 4 Variable, and IBM Plex Mono through @fontsource-variable/inter, @fontsource-variable/source-serif-4, and @fontsource/ibm-plex-mono. Import only the specified weights, include no remote font URLs, and document package paths, upstream sources, authors, and OFL licenses in ASSETS.md.

## Don'ts
- Do not add a backend, server routes, accounts, authentication, database, cloud sync, payment collection, analytics, third-party APIs, live tax lookup, or exchange-rate conversion.
- Do not copy existing invoicing products, their exact layouts, copy, illustrations, icons, branded invoice designs, or proprietary visual assets; use only the original interface described here.
- Do not use real business identities, real logos, payment-service trademarks, recognizable commercial products, stock-photo services, hotlinked files, or generated imagery.
- Do not load Google Fonts, Adobe Fonts, CDN scripts, CDN CSS, or commercial fonts; self-host only the listed open-license Fontsource packages.
- Do not add a PDF library or fake a downloaded PDF; use window.print and the dedicated print stylesheet so the browser can print or save the invoice as PDF.
- Do not hard-code default content outside src/content.ts or leave design-service line items, addresses, names, or notes stale when variables change; keep all site copy in US English and never mention VibeFather except the optional credit link.
- Do not store data anywhere except versioned localStorage keys, and do not claim that local drafts or clients are synced, secured in an account, or available on another device.
- Do not allow invalid calculations, negative inputs or totals, NaN, unhandled localStorage failures, raw HTML injection from uploaded or entered content, or silent loss of saved-client data during reset.
- Do not introduce additional pages, bare-directory links, marketing sections, a landing-page hero, carousels, decorative gradients, glass effects, or unrelated dashboard widgets.
- Do not ship source maps, src/ in dist/, remote assets, absolute asset paths, or a dist/ bundle over 20 MB; the single index.html build must work from static hosting with zero console errors.
- Do not sacrifice keyboard access, visible labels, focus management, 44px mobile targets, readable contrast, reduced-motion support, or the 1440×900 and 390×844 layouts.

---
— Prompt by VibeFather · https://vibefather.ai/t/invoice-generator-tool · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown
中文参考译文(帮助理解,复制给 AI 时请用上面的英文原版)
# 发票生成工具

完全按照以下描述构建此网站。将 [VARIABLES] 替换为你自己的值;其余内容保持不变。

## 简介
构建一个原创、完整的单页发票生成器,品牌为 [BRAND]。左侧的结构化编辑器控制右侧精美的实时发票。包含可编辑的开票方和客户详情、发票元数据、本地 logo 上传、明细项、税费、固定或百分比折扣、货币格式化、已保存客户、草稿持久化,以及浏览器打印或保存为 PDF。发票本身即是首屏视觉锚点;不要添加营销 hero 区。

- 受众:自由职业者、独立工作室、手工艺人和小企业主,他们想要专注的发票工作流,无需账户、云设置或支付处理。
- 目标:让访客基于提供的示例创建一张连贯的发票,即时看到每项计算更新,在重新加载后复用客户记录,并仅使用浏览器能力生成干净的打印或 PDF 文档。
- 语气:沉稳可靠、精确、平易近人,并带有纸张质感。使用直接的标签和实用的辅助文本,不要促销口号、虚假云声明或财务建议。

## 技术栈
- 框架:Vite 6 + React 19 + TypeScript
- 样式:Tailwind CSS 4.1
- 库:lucide-react(ISC)、@fontsource-variable/inter(OFL)、@fontsource-variable/source-serif-4(OFL)、@fontsource/ibm-plex-mono(OFL)
- 构建:`npm run build` → `dist/` 中的静态文件。无后端、无服务器代码、无外部 API。
- 设置:
  - 将 Vite base 设为 './',build.sourcemap 设为 false;将生产站点输出到 dist/,使用相对资源路径,且不将 src/ 目录复制到其中。
  - 使用 Tailwind CSS 4 及其 Vite 插件,并在 src/index.css 中定义颜色、排版、圆角和阴影令牌;将打印规则保留在本地导入的专用样式表中。
  - 将所有默认文案、示例详情、行项目、货币选项和 UI 标签保留在 src/content.ts 中。使用提供的变量值填充 [BRAND]、[ISSUER_NAME]、[ISSUER_LOCATION]、[CLIENT_NAME]、[SERVICE_TYPE] 和 [CURRENCY],并重写服务特定的示例行、地址和备注,使其在这些值变化时保持连贯。
  - 定义一个规范的 InvoiceDraft 类型和纯计算辅助函数。以整数最小货币单位存储货币值,使用所选货币的精度,在计税前计算折扣,按货币精度对税额进行一次舍入,且绝不渲染 NaN、负总额或过时金额。
  - 将当前草稿、上传的 logo 数据 URL 和已保存客户分别持久化到独立的带版本 localStorage 键下。对格式错误的 JSON、不可用的存储和配额错误以非阻塞状态消息进行防护;已保存客户必须在“新建发票”重置后仍然保留。
  - 使用包含 [BRAND] 的纯文档标题、一个原创的代码绘制 SVG favicon,以及一个 ASSETS.md,其中列出每个第三方字体和图标包及其本地路径或包名、源 URL、作者和许可证。

## 变量
- [BRAND] — 生成器品牌(默认:“Tallyfold”)。虚构的产品名称,显示在应用页眉和文档标题中。
- [ISSUER_NAME] — 示例开票方(默认:“Hearth & Field Studio”)。开具初始发票的虚构企业。
- [ISSUER_LOCATION] — 开票方所在地(默认:“Portland, Oregon”)。示例账单地址中使用的城市和地区。
- [CLIENT_NAME] — 示例客户(默认:“Moss & Marker Workshop”)。初始发票所开给的虚构客户。
- [SERVICE_TYPE] — 服务类型(默认:“brand design services”)。用于撰写初始行项目和发票备注的行业。
- [CURRENCY] — 起始货币(默认:“USD”)。初始 ISO 货币代码;选择器还支持 EUR、GBP、CAD、AUD 和 JPY。
- [CREDIT] — 在页脚保留一个小型“Template by VibeFather”链接,指向 https://vibefather.ai/t/invoice-generator-tool(默认:是;删除此行即可移除)

“页面与区块”下的文案是按默认值撰写的。如果你的值不同,请为它们重写每一个标题、段落、标签和图片——保持相同的长度、语气和结构。布局、颜色、字体和动效保持所述不变。
将所有文案、图片路径和链接放在一个内容文件中(例如 `src/content.ts`),按区块作为键,以便之后无需改动组件即可替换内容。

## 设计
### 颜色(Colors)
- 画布(Canvas)`#F3F0E9` — 工作区背后的暖灰色应用背景。
- 面板(Panel)`#FBFAF7` — 编辑器卡片、抽屉和克制的次级表面。
- 纸张(Paper)`#FFFFFF` — 实时发票单页和所有打印页面。
- 墨色(Ink)`#18201D` — 主文本、发票标题和高强调边框。
- 弱化色(Muted)`#68716B` — 辅助文本、元数据和具有可读对比度的次级标签。
- 分隔线(Rule)`#D9DDD6` — 输入框边框、表格线和分隔符。
- 强调色(Accent)`#1F6F54` — 主按钮、活动标签页、焦点环和选中操作。
- 柔和强调色(Accent Soft)`#DDEBE3` — 已保存状态背景、活动字段底色和微妙的发票强调块。
- 危险色(Danger)`#A54732` — 仅用于删除和移除操作。

### 字体排印(Typography)
- 文档展示和发票总计:Source Serif 4 Variable(OFL),字重 600/700
- 应用界面、标签、输入框和正文:Inter Variable(OFL),字重 400/500/600/700
- 数量、费率、发票编号和对齐金额:IBM Plex Mono(OFL),字重 400/500/600

### 布局与动效(Layout & motion)
- 间距:使用 4px 基础刻度。桌面页面内边距为 28px,顶栏高 64px,编辑器卡片内边距为 20px,表单区块之间间隔 24px,输入框至少 44px 高,工作区列间距为 24px。发票单页在桌面端使用 48px 内边距,移动端为 28px。移动端页面内边距为 16px,卡片内边距为 16px,字段间距为 12px。
- 圆角:编辑器卡片和主按钮使用 10px,输入框和次级按钮使用 8px,仅小型已保存状态胶囊使用 999px,发票单页使用 2px。避免过度使用胶囊形状和悬浮圆角容器。
- 动效:按钮悬停、边框颜色、焦点环、标签页和抽屉遮罩使用 120–160ms ease-out 过渡;绝不对计算出的数字做动画或延迟其更新。
- 动效:新增行项目行在 160ms 内淡入并向上平移 6px,移除的行退出时不会造成大幅布局跳动。
- 动效:Toast 从底部进入,180ms 淡入并上升 8px;已保存客户抽屉在桌面端从右侧滑入 16px,在移动端作为全屏面板淡入。
- 动效:在 prefers-reduced-motion 下,移除滑动和行进入动效,并让所有状态变化立即生效。
- 图像:不使用图库或生成图像。首屏视觉锚点是丰富的实时发票本身:一张清晰的白色纸张、原创发行方字母组合、精细线条、结构化行项目和精确的总计区块,下方带有柔和的 0 18px 50px rgba(24,32,29,0.10) 阴影。上传前,从 [ISSUER_NAME] 派生一个简单的两字母发行方字母组合,置于 Accent Soft 方块内。上传控件接受本地 PNG、JPEG 或 WebP,最大 2 MB,并仅在发票徽标位置显示该图像。控件使用 Lucide 图标,并将 [BRAND] 标记绘制为原创几何收据与对勾 SVG;绝不使用真实企业或支付服务标记。

## 页面与区块
### 发票工作区(`index.html`)
1. **应用页头与草稿操作** — 左侧显示原始几何 [BRAND] 标记、[BRAND],以及纯文字描述 Invoice generator。右侧提供 Saved clients、New invoice,以及带打印机图标的 primary Print / Save PDF 按钮。栏下方显示工作区标题 Create invoice、一条弱化的 Draft stored only in this browser 提示,以及一个实时状态胶囊,在 300ms 防抖后从 Saving… 变为 Saved locally。New invoice 打开确认对话框,说明当前草稿将重置,而已保存的客户会保留。Print / Save PDF 调用 window.print,绝不假装直接下载文件。
   布局:使用全宽 64px 顶栏,底部带 Rule 边框,随后是最大宽度 1480px 的工作区标题,水平内边距 28px,垂直间距 20px。桌面端操作保持在一行。在 390px 时,标题和按钮干净换行,Print / Save PDF 变为全宽,并在工作区标题正下方放置粘性的 Edit / Preview 分段控件;无水平滚动。
   动效:仅使用细微的 120ms 按钮和焦点过渡。保存状态胶囊交叉淡入淡出其文本,不改变宽度,也不延迟持久化。
2. **业务、客户与发票详情编辑器** — 第一张编辑器卡片是 Business & client。包含一个 logo 上传拖放按钮,辅助文本为 Upload logo PNG, JPEG, or WebP · max 2 MB,一个小预览,以及存在时的 Remove logo。提供带标签的字段:Issuer name、Issuer address、Issuer email、Client name、Client address 和 Client email。默认值使用 [ISSUER_NAME]、虚构地址 184 Rowan Lane · [ISSUER_LOCATION] 97209、[email protected]、[CLIENT_NAME]、27 Alder Street · Seattle, Washington 98101 和 [email protected];当变量变化时重写这些详情。添加 Save current client 和 Choose saved client 操作。第二张卡片是 Invoice settings,Invoice number 默认 INV-1048,Issue date 默认 2026-05-14,Due date 默认 2026-05-28,Currency 从 [CURRENCY] 初始化。包含 USD、EUR、GBP、CAD、AUD 和 JPY 选项,以及注释 Currency changes formatting only; amounts are not converted。
   布局:将这些卡片放在左侧编辑器列中,该列在 1440px 时宽 430px,在移动端折叠为全部可用宽度。Business & client 堆叠在 Invoice settings 上方。仅当每个字段保持至少 180px 宽时,才对 issuer/client 配对使用两列网格;否则使用单列。Invoice number 跨全宽,issue 和 due dates 共享一行,currency 跨全宽。每个输入都有持久可见的标签和强烈的键盘焦点状态。
   动效:Logo 预览在 160ms 内淡入。内联验证出现时不会使整体列产生超过必要的位移;无装饰性动效。
3. **行项目与计算编辑器** — 此卡片标题为 Line items,提供列标签 Description、Qty、Rate 和 Amount。[SERVICE_TYPE] 的默认行为 Brand strategy workshop 1 × 650.00、Homepage design 1 × 1200.00 和 Print-ready style guide 1 × 480.00;对于其他服务类型,用该行业中同样具体的服务替换全部三个描述。每行有可编辑的 description、quantity 和 unit-rate 字段、计算出的 amount,以及带标签的删除图标。提供 Add line item 按钮,如果所有行都被移除,至少保留一个空的可编辑行。下方包含 Discount type,选项为 Fixed 和 Percentage,默认 Fixed,Discount 默认 100.00,Tax rate 默认 8.25%。显示实时计算摘要:在起始 USD 情况下,Subtotal 2330.00、Discount −100.00、Tax 183.98 和 Total 2413.98。基于折后小计计算税费,百分比折扣上限为 100,固定折扣上限为小计,允许零值但不允许负输入。
   布局:将此作为左列的第三张也是最后一张卡片。桌面端使用紧凑网格,description 占据剩余宽度,quantity 64px,rate 104px,amount 96px,delete 36px。窄屏上,将每个项目设为带边框的块,description 全宽,quantity、rate 和 amount 在下方;不要创建宽表格。将 discount 和 tax 输入放在两列行中,然后将计算摘要右对齐,Total 以 Ink 和 Source Serif 4 强调。
   动效:添加的行使用指定的 160ms 入场。金额在每次有效击键时同步更新,无计数动画。删除按钮获得 Danger 色的悬停状态。
4. **实时发票预览** — 从同一规范状态渲染完整发票,而非数据的第二副本。纸张以上传的 logo 或派生的 issuer 字母组合、[ISSUER_NAME]、issuer 地址和邮箱、大号 INVOICE 标题以及当前发票编号开头。两列 Bill to 和 Invoice details 块显示 [CLIENT_NAME] 和客户详情,以及 issue date、due date 和 currency。项目表重复 Description、Qty、Rate 和 Amount,包含三个默认行。右下角总计块显示 Subtotal、Discount、Tax,以及未更改默认值时的粗体 Total due 2413.98。以 Payment notes 结尾,通用注释 Payment due within 14 days. Please include the invoice number in the transfer reference.,以及 Thank you for the opportunity to work together。添加小号页脚行 Prepared with [BRAND] · Stored locally in your browser。所有可见发票值在编辑时必须立即更新。
   布局:桌面端右侧预览列填充剩余宽度,并在编辑器滚动时粘性固定在顶栏下方 24px 处。居中一张白色纸张,最大宽度 780px,最小可读文档比例,48px 内边距,以及细微纸张阴影;允许页面垂直滚动,确保完整纸张永不被裁剪。INVOICE 使用 Source Serif 4 700 44px,Total due 使用 28px,数字列使用 IBM Plex Mono。低于 900px 时,根据 Edit / Preview 标签显示编辑器或预览。移动端使用流式 28px 内边距的纸张,堆叠元数据块,并将项目行转换为可读的堆叠块,而非缩小 A4 图像。打印样式表隐藏除发票外的所有应用元素,移除阴影和背景,设置白色纸张和黑色文本,保留表格和总计,避免破坏单个项目行,并使用合理的 A4/Letter 边距。
   动效:预览在每次击键时不产生动画。移动端 Edit / Preview 使用可选的 120ms 交叉淡入淡出,在减少动效时禁用。打印无动画。
5. **已保存客户抽屉与反馈** — Saved clients 打开一个标题为 Saved clients 的抽屉,说明为 Reuse billing details without creating an account。Save current client 使用当前客户名称、地址和邮箱添加或更新记录,重复名称在覆盖前确认。每个已保存行显示客户名称和邮箱,以及 Apply 和 Delete 操作;Apply 仅填充客户字段并关闭抽屉,而 Delete 请求确认。包含空状态:No saved clients yet. Fill in the client details and choose Save current client。重新加载后恢复已保存记录和活动草稿。使用短 toast 提示 Client saved、Client applied、Client deleted、Logo removed 和存储失败。
   布局:桌面端使用 380px 右侧抽屉,带半透明 Ink 遮罩、关闭按钮和可滚动列表。移动端使用全屏面板,具有相同控件和至少 44px 的点击目标。将键盘焦点限制在打开的抽屉或确认对话框中,按 Escape 关闭,将焦点返回调用按钮,模态 UI 打开时绝不允许背景交互。
   动效:抽屉和 toast 过渡遵循设计动效规则,在减少动效时变为即时。

## 资产
- 图标:安装并导入 lucide-react(ISC),用于 Plus、Trash2、Users、Upload、X、Printer、RotateCcw、Check 和 ChevronDown。通过 npm 包将图标保持为内联和本地形式,为仅含图标的按钮添加无障碍名称,并且不使用任何品牌或支付服务图标。在 SVG/CSS 中绘制原创的 [BRAND] 收据与对勾标记以及发行方字母组合。
- 字体:通过 @fontsource-variable/inter、@fontsource-variable/source-serif-4 和 @fontsource/ibm-plex-mono 自托管 Inter Variable、Source Serif 4 Variable 和 IBM Plex Mono。仅导入指定的字重,不包含任何远程字体 URL,并在 ASSETS.md 中记录包路径、上游来源、作者和 OFL 许可证。

## 禁止事项(Don'ts)
- 不要添加后端、服务器路由、账户、身份验证、数据库、云同步、支付收款、分析统计、第三方 API、实时税率查询或汇率换算。
- 不要复制现有开票产品、其精确布局、文案、插图、图标、品牌化发票设计或专有视觉资产;仅使用此处描述的原创界面。
- 不要使用真实商业身份、真实徽标、支付服务商标、可识别的商业产品、图库照片服务、热链接文件或生成的图像。
- 不要加载 Google Fonts、Adobe Fonts、CDN 脚本、CDN CSS 或商业字体;仅自托管列出的开源许可 Fontsource 包。
- 不要添加 PDF 库或伪造下载的 PDF;使用 window.print 和专用打印样式表,以便浏览器可以打印或将发票保存为 PDF。
- 不要在 src/content.ts 之外硬编码默认内容,也不要在变量变化时留下过时的设计服务行项目、地址、名称或备注;将所有网站文案保持为美式英语,并且除了可选的署名链接外,绝不提及 VibeFather。
- 不要将数据存储在任何地方,除了带版本的 localStorage 键,并且不要声称本地草稿或客户已同步、在账户中受到保护或在另一台设备上可用。
- 不要允许无效计算、负数输入或总计、NaN、未处理的 localStorage 失败、来自上传或输入内容的原始 HTML 注入,或在重置期间静默丢失已保存的客户数据。
- 不要引入额外页面、裸目录链接、营销部分、落地页主视觉、轮播、装饰性渐变、玻璃效果或无关的仪表板小部件。
- 不要发布 source maps、dist/ 中的 src/、远程资产、绝对资产路径或超过 20 MB 的 dist/ 包;单个 index.html 构建必须能在静态托管下运行,且控制台零错误。
- 不要牺牲键盘访问、可见标签、焦点管理、44px 移动端目标、可读对比度、减少动态效果支持或 1440×900 和 390×844 布局。

---
— Prompt by VibeFather · https://vibefather.ai/t/invoice-generator-tool · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown

个人项目可免费使用(CC BY-NC 4.0)。 商业用途需要 Pro.

DESIGN.md

单独的设计规范:配色、字体、间距和动效。可以把这套视觉用到你已有的项目上。

---
name: "Invoice Generator Tool"
colors:
  canvas: "#F3F0E9"
  panel: "#FBFAF7"
  paper: "#FFFFFF"
  ink: "#18201D"
  muted: "#68716B"
  rule: "#D9DDD6"
  accent: "#1F6F54"
  accent_soft: "#DDEBE3"
  danger: "#A54732"
typography:
  document_display_and_invoice_totals: { family: "Source Serif 4 Variable", weights: [600, 700] }
  application_ui_labels_inputs_and_body_copy: { family: "Inter Variable", weights: [400, 500, 600, 700] }
  quantities_rates_invoice_number_and_aligned_amounts: { family: "IBM Plex Mono", weights: [400, 500, 600] }
spacing: "Use a 4px base scale. Desktop page padding is 28px, the top bar is 64px high, editor cards have 20px padding, form sections are separated by 24px, inputs are at least 44px high, and the workspace columns have a 24px gap. The invoice sheet uses 48px padding on desktop and 28px on mobile. Mobile page padding is 16px with 16px card padding and 12px field gaps."
radius: "Use 10px for editor cards and primary buttons, 8px for inputs and secondary buttons, 999px only for the small saved-status pill, and 2px for the invoice sheet. Avoid excessive pill shapes and floating rounded containers."
---

# Invoice Generator Tool — Design System

Apply this design system to an existing project. It describes the look and feel only; for the full site, use prompt.md.

## Colors
- **Canvas** `#F3F0E9` — Warm gray application background behind the workspace.
- **Panel** `#FBFAF7` — Editor cards, drawers, and restrained secondary surfaces.
- **Paper** `#FFFFFF` — Live invoice sheet and all printed pages.
- **Ink** `#18201D` — Primary text, invoice heading, and high-emphasis borders.
- **Muted** `#68716B` — Helper text, metadata, and secondary labels with readable contrast.
- **Rule** `#D9DDD6` — Input borders, table rules, and separators.
- **Accent** `#1F6F54` — Primary buttons, active tabs, focus rings, and selected actions.
- **Accent Soft** `#DDEBE3` — Saved-state background, active field tint, and subtle invoice accent block.
- **Danger** `#A54732` — Delete and remove actions only.

## Typography
- **Document display and invoice totals** — Source Serif 4 Variable (OFL), weights 600/700. Self-host the font files.
- **Application UI, labels, inputs, and body copy** — Inter Variable (OFL), weights 400/500/600/700. Self-host the font files.
- **Quantities, rates, invoice number, and aligned amounts** — IBM Plex Mono (OFL), weights 400/500/600. Self-host the font files.

## Spacing & shape
- Spacing: Use a 4px base scale. Desktop page padding is 28px, the top bar is 64px high, editor cards have 20px padding, form sections are separated by 24px, inputs are at least 44px high, and the workspace columns have a 24px gap. The invoice sheet uses 48px padding on desktop and 28px on mobile. Mobile page padding is 16px with 16px card padding and 12px field gaps.
- Radius: Use 10px for editor cards and primary buttons, 8px for inputs and secondary buttons, 999px only for the small saved-status pill, and 2px for the invoice sheet. Avoid excessive pill shapes and floating rounded containers.

## Motion
- Use 120–160ms ease-out transitions for button hover, border color, focus rings, tabs, and drawer overlays; never animate calculated digits or delay their update.
- New line-item rows fade and translate upward 6px over 160ms, and removed rows exit without a large layout jump.
- Toasts enter from the bottom with a 180ms fade and 8px rise; the saved-client drawer slides 16px from the right on desktop and fades in as a full-screen sheet on mobile.
- Under prefers-reduced-motion, remove sliding and row entrance motion and make all state changes immediate.

## Imagery
Use no stock or generated images. The first-screen visual anchor is the rich live invoice itself: a crisp white paper sheet, original issuer monogram, fine rules, structured line items, and a precise totals block above a soft 0 18px 50px rgba(24,32,29,0.10) shadow. Before upload, derive a simple two-letter issuer monogram from [ISSUER_NAME] inside an Accent Soft square. The upload control accepts a local PNG, JPEG, or WebP up to 2 MB and displays that image only in the invoice logo position. Use Lucide icons for controls and draw the [BRAND] mark as an original geometric receipt-and-check SVG; never use real business or payment-service marks.

## Tone
Quietly capable, precise, approachable, and paper-inspired. Use direct labels and practical helper text, with no promotional slogans, fake cloud claims, or financial advice.

---
— Prompt by VibeFather · https://vibefather.ai/t/invoice-generator-tool · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown

改成你自己的

  • 独立设计工作室:将 [BRAND] 设为你的工作室名称,[ISSUER_NAME] 设为你的执业名称,并围绕 [SERVICE_TYPE] 重写示例明细项,让第一张发票读起来像你自己的作品。
  • 自行车维修店:使用替代案例,将 [ISSUER_LOCATION] 设为你的城镇,将 [SERVICE_TYPE] 改为维修和保养,并将明细项编辑为零件、人工和调试。
  • 自由职业顾问:保留极简布局,将 [CLIENT_NAME] 设为你所在领域的示例客户,并调整备注和付款条款以匹配你通常的合同措辞。
  • 在其他市场计费的小型代理机构:将 [CURRENCY] 设为 EUR、GBP、CAD、AUD 或 JPY,并在发送发票前确认总计块能干净地四舍五入。

发票生成器工具:常见问题

如何更改发票生成器工具模板上的货币?

将 CURRENCY 变量设置为你希望发票初始使用的 ISO 代码:USD、EUR、GBP、CAD、AUD 或 JPY。编辑器中的选择器可在这些代码之间切换,并按该货币的精度重新格式化每一笔金额。模板明确说明切换货币不会进行汇率换算,因此数字保持输入时的值。

如何从此模板打印发票或将其保存为 PDF?

应用页眉中的“打印 / 保存 PDF”按钮会调用浏览器自带的打印对话框。专用的打印样式表会隔离白色发票纸张并隐藏编辑器,因此打印页面只显示文档。在该对话框中选择打印机或“另存为 PDF”目标。模板不会直接下载文件或自行生成 PDF。

怎么用 AI 做一个发票生成器工具?

复制本页的提示词,或者运行 npx vibefather add invoice-generator-tool,把 [BRAND]、[CURRENCY]、[CLIENT_NAME]、[ISSUER_NAME] 换成你自己的内容,再粘贴到 Claude Code、Codex、Cursor 等 AI 编程工具里。在线演示就是用这份提示词原样做出来的。