File tree Expand file tree Collapse file tree 2 files changed +51
-2
lines changed
Expand file tree Collapse file tree 2 files changed +51
-2
lines changed Original file line number Diff line number Diff line change 1+ let button = document . querySelector ( ".bttn" )
2+ let text = document . querySelector ( "#in" )
3+ let k = text . value
4+ let im = document . querySelector ( ".copy" )
5+ console . log ( im )
6+
7+
8+ let genranpass = ( ) => {
9+
10+ let collection = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+" ;
11+ let len = 12 ;
12+ password = ''
13+
14+ for ( i = 1 ; i <= len ; i ++ ) {
15+
16+ let index = Math . floor ( Math . random ( ) * collection . length )
17+ pass = collection [ index ]
18+ password += pass
19+
20+ }
21+ return password ;
22+
23+
24+ }
25+
26+ button . addEventListener ( "click" , ( event ) => {
27+ console . log ( button )
28+ let output = genranpass ( )
29+ console . log ( output )
30+ text . value = output
31+
32+
33+ } )
34+
35+ im . addEventListener ( "click" , ( event ) => {
36+ text . select ( )
37+ document . execCommand ( "copy" ) ;
38+ } )
Original file line number Diff line number Diff line change 33 padding : 0 ;
44}
55body {
6- background-color : # 5C415D ;
6+ background-color : # 0B5563 ;
77}
88.maincontainer {
99 margin : 10% ;
1010 color : # fff ;
1111}
1212.sp1 {
13- color : # FFFC31 ;
13+ color : # A1E8AF ;
1414}
1515.dis {
1616 background-color : # fff ;
3434 outline : 0 ;
3535
3636
37+ }
38+ .bttn {
39+ border : none;
40+ background-color : # A1E8AF ;
41+ border-radius : 10px ;
42+ color : # 0B5563 ;
43+ padding : 8px ;
44+ font-weight : bold;
45+
46+
47+
3748}
You can’t perform that action at this time.
0 commit comments