-
-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathindex.html
68 lines (68 loc) · 2.8 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wsine - 觅密</title>
<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css" media="screen,projection"/>
</head>
<body>
<div class="container mt-5">
<div class="row justify-content-center">
<div class="input-field col-12 col-sm-12 col-md-8 col-lg-6">
<form>
<div class="form-group">
<label for="pwd">记忆密码</label>
<input type="password" class="form-control" id="pwd" placeholder="Memory Password" value="">
</div>
<div class="form-group">
<label for="key">区分代码</label>
<input type="text" class="form-control" id="key" placeholder="Distinguish Code" value="">
</div>
<div class="form-group">
<label for="options">选项</label>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="cb_remove" name="cb_remove">
<label class="form-check-label" for="cb_remove">
移除标点 Remove punctuation
</label>
</div>
</div>
<div class="form-group">
<div class="row justify-content-center">
<button class="btn btn-primary" type="button" id="btn_gencode">生成Generate</button>
</div>
</div>
<div class="form-group">
<label for="code">加密密码</label>
<div class="input-group mb-3">
<input type="text" class="form-control" id="code" placeholder="Encrypted Password" value="">
<div class="input-group-append">
<button class="btn btn-secondary" type="button" id="btn_copy" data-clipboard-target="#code">复制Copy</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript" src="js/clipboard.min.js"></script>
<script type="text/javascript" src="js/md5.min.js"></script>
<script type="text/javascript" src="src/seek_password.js"></script>
<script type="text/javascript">
var clipboard = new ClipboardJS("#btn_copy");
document.getElementById("btn_gencode").onclick = function() {
var pwd = document.getElementById("pwd").value;
var key = document.getElementById("key").value;
var sk_pwd = generate_password(pwd, key);
if (sk_pwd) {
if (document.getElementById("cb_remove").checked == true) {
document.getElementById("code").value = sk_pwd.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()@\+\?><\[\]\+]/g, "");
} else {
document.getElementById("code").value = sk_pwd;
}
}
}
</script>
</body>
</html>