Removed remeber me cookie script functions to file

This commit is contained in:
2025-10-20 16:00:26 -05:00
parent 926f2b6174
commit c22ddbccdb
2 changed files with 22 additions and 25 deletions

11
javascript/remeber.js Normal file
View File

@ -0,0 +1,11 @@
function remeberMe(){
let input = document.getElementById("username");
let username = input.value;
document.cookie = "username=" + username;
console.log("Thank you "+ username);
}
function forgetMe(){
document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"
console.log("Poof!...");
}

View File

@ -5,35 +5,20 @@ ctx.canvas.height = window.screen.availHeight;
rock = new Image(); rock = new Image();
rock.src = "/media/Art/Rock1.png"; rock.src = "/media/Art/Rock1.png";
ctx.fill()
function remeberMe(){
let input = document.getElementById("username"); function setup(){
let username = input.value; let canvas = createCanvas(ctx.canvas.width, ctx.canvas.height);
document.cookie = "username=" + username;
console.log(username);
cookieStore.getAll().then(data => {
console.log(data);
})
} }
function forgetMe(){ function draw(){
document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/" x = 0;
console.log("Poof!..."); y = 0;
} drawCircle(x, y, 200);
cookieStore.getAll().then(data => { x += 1;
if (data){ y -= 0.001;
for(let i = 0; i < data.length; i++){
console.log(data[i]["value"]);
if (data[i]["name"] == "username"){
let username = data[i]["value"];
document.getElementById("intotitle").textContent = "Welcome back " + username + " to the Void System";
}
}
}
console.log(document.cookie); }
})
var resolutionTag = document.getElementById("resolutionTag"); var resolutionTag = document.getElementById("resolutionTag");
resolutionTag.textContent = "document: " + window.screen.availWidth + "x" + window.screen.availHeight + ", inner window: " + window.innerWidth + "x" + window.innerHeight; resolutionTag.textContent = "document: " + window.screen.availWidth + "x" + window.screen.availHeight + ", inner window: " + window.innerWidth + "x" + window.innerHeight;
@ -57,6 +42,7 @@ particle = {
draw: function(){ draw: function(){
ctx.drawImage(rock, self.x, self.y); ctx.drawImage(rock, self.x, self.y);
} }
} }