-
Notifications
You must be signed in to change notification settings - Fork 3
/
demo_check_password.html
64 lines (47 loc) · 1.4 KB
/
demo_check_password.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
<!DOCTYPE HTML>
<html>
<head>
<title>VizHash.js Password Check Demo</title>
<script type="text/javascript" src="vizhash.min.js"></script>
<style type="text/css">
canvas {
-moz-box-shadow: 3px 3px 3px rgba(68,68,68,0.6);
-webkit-box-shadow: 3px 3px 3px rgba(68,68,68,0.6);
box-shadow: 3px 3px 3px rgba(68,68,68,0.6);
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
margin:1em;
vertical-align:middle;
}
</style>
</head>
<body>
<script type="text/javascript">
function addHash(){
if (vizhash.supportCanvas()) {
try {
var pwd = document.hashForm.userInput.value;
var vhash = vizhash.canvasHash(pwd, 64, 64);
var pwdhash = document.getElementById('pwdhash');
var hashInput = document.getElementById('hashInput');
if (pwdhash) { hashInput.removeChild(pwdhash)}
vhash.canvas.id = 'pwdhash';
hashInput.appendChild(vhash.canvas);
} catch (err) {
alert(err);
}
}
}
</script>
<h1>VizHash.js Password Check Demo</h1>
<p><a href="https://github.com/sametmax/VizHash.js">Project page</a></p>
<form action="." method="get" name="hashForm"
accept-charset="utf-8" >
<p id="hashInput">
<label for="userInput" onKeyDown="return addHash()">
Password: <input type="password" name="userInput" >
</label>
</p>
</form>
</body>
</html>