mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2025-12-31 21:56:41 +01:00
「🔨」 fix: fixed some things.
This commit is contained in:
@ -170,5 +170,5 @@ async function startMenuPP() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(startMenuPP, 3000);
|
setInterval(startMenuPP, 5000);
|
||||||
startMenuPP();
|
startMenuPP();
|
||||||
|
|||||||
@ -93,7 +93,7 @@ export default class extends Aview {
|
|||||||
// throw new Error("invalid response");
|
// throw new Error("invalid response");
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ export default class extends Aview {
|
|||||||
}
|
}
|
||||||
catch (error)
|
catch (error)
|
||||||
{
|
{
|
||||||
console.error(error);
|
console.log(error);
|
||||||
document.getElementById("login-error-message").innerHTML = "error: server error, try again later...";
|
document.getElementById("login-error-message").innerHTML = "error: server error, try again later...";
|
||||||
document.getElementById("login-error-message").classList.remove("hidden");
|
document.getElementById("login-error-message").classList.remove("hidden");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,7 +54,7 @@ export default class extends Aview {
|
|||||||
credentials: "include",
|
credentials: "include",
|
||||||
});
|
});
|
||||||
if (userdata_req.status == 404) {
|
if (userdata_req.status == 404) {
|
||||||
console.error("invalid user");
|
console.log("invalid user");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let userdata = await userdata_req.json();
|
let userdata = await userdata_req.json();
|
||||||
@ -74,7 +74,7 @@ export default class extends Aview {
|
|||||||
|
|
||||||
let main = document.getElementById("profile-pong-scorelist");
|
let main = document.getElementById("profile-pong-scorelist");
|
||||||
if (!main)
|
if (!main)
|
||||||
return console.error("what");
|
return console.log("what");
|
||||||
|
|
||||||
if (matches.matchHistory) {
|
if (matches.matchHistory) {
|
||||||
for (let match of matches.matchHistory) {
|
for (let match of matches.matchHistory) {
|
||||||
@ -136,7 +136,7 @@ export default class extends Aview {
|
|||||||
|
|
||||||
main = document.getElementById("profile-tetris-scorelist");
|
main = document.getElementById("profile-tetris-scorelist");
|
||||||
if (!main)
|
if (!main)
|
||||||
return console.error("what");
|
return console.log("what");
|
||||||
|
|
||||||
// don't read this shit for you mental health
|
// don't read this shit for you mental health
|
||||||
if (matches.matchHistory) {
|
if (matches.matchHistory) {
|
||||||
|
|||||||
@ -54,7 +54,7 @@ export default class extends Aview {
|
|||||||
});
|
});
|
||||||
if (userdata_req.status == 404)
|
if (userdata_req.status == 404)
|
||||||
{
|
{
|
||||||
console.error("invalid user");
|
console.log("invalid user");
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
let userdata = await userdata_req.json();
|
let userdata = await userdata_req.json();
|
||||||
@ -69,7 +69,7 @@ export default class extends Aview {
|
|||||||
|
|
||||||
document.getElementById("profile-items").innerHTML = await getMainHTML();
|
document.getElementById("profile-items").innerHTML = await getMainHTML();
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
document.getElementById("menu-logout").addEventListener("click", async () => {
|
document.getElementById("menu-logout")?.addEventListener("click", async () => {
|
||||||
let req = fetch(`${auth_api}/logout`, {
|
let req = fetch(`${auth_api}/logout`, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
@ -79,7 +79,7 @@ export default class extends Aview {
|
|||||||
if (res.status === 200)
|
if (res.status === 200)
|
||||||
this.run();
|
this.run();
|
||||||
else
|
else
|
||||||
console.error("logout failed");
|
console.log("logout failed");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -91,7 +91,7 @@ export default class extends Aview {
|
|||||||
|
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.error(error);
|
console.log(error);
|
||||||
if (document.getElementById("login-error-message")) {
|
if (document.getElementById("login-error-message")) {
|
||||||
document.getElementById("login-error-message").innerHTML = "error: server error, try again later...";
|
document.getElementById("login-error-message").innerHTML = "error: server error, try again later...";
|
||||||
document.getElementById("login-error-message")?.classList.remove("hidden");
|
document.getElementById("login-error-message")?.classList.remove("hidden");
|
||||||
|
|||||||
@ -74,7 +74,7 @@ export default class extends Aview {
|
|||||||
credentials: "include",
|
credentials: "include",
|
||||||
});
|
});
|
||||||
if (userdata_req.status == 404) {
|
if (userdata_req.status == 404) {
|
||||||
console.error("invalid user");
|
console.log("invalid user");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let userdata = await userdata_req.json();
|
let userdata = await userdata_req.json();
|
||||||
@ -106,16 +106,16 @@ export default class extends Aview {
|
|||||||
if (delete_req.status == 200)
|
if (delete_req.status == 200)
|
||||||
navigationManager("/");
|
navigationManager("/");
|
||||||
else
|
else
|
||||||
console.error("xd"); // xd?????????????
|
console.log("xd"); // xd?????????????
|
||||||
});
|
});
|
||||||
|
|
||||||
const upload = document.getElementById("upload-file") as HTMLInputElement;
|
const upload = document.getElementById("upload-file") as HTMLInputElement;
|
||||||
upload.addEventListener("change", () => {
|
upload.addEventListener("change", () => {
|
||||||
const fileList: FileList | null = upload.files;
|
const fileList: FileList | null = upload.files;
|
||||||
if (!fileList)
|
if (!fileList)
|
||||||
return console.error("empty");
|
return console.log("empty");
|
||||||
if (!fileList[0].type.startsWith("image/")) {
|
if (!fileList[0].type.startsWith("image/")) {
|
||||||
console.error("invalid file");
|
console.log("invalid file");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -307,18 +307,18 @@ export default class extends Aview {
|
|||||||
) as HTMLCanvasElement | null;
|
) as HTMLCanvasElement | null;
|
||||||
this.canvas = el;
|
this.canvas = el;
|
||||||
if (!this.canvas)
|
if (!this.canvas)
|
||||||
throw console.error("no canvas :c");
|
throw console.log("no canvas :c");
|
||||||
this.canvas.width = COLS * BLOCK;
|
this.canvas.width = COLS * BLOCK;
|
||||||
this.canvas.height = ROWS * BLOCK;
|
this.canvas.height = ROWS * BLOCK;
|
||||||
const ctx = this.canvas.getContext("2d");
|
const ctx = this.canvas.getContext("2d");
|
||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
if (!this.ctx)
|
if (!this.ctx)
|
||||||
throw console.error("no ctx D:");
|
throw console.log("no ctx D:");
|
||||||
|
|
||||||
this.holdCanvas = document.getElementById("hold") as HTMLCanvasElement;
|
this.holdCanvas = document.getElementById("hold") as HTMLCanvasElement;
|
||||||
this.queueCanvas = document.getElementById("queue") as HTMLCanvasElement;
|
this.queueCanvas = document.getElementById("queue") as HTMLCanvasElement;
|
||||||
if (!this.holdCanvas || !this.queueCanvas)
|
if (!this.holdCanvas || !this.queueCanvas)
|
||||||
throw console.error("no canvas :c");
|
throw console.log("no canvas :c");
|
||||||
this.holdCtx = this.holdCanvas.getContext("2d");
|
this.holdCtx = this.holdCanvas.getContext("2d");
|
||||||
this.queueCtx = this.queueCanvas.getContext("2d");
|
this.queueCtx = this.queueCanvas.getContext("2d");
|
||||||
if (!this.holdCtx || !this.queueCtx)
|
if (!this.holdCtx || !this.queueCtx)
|
||||||
|
|||||||
@ -332,18 +332,18 @@ export default class extends Aview {
|
|||||||
) as HTMLCanvasElement | null;
|
) as HTMLCanvasElement | null;
|
||||||
this.canvas = el;
|
this.canvas = el;
|
||||||
if (!this.canvas)
|
if (!this.canvas)
|
||||||
throw console.error("no canvas :c");
|
throw console.log("no canvas :c");
|
||||||
this.canvas.width = COLS * BLOCK;
|
this.canvas.width = COLS * BLOCK;
|
||||||
this.canvas.height = ROWS * BLOCK;
|
this.canvas.height = ROWS * BLOCK;
|
||||||
const ctx = this.canvas.getContext("2d");
|
const ctx = this.canvas.getContext("2d");
|
||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
if (!this.ctx)
|
if (!this.ctx)
|
||||||
throw console.error("no ctx D:");
|
throw console.log("no ctx D:");
|
||||||
|
|
||||||
this.holdCanvas = document.getElementById(canvasId + "-hold") as HTMLCanvasElement;
|
this.holdCanvas = document.getElementById(canvasId + "-hold") as HTMLCanvasElement;
|
||||||
this.queueCanvas = document.getElementById(canvasId + "-queue") as HTMLCanvasElement;
|
this.queueCanvas = document.getElementById(canvasId + "-queue") as HTMLCanvasElement;
|
||||||
if (!this.holdCanvas || !this.queueCanvas)
|
if (!this.holdCanvas || !this.queueCanvas)
|
||||||
throw console.error("no canvas :c");
|
throw console.log("no canvas :c");
|
||||||
this.holdCtx = this.holdCanvas.getContext("2d");
|
this.holdCtx = this.holdCanvas.getContext("2d");
|
||||||
this.queueCtx = this.queueCanvas.getContext("2d");
|
this.queueCtx = this.queueCanvas.getContext("2d");
|
||||||
if (!this.holdCtx || !this.queueCtx)
|
if (!this.holdCtx || !this.queueCtx)
|
||||||
|
|||||||
@ -77,6 +77,6 @@ async function start() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start().catch((err) => {
|
start().catch((err) => {
|
||||||
console.error(err);
|
console.log(err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user