File tree 4 files changed +99
-0
lines changed
Random-password-generator
4 files changed +99
-0
lines changed Original file line number Diff line number Diff line change
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 " >
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments