File size: 2,917 Bytes
95b236b
 
 
 
e18c689
 
95b236b
e18c689
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95b236b
e18c689
 
 
95b236b
f18d0d7
 
 
95b236b
e18c689
 
 
 
95b236b
 
e18c689
 
 
 
 
 
95b236b
e18c689
 
 
95b236b
e18c689
 
 
 
95b236b
e18c689
 
 
 
 
 
 
 
 
 
 
f18d0d7
e18c689
263243c
f18d0d7
a8469df
f18d0d7
e18c689
 
 
 
 
 
f18d0d7
 
 
 
e18c689
95b236b
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vibow AI - hCaptcha Test</title>
  <script src="https://hcaptcha.com/1/api.js" async defer></script>
  <style>
    body {
      font-family: "Segoe UI", sans-serif;
      background: linear-gradient(135deg, #1f1c2c, #928dab);
      height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      margin: 0;
    }
    .card {
      background: white;
      border-radius: 16px;
      padding: 32px;
      width: 360px;
      box-shadow: 0 6px 20px rgba(0,0,0,0.2);
      text-align: center;
    }
    h2 {
      margin-bottom: 20px;
      color: #333;
    }
    button {
      width: 100%;
      padding: 12px;
      margin-top: 16px;
      border: none;
      border-radius: 8px;
      background: #4a47a3;
      color: white;
      font-weight: bold;
      cursor: pointer;
    }
    .loading {
      display: none;
      margin-top: 12px;
      color: #555;
    }
    .result {
      margin-top: 16px;
      font-weight: bold;
    }
  </style>
</head>
<body>
  <div class="card">
    <h2>Vibow AI Verification</h2>

    <div class="h-captcha" 
         data-sitekey="d2667a10-0862-4a5a-90d8-2fa4ce183d06" 
         data-callback="setToken"></div>

    <button onclick="submitForm()">Verify</button>
    <div id="loading" class="loading">⏳ Verifying...</div>
    <div id="result" class="result"></div>
  </div>

  <script>
    let captchaToken = "";

    function setToken(token) {
      captchaToken = token;
      console.log("Token received:", token);
    }

    async function submitForm() {
      const loading = document.getElementById("loading");
      const result = document.getElementById("result");

      if (!captchaToken) {
        result.innerHTML = "❌ Please solve the captcha first.";
        return;
      }

      loading.style.display = "block";
      result.innerHTML = "";

      try {
        const response = await fetch("/verify", {
          method: "POST",
          headers: {"Content-Type": "application/json"},
          body: JSON.stringify({ token: captchaToken })
        });
        const data = await response.json();
        loading.style.display = "none";

        if (data.success) {
          result.innerHTML = "βœ… Verification success! Opening new tab...";
          setTimeout(() => {
            window.open("https://talkgte.netlify.app/donate.html", "_blank"); // buka tab baru
          }, 1500);
        } else {
          result.innerHTML = "❌ Failed: " + JSON.stringify(data);
        }
      } catch (err) {
        loading.style.display = "none";
        result.innerHTML = "⚠️ Error: " + err.message;
      } finally {
        // Reset captcha biar token lama gak kepakai lagi
        hcaptcha.reset();
        captchaToken = "";
      }
    }
  </script>
</body>
</html>