118 lines
3.6 KiB
HTML
118 lines
3.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>Hyperia</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="icon" href="_/icons/logo.svg">
|
|
<link rel="stylesheet" href="_/code/shared.css">
|
|
<style>
|
|
#items {
|
|
position: absolute;
|
|
top: 50vh;
|
|
left: 50vw;
|
|
transform: translate(-50%, -50%);
|
|
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center; /* centers children horizontally */
|
|
text-align: center; /* ensures text inside spans is centered */
|
|
}
|
|
|
|
input {
|
|
background-color: transparent;
|
|
border: none;
|
|
border-radius: 5px;
|
|
border-top: 2px solid var(--accent);
|
|
border-bottom: 2px solid var(--accent);
|
|
height: 2em;
|
|
width: 15vw;
|
|
padding: 0.2em;
|
|
transition: border .2s, padding .2s;
|
|
color: var(--accent)
|
|
}
|
|
input::placeholder {
|
|
color: var(--accent);
|
|
}
|
|
input:focus {
|
|
outline: none;
|
|
padding: 0.4em;
|
|
border-top: 2px solid var(--red);
|
|
border-bottom: 2px solid var(--red);
|
|
}
|
|
input:focus::placeholder {
|
|
color: var(--red)
|
|
}
|
|
input:-webkit-autofill,
|
|
input:-webkit-autofill:focus {
|
|
transition: background-color 600000s 0s, color 600000s 0s;
|
|
}
|
|
input[data-autocompleted] {
|
|
background-color: #c7a67b !important;
|
|
}
|
|
|
|
@media (max-width: 600px) {
|
|
input {
|
|
width: 50vw
|
|
}
|
|
}
|
|
</style>
|
|
<script src="_/code/quill.js"></script>
|
|
<script type="module">
|
|
import PageFooter from "./components/Footer.js"
|
|
import NavBar from "./components/NavBar.js"
|
|
import SideBar from "./components/SideBar.js"
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<span id="title" onclick='console.log("hey"); window.location.href="/"'>hyperia</span>
|
|
<div class="links" style="z-index: 1; cursor: default; position: fixed; top: 5.5vh; right: 4.5vw">
|
|
<a href="join">join</a>
|
|
<span>|</span>
|
|
<a href="signin">sign in</a>
|
|
</div>
|
|
|
|
<div id="items">
|
|
|
|
<form id="signup-form">
|
|
<input name="email" id="email" placeholder="email" required style="margin-bottom: 15px;">
|
|
<br>
|
|
<p id="applicant-message" style="color: green; font-size: 1em; margin: 0.5em 0; margin-bottom: 1em"></p>
|
|
<button type="submit" style="background-color: rgb(193, 135, 29)">Sign Up</button>
|
|
</form>
|
|
|
|
<script>
|
|
document.getElementById('signup-form').addEventListener('submit', async (e) => {
|
|
e.preventDefault(); // prevent page reload
|
|
|
|
const email = document.getElementById('email').value;
|
|
const messageEl = document.getElementById('applicant-message');
|
|
|
|
try {
|
|
const res = await fetch('/api/signup', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
body: new URLSearchParams({ email }),
|
|
});
|
|
|
|
if (res.ok) {
|
|
const data = await res.json();
|
|
messageEl.style.color = 'green';
|
|
messageEl.textContent = data.message;
|
|
} else {
|
|
const error = await res.text();
|
|
messageEl.style.color = 'red';
|
|
messageEl.textContent = 'Error: ' + error;
|
|
}
|
|
} catch (err) {
|
|
messageEl.style.color = 'red';
|
|
messageEl.textContent = 'Error submitting form.';
|
|
console.error(err);
|
|
}
|
|
});
|
|
</script>
|
|
|
|
</div>
|
|
</body>
|
|
</html> |