-
Notifications
You must be signed in to change notification settings - Fork 5
/
canvas-demo.1.0.0.html
151 lines (134 loc) · 3.16 KB
/
canvas-demo.1.0.0.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="HandheldFriendly" content="true" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>gt-front-canvas Demo Page</title>
<!-- <link rel="stylesheet" href=""> -->
</head>
<body>
<a class="button" id="button">
点我
</a>
<div class="geetest">
<div class="bg"></div>
<div class="wrap">
<div class="top">
<a class="exit" id="close" href="javascript:;"></a>
<div class="title">
请通过验证
</div>
</div>
<script type="text/javascript" src="http://api.geetest.com/get.php?gt=09d63b4c30fd364f8e6c7c602f13ea56&width=300" async></script>
</div>
</div>
<style>
body {
padding: 0;
margin: 0;
}
.button {
margin: 20px auto;
display: block;
width: 100px;
height: 60px;
line-height: 60px;
text-align: center;
background-color: #A5C545;
color: white;
}
.geetest {
display: none;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: gray;
opacity: 0.7;
}
.wrap {
width: 300px;
margin: 10px auto;
text-align: center;
background-color: #fff;
z-index: 2;
position: relative;
}
.gt_wrapper {
margin: 0 auto;
}
.wrap .top {
padding: 0 8px;
height: 44px;
z-index: 1;
position: relative;
text-align: center;
font-weight: 500;
}
.wrap .title {
line-height: 45px;
width: 200px;
margin: 0 auto;
}
.exit {
background-image: url('./img/return.png');
-moz-background-size: 12px auto;
-o-background-size: 12px auto;
-webkit-background-size: 12px auto;
background-size: 12px auto;
width: 12px;
height: 22px;
display: inline-block;
vertical-align: middle;
position: absolute;
left: 8px;
top: 11px;
-webkit-tap-highlight-color: rgba(0,0,0,0);
z-index: 10;
}
.exit:active {
background-image: url('./img/return_hover.png');
}
</style>
<script>
var qs = function(e) {
return document.querySelector(e);
};
var button = document.getElementById("button");
var geetest = qs(".geetest");
button.onclick = function() {
geetest.style.display = "block";
};
var close = document.getElementById("close");
close.onclick = function() {
geetest.style.display = "none";
};
qs(".bg").onclick = function() {
geetest.style.display = "none";
};
window.gt_custom_ajax = function(result, id, message) {
if(result) {
var values;
if (typeof id === "function") {
values = [id(".geetest_challenge"), id(".geetest_validate"), id(".geetest_seccode")];
} else {
values = document.getElementById(id).getElementsByTagName("input");
}
console.log(values[0].value, values[1].value, values[2].value);
}
}
</script>
</body>
</html>