first commit

This commit is contained in:
sky
2025-06-22 11:41:21 -04:00
commit bc03213b0b
28 changed files with 5964 additions and 0 deletions

101
html/reset.html Executable file
View File

@ -0,0 +1,101 @@
<!DOCTYPE html>
<html class="sl-theme-dark" lang="en">
<head>
<!-- initialize theme vars
https://coolors.co/10002b-240046-3c096c-5a189a-7b2cbf-9d4edd-c77dff-e0aaff -->
<!-- initialize externals -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src=" https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.min.js "></script>
<!-- initialize my stuff -->
<script src="/js/all.min.js"></script>
<script src="/js/main.js"></script>
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
<link rel="stylesheet" href="/style.css" />
<!-- seo + other things -->
<title>Reset Password | Selenite</title>
<link rel="icon" href="/favicon.ico" />
<script>
document.addEventListener("DOMContentLoaded", () => {
document.getElementById("reset").addEventListener("submit", async (e) => {
e.preventDefault();
let username = document.getElementById("username").value;
let password = document.getElementById("password").value;
let key = document.getElementById("key").value;
let captcha = document.getElementById("hcaptcha").firstChild.dataset.hcaptchaResponse;
let data = await (await fetch("/api/account/reset", {
method: "POST",
body: JSON.stringify({
username: username,
password: password,
key: key,
'h-captcha-response': captcha,
}),
headers: {
"Content-type": "application/json; charset=UTF-8",
},
})).json();
console.log(data);
if (data.success) {
document.getElementById("title").innerText = "Reset successfully";
document.getElementById("reason").innerText = `Your password has been reset successfully, click X to continue.`;
} else {
console.log("Error: ", data.reason);
document.getElementById("title").innerText = "Failed to reset";
document.getElementById("reason").innerText = data.reason;
}
document.getElementById("popup").style.display = "flex";
document.getElementById("close").addEventListener("click", () => {
document.getElementById("popup").style.display = "none";
if(document.getElementById("title").innerText == "Registered successfully") {
location.href = "/login"
}
});
});
});
</script>
</head>
<alerts> </alerts>
<body id="noscroll">
<header>
<a href="/index.html">Home</a>
<a href="/bookmarklets.html">Bookmarklets</a>
<a href="/projects.html">Games</a>
<a href="/apps.html">Apps</a>
<a href="/settings.html">Settings</a>
<a id="blank" href="#">Open Blank</a>
<a href="/u/" class="usericon"><img src="/img/user.svg"></a>
</header>
<main id="main" class="noscroll">
<h2>Reset Password</h2>
<form action="" id="reset">
<input type="text" id="username" placeholder="username" />
<input type="password" id="key" placeholder="key" />
<input type="password" id="password" placeholder="password" />
<div class="h-captcha" id="hcaptcha" data-sitekey="1774ec96-39be-4fb0-9e82-f4c62354b8fa"></div>
<button type="submit" value="Submit">Reset Password</button>
</form>
</main>
<popups>
<div id="popup" style="display: none">
<h1 id="title"></h1>
<p id="reason"></p>
<button id="close">X</button>
</div>
</popups>
<footer class="noscroll">
<a href="https://gitlab.com/skysthelimit.dev/selenite">Source</a>
<a href="https://discord.gg/7jyufnwJNf">Discord</a>
<a href="/suggest.html">Suggestions & Bugs</a>
<a href="/contact.html">Contact</a>
<a href="/support.html">Donate</a>
<a href="/about.html">About</a>
</footer>
</body>
</html>