mirror of
https://git.srhtnin.garden/sarah/srhtnin.github.io.git
synced 2026-10-14 10:48:12 +02:00
Added player colour choosing. I HOPE.
Signed-off-by: Sarahtonin <[email protected]>
This commit is contained in:
1 parent
2c1f3851e8
commit
2fe5171450
5 files changed
+290
-13
No files matched your search
+35
-1
@@ -40,6 +40,33 @@ async function SetUsername(
|
||||
return await Response.json();
|
||||
}
|
||||
|
||||
async function SetColour(
|
||||
Colour
|
||||
) {
|
||||
const Response =
|
||||
await fetch(
|
||||
ApiUrl +
|
||||
"/SetColour.php",
|
||||
{
|
||||
method: "POST",
|
||||
|
||||
headers: {
|
||||
"Content-Type":
|
||||
"application/json"
|
||||
},
|
||||
|
||||
body: JSON.stringify({
|
||||
SaveKey:
|
||||
GetSaveKey(),
|
||||
|
||||
Colour:
|
||||
Colour
|
||||
})
|
||||
}
|
||||
);
|
||||
|
||||
return await Response.json();
|
||||
}
|
||||
|
||||
async function RenderUser() {
|
||||
const Profile =
|
||||
@@ -62,7 +89,14 @@ async function RenderUser() {
|
||||
UsernameDisplay.textContent =
|
||||
Profile.Username;
|
||||
|
||||
UsernameForm.hidden = true;
|
||||
if (
|
||||
Profile.Colour !== null
|
||||
) {
|
||||
UsernameDisplay.style.color =
|
||||
Profile.Colour;
|
||||
}
|
||||
|
||||
UsernameForm.hidden = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user