-
-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #326 from thevaidik/main
Adding ps generator (3k+ visitors)
- Loading branch information
Showing
5 changed files
with
169 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Password-generator-site | ||
|
||
This is my personal learning project to get a better | ||
idea on how Javascript works with html and css in general. | ||
|
||
Live version of this project can be checked out here ! | ||
[PS generator](https://randompasswordgenerator.bio) | ||
|
||
# Site to generator strong random password . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name ="viewport" content = "width=device-width, intial-scale="1.0"> | ||
<title>Password generator</title> | ||
<link rel = "stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>Generate <br> <span>a Password </span></h1> | ||
<div class="display"> | ||
<input type = "text" id="password" placeholder="Password"> | ||
<img src ="https://ik.imagekit.io/imgview/Password_generator/copy.png?updatedAt=1689341999482" alt="image 1" onclick="copypassword()" > | ||
</div> | ||
<button onclick="createPassword()"> | ||
<img src="https://ik.imagekit.io/imgview/Password_generator/generate.png?updatedAt=1689341999531" alt ="image">Generate password</button> | ||
</div> | ||
|
||
|
||
<script> | ||
const passwordbox = document.getElementById("password"); | ||
const length = 12; | ||
|
||
const uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | ||
const lowercase = "abcdefghijklmnopqrstuvwxyz"; | ||
const number = "123456789"; | ||
const symbol = "!@#$%^&*()"; | ||
|
||
const allchars = uppercase+lowercase+number+symbol; | ||
function createPassword(){ | ||
let password = ""; | ||
password += uppercase[Math.floor(Math.random()* uppercase.length)]; | ||
password += lowercase[Math.floor(Math.random()*lowercase.length)]; | ||
password += number[Math.floor(Math.random()*number.length)]; | ||
password += symbol[Math.floor(Math.random()*symbol.length)]; | ||
|
||
while(length>password.length){ | ||
password += allchars[Math.floor(Math.random()*allchars.length)]; | ||
|
||
} | ||
passwordbox.value = password; | ||
|
||
|
||
} | ||
|
||
|
||
function copypassword(){ | ||
passwordbox.select(); | ||
document.execCommand("copy"); | ||
|
||
} <!-- comment test --> | ||
|
||
|
||
|
||
|
||
</script> | ||
|
||
|
||
</body> | ||
</html> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "Password generator", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
*{ | ||
margin: 0; | ||
padding: 0; | ||
font-family: 'Poppins', sans-serif; | ||
box-sizing: border-box; | ||
} | ||
body{ | ||
background: #002339; | ||
color: #fff; | ||
|
||
} | ||
|
||
.container{ | ||
margin: 12%; | ||
width: 90%; | ||
max-width: 700px; | ||
} | ||
.display{ | ||
width: 100%; | ||
margin-top: 50px; | ||
margin-bottom: 30px; | ||
background: #fff; | ||
color: #333; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 26px 20px ; | ||
border-radius: 5px; | ||
} | ||
.container h1{ | ||
font-weight: 500; | ||
font-size: 45px; | ||
} | ||
|
||
.container h1 span{ | ||
color: #019f55; | ||
border-bottom: 4px solid #019f55; | ||
padding-bottom: 7px; | ||
|
||
} | ||
|
||
.display img { | ||
width: 30px; | ||
cursor: pointer; | ||
} | ||
|
||
.display input{ | ||
border: 0; | ||
outline: 0; | ||
font-size: 24px; | ||
|
||
} | ||
|
||
.container button img { | ||
width: 28px; | ||
margin-right: 10px; | ||
|
||
} | ||
|
||
.container button{ | ||
border: 0; | ||
outline: 0; | ||
background: #019f55; | ||
color : #fff; | ||
font-size: 22px; | ||
font-weight: 300; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 16px 26px; | ||
border-radius: 20px; | ||
cursor: pointer; | ||
} | ||
/* comment in css testing*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters