-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9efc3e
commit 8b65cd1
Showing
3 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Password Generator</title> | ||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap" rel="stylesheet"> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<h1>Password Generator</h1> | ||
<input type="text" id="password" class="password" readonly placeholder="Your password will appear here" /> | ||
<br> | ||
<button onclick="generatePassword()">Generate Password</button> | ||
<div class="footer"> | ||
<p>Created with ❤️ by You</p> | ||
</div> | ||
</div> | ||
|
||
<script src="script.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
function generatePassword() { | ||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+'; | ||
const passwordLength = 12; // Length of the password to generate | ||
let password = ''; | ||
|
||
for (let i = 0; i < passwordLength; i++) { | ||
const randomIndex = Math.floor(Math.random() * characters.length); | ||
password += characters[randomIndex]; | ||
} | ||
|
||
document.getElementById('password').value = password; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* General Body and Layout Styles */ | ||
body { | ||
font-family: 'Poppins', sans-serif; | ||
background: linear-gradient(135deg, #6a82fb, #fc5c7d); | ||
color: #fff; | ||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
} | ||
|
||
.container { | ||
text-align: center; | ||
background: rgba(0, 0, 0, 0.7); | ||
padding: 30px 50px; | ||
border-radius: 10px; | ||
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); | ||
width: 100%; | ||
max-width: 400px; | ||
} | ||
|
||
h1 { | ||
font-size: 2.5rem; | ||
margin-bottom: 20px; | ||
} | ||
|
||
/* Password Display Styles */ | ||
.password { | ||
font-size: 1.8rem; | ||
letter-spacing: 1px; | ||
word-wrap: break-word; | ||
background: #333; | ||
color: #fff; | ||
padding: 15px; | ||
border: none; | ||
border-radius: 8px; | ||
margin-bottom: 20px; | ||
width: 100%; | ||
text-align: center; | ||
box-sizing: border-box; | ||
} | ||
|
||
.password:focus { | ||
outline: none; | ||
background: #444; | ||
} | ||
|
||
/* Button Styles */ | ||
button { | ||
background: #ff66b2; | ||
border: none; | ||
color: #fff; | ||
font-size: 1.2rem; | ||
padding: 10px 30px; | ||
border-radius: 30px; | ||
cursor: pointer; | ||
transition: background 0.3s; | ||
} | ||
|
||
button:hover { | ||
background: #ff3385; | ||
} | ||
|
||
button:focus { | ||
outline: none; | ||
} | ||
|
||
/* Footer Styles */ | ||
.footer { | ||
margin-top: 20px; | ||
font-size: 0.9rem; | ||
color: #ccc; | ||
} |