Add basic webpage template

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
Rahul Rudragoudar 2019-06-03 12:59:02 +05:30
parent 889405507e
commit c45c9f0b99
No known key found for this signature in database
GPG Key ID: EC2AAF721D545305
3 changed files with 56 additions and 0 deletions

23
client/index.html Normal file
View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Libre Captcha</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="header">
<h1>Libre Captcha</h1><hr>
<h2>Open Source solution to Captchas</h2>
<h3>v0.2 (Beta)</h3>
</div>
<div class="form">
<input type="text" id="email" placeholder="email">
<input type="button" id="reg-btn" value="Register">
<!-- <p id="token"></p> -->
</div>
<div class="secret">
<h4 id="token"></h4>
</div>
<script src="script.js"></script>
</body>
</html>

9
client/script.js Normal file
View File

@ -0,0 +1,9 @@
document.getElementById("reg-btn").addEventListener("click", function(){
var email = document.getElementById("email").value;
var url = window.location.origin+"/v1/token?email="+email
fetch(url)
.then(res => res.json())
.then((data) => {
document.getElementById("token").innerHTML = "SECRET "+data.token;
})
})

24
client/style.css Normal file
View File

@ -0,0 +1,24 @@
body {
font-family: sans-serif;
}
.header {
text-align: center;
}
.form {
width: 200px;
margin: 0 auto;
}
.form input {
width: 100%;
margin: 2px;
padding: 2px;
}
#token {
margin: 10px;
padding: 3px;
text-align: center;
}