diff options
author | Parker <contact@pkrm.dev> | 2024-11-10 16:36:16 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-11-10 16:36:16 -0600 |
commit | 691aa744a0398f185b3ca98a36fbd83806c7786c (patch) | |
tree | 7840f31c30bb6eda903abd6bbf4dbfb2ac590966 /api/templates/signup.html | |
parent | 8941213c8d94f3ad84e07e467e78105dc7fed734 (diff) |
TOO MUCH STUFF
Diffstat (limited to 'api/templates/signup.html')
-rw-r--r-- | api/templates/signup.html | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/api/templates/signup.html b/api/templates/signup.html new file mode 100644 index 0000000..32962b7 --- /dev/null +++ b/api/templates/signup.html @@ -0,0 +1,112 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>LinkLogger | Signup</title> +</head> +<body> + <div> + <p id="error"></p> + <form action="/signup" method="POST"> + <input type="text" name="username" placeholder="Username" required> + <input type="password" name="password" placeholder="Password" required> + <button type="submit">Signup</button> + </form> + <hr> + <p>Already have an account? <a href="/login">Log in now</a></p> + <p>Passwords must be at least 8 characters long and contain a number, special character, and uppercase character.</p> + </div> +</body> +</html> + +<style> + body { + margin: 0; + padding: 0; + font-family: Arial, sans-serif; + background-color: #2c3338; + } + + div { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + text-align: center; + max-width: 330px; + } + + input { + display: block; + margin: 10px auto; + width: 300px; + border-radius: 5px; + padding: 15px; + color: #ccc; + background-color: #3b4148; + border: none; + font-size: 17px; + } + + button { + display: block; + margin: 10px auto; + width: 100%; + border-radius: 5px; + padding: 15px; + color: #ccc; + background-color: #415eac; + border: none; + font-size: 17px; + cursor: pointer; + } + + hr { + color: #606468; + } + + p { + color: #606468; + } + + #error { + font-size: 15px; + color: #f55757; + display: none; + } + + a { + color: #ccc; + text-decoration: none; + } + + a:hover { + text-decoration: underline; + } +</style> + +<script> + document.querySelector('form').addEventListener('submit', async function(event) { + // Prevent default form submission + event.preventDefault(); + + // Get form data + const formData = new FormData(this); + + // Send POST request + const response = await fetch('/api/users/register', { + method: 'POST', + body: formData + }); + + if (response.status != 200) { + const data = await response.json() + + document.getElementById('error').style.display = 'block'; + document.getElementById('error').innerText = data.detail; + } else { + window.location.href = '/dashboard'; + } + }); +</script>
\ No newline at end of file |