Skip to content

Commit 0b0aa67

Browse files
committed
completed
1 parent 64161ae commit 0b0aa67

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

Projects/Randompassgen/app.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
})

Projects/Randompassgen/style.css

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
padding: 0;
44
}
55
body{
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;
@@ -34,4 +34,15 @@ body{
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
}

0 commit comments

Comments
 (0)