-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpasswordGenerator.html
172 lines (148 loc) · 4.82 KB
/
passwordGenerator.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Premium Password Generator</title>
<link rel="icon" type="image/x-icon" href="https://i.ibb.co/hFgvR8sC/password-Generator.png">
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Roboto', sans-serif;
background: linear-gradient(135deg, #2C3E50, #4CA1AF);
color: #ECF0F1;
display: flex;
flex-direction: column;
min-height: 100vh;
}
main {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex: 1;
/* Takes up remaining space without stretching */
}
.container {
background: rgba(44, 62, 80, 0.8);
padding: 30px;
border-radius: 15px;
text-align: center;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
width: 90%;
max-width: 400px;
/* Set a max width to prevent stretching */
}
.logo {
width: 100px;
margin-bottom: 20px;
}
h1 {
margin-bottom: 20px;
}
input {
padding: 10px;
border: none;
border-radius: 5px;
width: 200px;
margin-bottom: 10px;
}
button {
background-color: #3498DB;
color: white;
border: none;
border-radius: 5px;
padding: 10px 20px;
cursor: pointer;
transition: background 0.3s;
}
button:hover {
background-color: #2980B9;
}
.result {
margin: 20px 0;
font-size: 1.2em;
padding: 10px;
background-color: #E74C3C;
border-radius: 5px;
word-wrap: break-word;
/* Ensures long text wraps */
overflow-wrap: break-word;
/* Additional support */
text-align: center;
display: block;
max-width: 100%;
/* Prevents overflow */
white-space: pre-wrap;
/* Allows wrapping without cutting words */
}
.copy-button {
background-color: #27AE60;
}
.copy-button:hover {
background-color: #229954;
}
/* Footer Styles */
.footer {
width: 100%;
text-align: center;
padding: 10px;
background: #1C2833;
color: #ECF0F1;
}
.github-link {
color: #3498DB;
text-decoration: none;
font-weight: bold;
}
.github-link:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<main>
<div class="container">
<img src="https://i.ibb.co/0FTRddW/password-entry.png" alt="Logo" class="logo">
<h1>Password Generator</h1>
<input type="number" id="length" placeholder="Password Length" min="6">
<button onclick="generatePassword()">Generate Password</button>
<p id="result" class="result"></p>
<button onclick="copyToClipboard()" class="copy-button">Copy to Clipboard</button>
</div>
</main>
<footer class="footer">
<p class="developer-text">Developed by <a href="https://github.com/ExploitInject" class="github-link"
target="_blank">ExploitInject</a></p>
</footer>
<script>
function generatePassword() {
const length = document.getElementById("length").value;
const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";
let password = "";
if (length < 6) {
alert("Password length should be at least 6.");
return;
}
for (let i = 0; i < length; i++) {
password += chars.charAt(Math.floor(Math.random() * chars.length));
}
document.getElementById("result").innerText = password;
}
function copyToClipboard() {
const password = document.getElementById("result").innerText;
if (!password) {
alert("Please generate a password first.");
return;
}
navigator.clipboard.writeText(password).then(() => {
alert("Password copied to clipboard!");
});
}
</script>
</body>
</html>