A fully static, client-side keycap configurator extracted from the ControlPad
website. Pick a symbol, colors, scale/rotation/depth, preview it on a 3D keycap,
and export a print-ready .3mf — everything runs in the browser, nothing is
uploaded or stored on a server.
- 3D preview —
three+@react-three/fiberrender the keycap STL with the engraved symbol live. .3mfexport — the symbol SVG is extruded, CSG-subtracted from the keycap body (three-bvh-csg), and zipped into a Bambu Studio-compatible.3mf(jszip) with two parts (body + inlay) for multi-material printing. This is a browser port of the original server-side Node script —jsdomandfswere the only server dependencies and are replaced by the browser's nativeDOMParserandfetch.- Icons — Tabler icons (outline + filled) are copied from the
@tabler/iconsnpm package intopublic/icons/byscripts/sync-icons.mjs(runs automatically beforedev/build). You can also upload your own SVG. - Config — colors, icon variants, and pricing are hardcoded in
src/config/keycap.ts(extracted from the original backend seeder).
npm install
npm run dev # http://localhost:5173 (syncs icons first)
npm run build # outputs static site to dist/
npm run preview # serve the production build locallyThe keycap model lives at public/keycap.stl. Replace it to change the base
keycap shape.
A workflow is included at .github/workflows/deploy.yml:
- Push this repo to GitHub.
- In Settings → Pages, set Source to GitHub Actions.
- Push to
main— the site builds and deploys automatically.
The build sets the Vite base path to /<repo>/ for project pages. If you host
it on a user/org page (<user>.github.io), change VITE_BASE in the workflow to
/.
All asset URLs (STL, icons) respect import.meta.env.BASE_URL, so the site works
correctly under a subpath.