Skip to content

Commit c3b882d

Browse files
committed
added a random password generarator file
1 parent 58214c9 commit c3b882d

File tree

2 files changed

+117
-1
lines changed

2 files changed

+117
-1
lines changed

passgenerator/passwordgenerator.html

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Password Generator</title>
7+
<style>
8+
body {
9+
font-family: 'Arial', sans-serif;
10+
text-align: center;
11+
margin: 0;
12+
padding: 0;
13+
background-color: #333131;
14+
display: flex;
15+
justify-content: center;
16+
align-items: center;
17+
height: 100vh;
18+
overflow: hidden;
19+
}
20+
21+
.container {
22+
max-width: 400px;
23+
background-color: #f1eaea;
24+
border-radius: 8px;
25+
padding: 20px;
26+
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
27+
position: relative;
28+
animation: borderAnimation 2s infinite alternate;
29+
width:400px;
30+
}
31+
.line {
32+
position: absolute;
33+
width: 100%;
34+
height: 2px;
35+
background-color: #007bff;
36+
animation: moveLine 2s linear infinite;
37+
}
38+
h2 {
39+
color: #333;
40+
}
41+
42+
label, input {
43+
display: block;
44+
margin: 10px 0;
45+
}
46+
47+
input[type="number"] {
48+
width: 100%;
49+
padding: 10px;
50+
border: 1px solid #ccc;
51+
border-radius: 4px;
52+
}
53+
54+
button {
55+
background-color: #c70a0a;
56+
color: #fff;
57+
border: none;
58+
padding: 10px 20px;
59+
border-radius: 4px;
60+
cursor: pointer;
61+
transition: background-color 0.3s ease;
62+
}
63+
64+
button:hover {
65+
background-color: #0056b3;
66+
}
67+
68+
input[type="text"] {
69+
width: 100%;
70+
padding: 10px;
71+
border: 1px solid #ccc;
72+
border-radius: 4px;
73+
margin-top: 10px;
74+
}
75+
76+
@keyframes fadeIn {
77+
from {
78+
opacity: 0;
79+
}
80+
to {
81+
opacity: 1;
82+
}
83+
}
84+
85+
#generatedPassword {
86+
animation: fadeIn 0.5s ease-in;
87+
}
88+
</style>
89+
</head>
90+
<body>
91+
<div class="container">
92+
<h2>Password Generator</h2>
93+
<label for="passwordLength">Password Length:</label>
94+
<input type="number" id="passwordLength" value="12" min="6" max="30">
95+
<br>
96+
<button onclick="generatePassword()">Generate Password</button>
97+
<br>
98+
<input type="text" id="generatedPassword" readonly>
99+
</div>
100+
101+
<script>
102+
function generatePassword() {
103+
const passwordLength = document.getElementById('passwordLength').value;
104+
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-+=";
105+
let password = "";
106+
107+
for (let i = 0; i < passwordLength; i++) {
108+
const randomIndex = Math.floor(Math.random() * charset.length);
109+
password += charset.charAt(randomIndex);
110+
}
111+
112+
document.getElementById('generatedPassword').value = password;
113+
}
114+
</script>
115+
</body>
116+
</html>

snippets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"name": "Helpline",
109109
"codepen-link": "https://codepen.io/Swathi-Singh/pen/dywjqoz",
110110
"image-link": "https://wpassets.adda247.com/wp-content/uploads/multisite/sites/5/2020/04/11132345/Helpline.jpg",
111-
"folder-link": "https://github.com/Deveesh-Shetty/CSS-Is-Fun/tree/master/UI%20Snippets/Session%20Graph",
111+
"folder-link": "https://github.com/Swathi1203/CSS-Is-Fun/tree/add-new-tablecontent/UI%20Snippets/Helpline",
112112
"author": "swathi singh"
113113
}
114114
]

0 commit comments

Comments
 (0)