Skip to content

Commit d0842b6

Browse files
committedApr 8, 2022
Random-password generator program added
1 parent 03e5f62 commit d0842b6

File tree

4 files changed

+99
-0
lines changed

4 files changed

+99
-0
lines changed
 

‎Random-password-generator/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Random Password Generator
2+
3+
- Random password generator program using html,css and javascript.
4+
5+
- Generates upto 4 random passwords of length 6.
6+
7+
# Screenshots
8+
9+
<img src="https://i.ibb.co/D92Pgr8/random-pass.png" alt="random-pass" border="0">

‎Random-password-generator/index.css

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
body {
2+
background: #ECFDF5;
3+
}
4+
h1 {
5+
color: black;
6+
font-family: 'Inter';
7+
filter: drop-shadow(8px 8px 10px black);
8+
9+
}
10+
#al {
11+
font-family: 'Inter';
12+
filter: drop-shadow(8px 8px 10px red);
13+
}
14+
h4 {
15+
color: #6B7280;
16+
font-family: 'Inter';
17+
filter: drop-shadow(8px 8px 10px brown);
18+
}
19+
button {
20+
position: static;
21+
height: 24px;
22+
left: 47px;
23+
top: 9px;
24+
padding-top: 2px;
25+
padding-bottom: 2px;
26+
margin: 0px 10px;
27+
background: lightgreen;
28+
color: darkgreen;
29+
font-family: 'Inter';
30+
font-size: 16px;
31+
border: green;
32+
filter: drop-shadow(8px 8px 10px green);
33+
cursor: pointer;
34+
}
35+
p {
36+
text-align: center;
37+
color: lightgreen;
38+
background: #273549;
39+
padding: 10px;
40+
41+
42+
}

‎Random-password-generator/index.html

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<html>
2+
<head>
3+
<link rel="stylesheet" href="index.css">
4+
</head>
5+
<body>
6+
<h1 align = "center">Generate a
7+
<br><div id ="al">random password</div>
8+
</h1>
9+
<h4 align = "center"><b>Never use an insecure password again.</b></h4>
10+
<button id = "password" onclick="generate()"><b>Generate passwords</b></button>
11+
<p id ="password-1">Password-1</p>
12+
<p id ="password-2">Password-2</p>
13+
<p id ="password-3">Password-3</p>
14+
<p id ="password-4">Password-4</p>
15+
<script src="index.js"></script>
16+
</body>
17+
</html>

‎Random-password-generator/index.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
let pass1 = document.getElementById("password-1");
2+
let pass2 = document.getElementById("password-2");
3+
let pass3 = document.getElementById("password-3");
4+
let pass4 = document.getElementById("password-4");
5+
6+
let arr = [];
7+
let arr1 = [];
8+
let arr2 = [];
9+
let arr3 = [];
10+
let arr4 = [];
11+
for (let i = 65 ; i < 123 ; i++ ) {
12+
arr += String.fromCharCode(i) // String.fromCharCode is used to generate alphabet from its ascii values
13+
}
14+
console.log(arr[2])
15+
function generate() {
16+
for (let j = 1; j < 9 ; j++ ) {
17+
arr1 += arr[Math.floor(Math.random() * 58)]
18+
arr2 += arr[Math.floor(Math.random() * 58)]
19+
arr3 += arr[Math.floor(Math.random() * 58)]
20+
arr4 += arr[Math.floor(Math.random() * 58)]
21+
}
22+
pass1.textContent = arr1;
23+
pass2.textContent = arr2;
24+
pass3.textContent = arr3;
25+
pass4.textContent = arr4;
26+
27+
arr1 = []
28+
arr2 = []
29+
arr3 = []
30+
arr4 = []
31+
}

0 commit comments

Comments
 (0)
Please sign in to comment.