This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
61 lines (58 loc) · 1.61 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
<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NyaCap</title>
<style>
html {
width: 100%;
height: 100%;
background-color: #16202f;
}
body {
width: 100%;
height: 100%;
margin: 0;
position: relative;
font-family: "Arial", "Microsoft YaHei", "黑体", "宋体", sans-serif;
display: flex;
justify-content: center;
align-items: center;
}
#root {
width: 300px;
}
</style>
</head>
<body>
<div id="root"></div>
<!-- Module 调用法 -->
<!-- <script type="module">-->
<!-- import { NewCaptcha } from "/lib/main.tsx";-->
<!-- NewCaptcha({-->
<!-- el: document.getElementById("root"),-->
<!-- instance: "http://localhost:8080",-->
<!-- siteKey: "test",-->
<!-- });-->
<!-- </script>-->
<!-- Classic 调用法 -->
<script type="module" async="async" src="/lib/main.tsx"></script>
<script>
// 加载验证码
let loadInterval;
loadInterval = setInterval(() => {
if (window.nyacap) {
window.nyacap.render(document.getElementById("root"), {
sitekey: "http://localhost:8080/widget?sitekey=test",
callback: (key) => {
alert(`验证成功: ${key}`);
},
});
clearInterval(loadInterval);
}
}, 100);
</script>
</body>
</html>