A lightweight, data-driven web catalog of USB-chargeable battery cells and modules.
Built by Bocaletto Luca, this project separates content (JSON) from presentation (HTML/CSS/JS) for easy maintenance and extensibility.
usb-charge-battery/
├── index.html
├── data/
│ └── sections.json
├── js/
│ └── main.js
├── css/
│ └── styles.css
└── README.md
- Fetches battery specs from
data/sections.json - Renders semantic HTML with a specs table and key-features list
- Responsive, mobile-first CSS
- Graceful fallback when JavaScript is disabled
- Modular code: update JSON or styles without touching core logic
-
Clone the repo
git clone https://github.com/bocaletto-luca/usb-charge-battery.git cd usb-charge-battery -
Serve locally
- Using VS Code Live Server
- Or with Python:
python3 -m http.server 8000 - Then open
http://localhost:8000in your browser.
-
Browse the catalog
- Each section is anchored by its battery ID (
#nimh-1s,#li-ion-3s, etc.) - Clickable images and tables for quick reference
- Each section is anchored by its battery ID (
-
Add or edit batteries
Modifydata/sections.json—each object maps to one section. -
Styling
Tweakcss/styles.cssor introduce your own theme file. -
Rendering logic
Updatejs/main.jsto change how specs are displayed (e.g., Markdown, modals, sorting).
- Client-side search/filter UI
- Dark mode toggle
- Markdown support for rich descriptions
- PWA support for offline viewing
- CI flow: auto-deploy GitHub Pages on push
- Fork this repository
- Create a feature branch (
git checkout -b feat/your-idea) - Commit your changes (
git commit -m "feat: add …") - Push to your branch (
git push origin feat/your-idea) - Open a Pull Request
Distributed under the MIT License. See LICENSE for details.
⭐️ If you find this project useful, give it a star on GitHub!