跳到正文
DEV Community· devbox-zero-ops·· 49 分鐘前AI 評分54

作者打造 TokenCost Zero 等 6 款零追蹤單檔網頁工具,並介紹其架構

I Built 6 Zero-Tracking Single-File Web Tools (DevTools, LLM Cost, Invoices & Resumes) — Here's the Architecture

AI 導讀

作者打造並開源 6 款零追蹤的單檔 HTML 網頁工具,全部在瀏覽器本機運行,毋須後端、追蹤機制或建置步驟。工具包括 LLM token 與 API 成本估算、開發者工具組、發票及履歷 PDF 產生器、DeFi 計算器,以及整合入口。架構以原生 `<dialog>`、列印 CSS 及 localStorage/JSON 快照取代 500 KB 的外部依賴,並支援離線執行與本機草稿儲存。

正文

devbox-zero-ops

Every time I needed to decode a production JWT, format a sensitive JSON payload, generate a client invoice PDF, or estimate LLM API spend, I kept running into the same annoyances:

  • Mandatory sign-ups or paywalls just to export a clean PDF without watermarks
  • Heavy analytics trackers watching every keystroke on sensitive business data
  • Slow SPA bundles for tasks that modern browsers can execute in under 1 millisecond locally

So I built a small open-source suite of 100% browser-local, single-file HTML utilities — zero backend, zero tracking, zero build step, and instant offline execution.

The Live Open-Source Suite

All tools run completely client-side and are hosted statically on GitHub Pages:

  1. TokenCost Zero — Local LLM token estimator (EN + CJK) and multi-model API cost comparison across OpenAI, Claude, Gemini, DeepSeek, and Qwen with prompt-cache hit-rate modeling and CSV export.
  2. DevBox Zero — 8-in-1 privacy-first developer toolkit: JSON-to-TypeScript generator, JWT decoder, Base64/URL codec, Cron parser, Text Diff, Regex Live Tester, SHA-256/512 Hasher, and UUID/Secret generator.
  3. InvoiceZero — Watermark-free multi-currency Invoice & Quotation generator (USDT, USD, CNY, EUR, GBP, USDC) with auto tax/discount math, JSON backup/restore, and crisp A4 PDF export.
  4. ResumeMD Zero — Local Markdown resume builder with 3 ATS-friendly themes and one-click A4 PDF print export.
  5. ChainCalc Zero — Client-side DeFi Impermanent Loss (Uniswap V2/V3), Gas-Adjusted APY compounding, and Position Sizing calculator.
  6. XiaheAI Hub — Bilingual portal bringing all tools together (plus source links and custom automation inquiries).

3 Modern Browser Primitives That Replaced 500 KB of Dependencies

1. Native <dialog> Instead of Modal Libraries

Modern HTML <dialog> handles focus trapping, Esc dismissal, and ::backdrop styling natively:

<dialog id="tipDialog">
  <h3>Support Open-Source Maintenance</h3>
  <button onclick="document.getElementById('tipDialog').close()">Close</button>
</dialog>
dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
}

2. Pixel-Clean Watermark-Free A4 PDFs with @media print

Instead of shipping html2canvas + jspdf (which rasterize text into blurry bitmaps), both InvoiceZero and ResumeMD Zero use native vector print CSS:

@media print {
  @page { size: A4; margin: 0; }
  header, .editor, .no-print { display: none !important; }
  .sheet { width: 210mm; min-height: 297mm; box-shadow: none; margin: 0; }
}

The browser's built-in window.print() produces sharp, selectable, ATS-parseable vector PDFs with zero watermarks.

3. Resilient localStorage + JSON Snapshots

Sensitive drafts (client invoices, resumes) stay strictly in localStorage and can be exported/imported as portable .json files — no database costs, no GDPR liability, and zero latency.


Source Code & Feedback

Everything is open-source under github.com/devbox-zero-ops.

If there is a daily developer or freelance utility you wish had a fast, zero-tracking local version, drop a comment below — I'm actively adding new tools to the suite!

來源:DEV Community · dev.to