Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions RANDOM PASSWORD GENERATOR/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random Password Generator</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>Random Password Generator</h1>
<label for="passwordLength">Password Length:</label>
<input type="number" id="passwordLength" min="1" value="12">
<div class="password-display" id="passwordDisplay"></div>
<button onclick="generatePassword()">Generate Password</button>
</div>
<script src="script.js"></script>
</body>
</html>
27 changes: 27 additions & 0 deletions RANDOM PASSWORD GENERATOR/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Random Password Generator

This is a simple web application that generates random passwords.

## How to Use

1. Clone this repository to your local machine.
2. Open the `index.html` file in your web browser.
3. Enter the desired length of the password in the input field.
4. Click the "Generate Password" button to generate a random password.
5. Copy the generated password for your use.

## Technologies Used

- HTML
- CSS
- JavaScript

## Screenshots

![Password Generator Screenshot](screenshot.png)

## Credits

- Created by [Abhishek Kumar]


Binary file added RANDOM PASSWORD GENERATOR/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions RANDOM PASSWORD GENERATOR/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

function generatePassword() {
const length = parseInt(document.getElementById("passwordLength").value);
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-="; // Character set for the password
let password = "";

for (let i = 0; i < length; i++) {
const randomIndex = Math.floor(Math.random() * charset.length);
password += charset.charAt(randomIndex);
}

// Display the generated password
const passwordDisplay = document.getElementById("passwordDisplay");
passwordDisplay.textContent = password;
}
58 changes: 58 additions & 0 deletions RANDOM PASSWORD GENERATOR/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
margin: 0;
padding: 0;
}

.container {
text-align: center;
margin-top: 50px;
}

h1 {
color: #333;
}

input[type="number"] {
padding: 10px;
font-size: 16px;
border: 2px solid hsl(0, 100%, 50%);
border-radius: 5px;
width: 80px;
margin-top: 20px;
transition: border-color 0.3s ease;
}

input[type="number"]:focus {
outline: none;
border-color: hsl(0, 100%, 40%);
}


.password-display {
margin-top: 20px;
font-size: 24px;
background-color: #fff;
padding: 10px 20px;
border: 2px solid hsl(0, 100%, 50%);
border-radius: 5px;
width: 300px;
margin: 20px auto;
}

button {
padding: 10px 20px;
background-color: hsl(0, 100%, 50%);
color: #fff;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;
margin-top: 20px;
}

button:hover {
background-color: hsl(0, 100%, 40%);
}