Skip to content

Commit 14cf837

Browse files
committed
files commited
0 parents  commit 14cf837

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed

index.html

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<!-- Required meta tags -->
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
8+
<!-- Bootstrap CSS -->
9+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
10+
<link rel="stylesheet" href="style.css">
11+
<title>PasswordGenerator</title>
12+
<script src="passGenerate.js"></script>
13+
</head>
14+
<body>
15+
<div class="container">
16+
<form action="" name="passGen">
17+
<div class="col-xs-12">
18+
<input type="text" name="output" class="out" disabled>
19+
<input type="button" class="btn btn-success btn-block myBtn" onclick="generatepassword(this.form.length.value)" value="Generate password">
20+
<div class="col-xs-10"> <strong class="pass">Password Length:</strong></div>
21+
<div class="col-xs-2"> <input type="number" name="length" size="3" value="6" class="in"></div>
22+
</div>
23+
</form>
24+
</div>
25+
26+
27+
28+
<!-- Optional JavaScript -->
29+
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
30+
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
31+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
32+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js" integrity="sha384-o+RDsa0aLu++PJvFqy8fFScvbHFLtbvScb8AjopnFD+iEQ7wo/CG0xlczd+2O/em" crossorigin="anonymous"></script>
33+
</body>
34+
</html>

passGenerate.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
function passwordcreator(plength)
3+
{
4+
keylist="abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*ABCDEFGHIJKLMNOPQRSTUVWXYZ";
5+
tmp='';
6+
for(i=0;i<plength;i++){
7+
8+
9+
tmp += keylist.charAt(Math.floor(Math.random()*keylist.length));
10+
11+
}
12+
return tmp;
13+
}
14+
function generatepassword(enterlength){
15+
document.passGen.output.value=passwordcreator(enterlength);
16+
}

style.css

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
body{
2+
background: -webkit-gradient(radial, center center, 0, center center, 400, from(#1a82f7), to(#2F2727));
3+
/* Safari 5.1+, Chrome 10+ */
4+
background: -webkit-radial-gradient(circle, #1a82f7, #2F2727);
5+
/* Firefox 3.6+ */
6+
background: -moz-radial-gradient(circle, #1a82f7, #2F2727);
7+
/* IE 10 */
8+
background: -ms-radial-gradient(circle, #1a82f7, #2F2727);
9+
height:600px;
10+
}
11+
.container{
12+
width:600px;
13+
margin:0 auto;
14+
margin-top: 100px;
15+
font-size:3em;
16+
}
17+
.out{
18+
margin-bottom: 10px;
19+
width:100%;
20+
text-align: center;
21+
color:#f63;
22+
23+
}
24+
.myBtn{
25+
padding:20px 20px;
26+
font-size: 40px;
27+
margin-bottom: 20px;
28+
}
29+
.pass{
30+
width:400px;
31+
float:left;
32+
font-size: 30px;
33+
color:#fff;
34+
margin-left: 0;
35+
padding: 20px;
36+
background-color: #f63;
37+
38+
}
39+
.in{
40+
margin:0;
41+
padding:4.5px;
42+
float:left;
43+
text-align: center;
44+
background-color: #fff;
45+
color:#f63;
46+
width: 170px;
47+
48+
}

0 commit comments

Comments
 (0)