Why Build Tools Without a Framework?
Frameworks like React and Vue are great for large applications. But for small, self-contained tools, they add unnecessary complexity. A pure HTML + CSS + JavaScript tool:
- ✓Opens immediately in any browser
- ✓Has zero dependencies
- ✓Is a single file you can share anywhere
- ✓Teaches you the fundamentals that frameworks are built on
Tool 1 — Calculator with Keyboard Support
The tricky part of a calculator is the math logic. We avoid eval() for security reasons and build our own expression handler:
let current = '0';
let expression = '';
function calculate() {
const fullExpr = expression + current;
const safe = fullExpr.replace(/[^0-9+\-*/. ]/g, '');
const result = Function('"use strict"; return (' + safe + ')')();
current = String(parseFloat(result.toFixed(10)));
}
// Keyboard support
document.addEventListener('keydown', (e) => {
if (e.key >= '0' && e.key <= '9') inputNum(e.key);
else if (e.key === 'Enter') calculate();
else if (e.key === 'Escape') clearCalc();
});
Tool 2 — Password Generator with Crypto
We use crypto.getRandomValues() instead of Math.random() for cryptographically secure passwords:
function generate(length, chars) {
let password = '';
const arr = new Uint32Array(length);
crypto.getRandomValues(arr);
arr.forEach(v => password += chars[v % chars.length]);
return password;
}
Tool 3 — To-Do List with localStorage
Tasks persist after closing the browser:
let tasks = JSON.parse(localStorage.getItem('todos') || '[]');
function save() {
localStorage.setItem('todos', JSON.stringify(tasks));
}
function addTask(text) {
tasks.unshift({ id: Date.now(), text, done: false });
save();
render();
}
Tool 4 — Countdown Timer with Sound Alert
When the timer hits zero, we use the Web Audio API to play a beep without any audio file:
function playBeep() {
const ctx = new AudioContext();
const osc = ctx.createOscillator();
const gain = ctx.createGain();
osc.connect(gain);
gain.connect(ctx.destination);
osc.frequency.value = 880;
gain.gain.exponentialRampToValueAtTime(0.001, ctx.currentTime + 0.3);
osc.start();
osc.stop(ctx.currentTime + 0.3);
}
This is a preview. The full ebook includes the complete code for all 5 tools — including the SVG circular ring for the timer and the color history swatch grid for the color picker — plus a deployment guide.
