Skip to content

Commit

Permalink
create index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
gusevgrishaem1 committed Nov 9, 2024
1 parent b9efc3e commit 8b65cd1
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
26 changes: 26 additions & 0 deletions index.html
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>
12 changes: 12 additions & 0 deletions script.js
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;
}
75 changes: 75 additions & 0 deletions style.css
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;
}

0 comments on commit 8b65cd1

Please sign in to comment.