尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Free practical calculators for estimating how much material, space, or quantity you need.
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
Free practical calculators for estimating how much material, space, or quantity you need.
Each calculator asks for a few measurements and shows three things: the exact calculated quantity, a sensible amount to buy (with an adjustable allowance for waste, rounded up to real product sizes), and the working behind both.查看完整 README ↗Free practical calculators for estimating how much material, space, or quantity you need.
Live site: https://how-much-do-i-need.freewebtoolss.workers.dev
Each calculator asks for a few measurements and shows three things: the exact calculated quantity, a sensible amount to buy (with an adjustable allowance for waste, rounded up to real product sizes), and the working behind both.
| Calculator | URL |
|---|---|
| Paint Calculator | /paint-calculator/ |
| Wallpaper Calculator | /wallpaper-calculator/ |
| Flooring Calculator | /flooring-calculator/ |
| Tile Calculator | /tile-calculator/ |
| Drywall Calculator | /drywall-calculator/ |
| Insulation Calculator | /insulation-calculator/ |
| Mulch Calculator | /mulch-calculator/ |
| Soil Calculator | /soil-calculator/ |
| Gravel Calculator | /gravel-calculator/ |
| Grass Seed and Sod Calculator | /grass-seed-sod-calculator/ |
| Fence Calculator | /fence-calculator/ |
| Deck Board Calculator | /deck-calculator/ |
| Paver Calculator | /paver-calculator/ |
| Retaining Wall Block Calculator | /retaining-wall-calculator/ |
| Pool and Water Tank Volume Calculator | /pool-volume-calculator/ |
| Concrete Calculator | /concrete-calculator/ |
| Brick Calculator | /brick-calculator/ |
| Roofing Shingle Calculator | /roofing-calculator/ |
| Moving Box Calculator | /moving-boxes-calculator/ |
| Moving Truck Size Calculator | /moving-truck-size-calculator/ |
| Party Food and Drink Calculator | /party-food-calculator/ |
| Storage Calculator | /storage-calculator/ |
| Internet Speed and Data Calculator | /internet-speed-data-calculator/ |
npx only to deploy.src/
calculators/ one file per calculator + index.mjs registry
_shared.mjs field factories and display helpers
lib/
units.mjs exact unit definitions, rounding, number formatting
validate.mjs input validation (pure), run() helper
render.mjs form and result HTML (build + browser)
engine.mjs browser runtime: live results, US/Metric switch, reset
search.mjs calculator search/filter on the home and list pages
pages/templates.mjs page layouts (home, all calculators, calculator, about, privacy, 404)
static/ CSS, icons, social image, _headers (security headers)
site.config.mjs site URL, name, ad slot settings
scripts/
build.mjs generates dist/ (pages, sitemap.xml, robots.txt, browser JS)
serve.mjs local server that mimics Cloudflare's URL handling
make-images.mjs re-renders the PNG icons and og-image.png with headless Chrome
test/
*.test.mjs unit + build tests (node --test)
e2e/run.mjs browser tests in headless Chrome over the DevTools protocol
Requires Node 20 or newer (Node 22+ for the browser tests).
npm run build # generate dist/
npm test # formula, validation and build tests
npm run test:e2e # build, then test every page in headless Chrome
npm run serve # build, then serve dist/ at http://localhost:8788
npx wrangler deploy # build, then deploy dist/ to Cloudflare
The browser tests look for Chrome in the usual places; set CHROME_PATH to use another Chromium-based browser. To test the live site instead of a local build: BASE_URL=https://how-much-do-i-need.freewebtoolss.workers.dev node test/e2e/run.mjs.
wrangler.jsonc configures an assets-only Cloudflare Worker (no Worker script). Wrangler runs node scripts/build.mjs first (the build.command), then uploads dist/, which is the folder the build writes the finished static site into. html_handling: "auto-trailing-slash" gives clean URLs such as /paint-calculator/, and not_found_handling: "404-page" serves dist/404.html with a 404 status.
If the site moves to a custom domain, change SITE.url in src/site.config.mjs and redeploy. Canonical links, Open Graph URLs, robots.txt and sitemap.xml all come from it.
src/calculators/<name>.mjs exporting a definition: id, slug, name, question, category, keywords, title, description, summary, intro, groups, inputs, compute(values), present(result, ctx) and content (explanatory sections, including how it works and the rounding rules). Copy an existing one as a starting point.src/calculators/index.mjs and add it to CALCULATORS.test/calculators.test.mjs, then run npm test and npm run test:e2e.The build creates the page, the links, the search entry and the sitemap entry. It fails if a title or description is missing, duplicated or too long, or if the default inputs don't produce a result.
compute() receives every measurement in SI base units (metres, m², m³, m² per litre, kg/m³, bytes), so it never has to deal with unit conversion. present() turns the result into the display model: a headline, an "Estimated amount to buy" section, a "Calculated quantity" section, the step-by-step working and notes.
Ads are Adsterra banners, configured in ADS in src/site.config.mjs. Nothing ad-related is built until at least one unit there has a key and a src (the invoke.js URL from Adsterra's Get code). Then:
/ads/<unit>.html, a tiny page the build generates. The iframe has sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox" (no same-origin, no top navigation), so ad code can't read the calculator, the site's storage, or redirect the page. /ads/* gets its own Content-Security-Policy in src/static/_headers; every other page keeps the strict one and loads no third-party code.src/lib/ads.mjs asks first when the browser's time zone is in the EU/EEA, UK or Switzerland. Ad choices in the footer lets anyone change their choice; it's stored in localStorage as hmdin-ad-consent.ADS.privacyUpdated when ads go live or change.npm run test:e2e includes test/e2e/ads.mjs, which builds with stub units (test/fixtures/stub-ads.mjs) and checks consent, unit sizes, sandboxing and print in headless Chrome. scripts/serve.mjs applies _headers the way Cloudflare does, so local tests run under the real security headers.
Unit conversions use exact definitions (1 in = 2.54 cm, 1 ft = 0.3048 m, 1 US gal = 3.785411784 L, 1 lb = 0.45359237 kg). Results are estimates. The pages explain what can change them and why the waste allowances exist. Found a mistake? Please open an issue.
MIT