-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
83 lines (73 loc) · 2.02 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>PassMeter</title>
<style type="text/css">
#register {margin-left:100px;}
#register label{margin-right:5px;}
#register input {
padding:5px 7px;
border:1px solid #d5d9da;
box-shadow: 0 0 5px #e8e9eb inset;
width:250px;
font-size:1em;
outline:0;
}
#result{margin-left:5px;}
</style>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/highlight.min.js"></script>
</head>
<body>
<form id="register">
<label for="password">Password:</label>
<input name="password" id="password" type="password" />
<div id="password-result"></div>
<button id="submitButton" disabled>Submit</button>
</form>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./jquery.passMeter.js"></script>
<div id="code-live-javascript">
<script type="text/javascript">
/* set up the password meter */
$(document).ready(function(){
$.passMeter({
// configure the divs
id_password : '#password',
id_result : '#password-result',
id_submitButton : '#submitButton',
// customize the message levels
msg_bad : 'Nooooo',
msg_low : 'More',
msg_good : 'Okay',
msg_strong : 'Yeah!',
callback: function(message){
console.log(message == this.msg_bad);
}
});
});
</script>
</div>
<div id="code-live-css">
<style type="text/css">
/* style the password meter */
.passMeter-bad{color:#FF0000;}
.passMeter-low{color:#E66C2C;}
.passMeter-good{color:#2D98F3;}
.passMeter-strong{color:#006400;}
</style>
</div>
<pre>
<code id="code-pre-javascript" class="javascript"></code>
<code id="code-pre-css" class="css"></code>
</pre>
<script type="text/javascript">
$(document).ready(function(){
$('#code-pre-javascript').text($('#code-live-javascript').text());
$('#code-pre-css').text($('#code-live-css').text());
hljs.initHighlightingOnLoad();
})
</script>
</body>
</html>