Skip to content

Commit

Permalink
Merge pull request #12 from openpmix/hcaptcha-test
Browse files Browse the repository at this point in the history
add hCaptcha demo
  • Loading branch information
naughtont3 authored Jan 8, 2025
2 parents a832555 + 988c0a7 commit 27c7ef5
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions captcha/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>hCaptcha Demo</title>
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin-top: 50px;
}
form {
display: inline-block;
text-align: left;
margin: auto;
}
.container {
max-width: 500px;
margin: auto;
}
.message {
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<h1>hCaptcha Demo</h1>
<p>Please complete the CAPTCHA to proceed.</p>
<form id="captcha-form">
<div class="h-captcha" data-sitekey="e924a3fe-9d8e-482e-b2d8-2a5c308a8746"></div>
<br>
<button type="submit">Submit</button>
</form>
<div class="message" id="message"></div>
</div>

<script>
const form = document.getElementById('captcha-form');
const messageDiv = document.getElementById('message');

form.addEventListener('submit', (e) => {
e.preventDefault();
messageDiv.textContent = "Form submitted successfully! (This is just a demo.)";
});
</script>
</body>
</html>

0 comments on commit 27c7ef5

Please sign in to comment.