⚠️ DISCLAIMER: This is a personal learning and portfolio project. It demonstrates JavaScript random generation, slider input handling, and clipboard interaction. Passwords are generated entirely in the browser usingMath.random()and are never transmitted, logged, or stored anywhere. For real-world password security, use a dedicated, audited password manager.
A clean, lightweight web tool that generates random passwords from a mix of letters, digits, and symbols. Adjust the length with a slider (4–20 characters), hit Generate, and copy the result to your clipboard with one click — all in a responsive, mobile-friendly layout.
- Live Demo: passwordkeeper.netlify.app
- Source Code: github.com/Ashish22Gupta/Random_password_Generator
- Slider Input - Range slider from
4to20characters, defaulting to12. - Live Length Display - The current value updates instantly beside the slider via
updateLength(). - Dynamic Generation - The password length always matches the slider value at the time of generation.
- Mixed Character Set - Combines digits (
0–9), lowercase (a–z), uppercase (A–Z), and special characters (!@#$%^&*()). - Random Indexing - Each character is chosen via
Math.floor(Math.random() * chars.length). - One-Click Generate - The "Generate Password" button fills the readonly display field instantly.
- Readonly Output - The result field is
readonly, preventing accidental edits while still allowing copy.
- One-Click Copy - The "Copy Password" button selects the field and runs
document.execCommand("copy"). - Full-Length Selection -
setSelectionRange(0, 999)ensures the entire password is copied regardless of length. - Confirmation Alert - A success message ("Password copied successfully!") confirms the action.
- Clean, Minimal UI - Soft
#f0f4f8background with centered content and blue accents. - Hover Feedback - Buttons transition from
#007bffto#0056b3on hover for tactile feel. - Rounded Inputs - Consistent
5pxborder-radius across the password field and buttons. - Responsive Controls - Slider, input, and buttons use
width: 90%withmax-widthcaps so they never overflow.
- Mobile-Friendly Inputs - Slider caps at
200px; password field caps at300px. - Small-Screen Heading - Below
352px, theh1shrinks tox-largeto prevent overflow. - Touch-Friendly Buttons - Fixed
150×40pxbuttons with10pxmargins for comfortable tapping.
| Technology | Purpose |
|---|---|
| HTML5 | Semantic markup with range input and readonly field |
| CSS3 | Centered layout, hover transitions, media queries |
| Vanilla JavaScript | Random generation, slider updates, clipboard copy |
| Netlify | Static hosting and deployment |
Random_password_Generator/
├── index.html # UI: slider, display field, generate/copy buttons
├── style.css # Layout, buttons, responsive rules
└── script.js # Generation, copy, length-update logic