diff --git a/javascript/remeber.js b/javascript/remeber.js new file mode 100644 index 0000000..f15431c --- /dev/null +++ b/javascript/remeber.js @@ -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!..."); +} \ No newline at end of file diff --git a/javascript/simulation.js b/javascript/simulation.js index cdc721c..93e5356 100644 --- a/javascript/simulation.js +++ b/javascript/simulation.js @@ -5,35 +5,20 @@ ctx.canvas.height = window.screen.availHeight; rock = new Image(); rock.src = "/media/Art/Rock1.png"; -ctx.fill() -function remeberMe(){ - let input = document.getElementById("username"); - let username = input.value; - document.cookie = "username=" + username; - console.log(username); - cookieStore.getAll().then(data => { - console.log(data); - }) + +function setup(){ + let canvas = createCanvas(ctx.canvas.width, ctx.canvas.height); } -function forgetMe(){ - document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/" - console.log("Poof!..."); -} -cookieStore.getAll().then(data => { - if (data){ - 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"; - } - } - } +function draw(){ + x = 0; + y = 0; + drawCircle(x, y, 200); + x += 1; + y -= 0.001; - console.log(document.cookie); -}) +} var resolutionTag = document.getElementById("resolutionTag"); resolutionTag.textContent = "document: " + window.screen.availWidth + "x" + window.screen.availHeight + ", inner window: " + window.innerWidth + "x" + window.innerHeight; @@ -57,6 +42,7 @@ particle = { draw: function(){ ctx.drawImage(rock, self.x, self.y); } + }