From 6e1e5fa96e29fd1ca2b620a349900d0de48369a1 Mon Sep 17 00:00:00 2001 From: gocivici Date: Tue, 26 Sep 2023 19:15:58 +0300 Subject: [PATCH] added custom debug mode --- public/index.js | 6 +++++- public/style.css | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/index.js b/public/index.js index 2db92e7..f5796b7 100644 --- a/public/index.js +++ b/public/index.js @@ -16,6 +16,7 @@ let row = 0; let readyNow = false let animationFrame = 0; let pageVisible = true; +let debugMode = true; let timeoutHandle; // let atPosition = true; @@ -134,7 +135,7 @@ function animate(){ const allfPlayer = fPlayers[id] allfPlayer.draw() - allfPlayer.debug() + if(debugMode) allfPlayer.debug() allfPlayer.update() } @@ -183,6 +184,9 @@ document.querySelector('#textInput').addEventListener('submit',(event)=>{ console.log('namechange') fPlayers[socket.id].username = inputValue.replace("/name ","") socket.emit('username',fPlayers[socket.id].username) + }else if(inputValue==='/debug'){ + if(debugMode) {debugMode=false;}else{debugMode=true;} + }else{ fPlayers[socket.id].message=document.querySelector('#input').value diff --git a/public/style.css b/public/style.css index 38c6021..2f6acd6 100644 --- a/public/style.css +++ b/public/style.css @@ -2,7 +2,7 @@ :root { --header-image: url('./bgHOME4.png'); - --body-bg-image: url('./abstract2.jpg'); + --body-bg-image: url('./background2.png'); /* colors */ /* --content: #c3aae5; */ @@ -67,9 +67,9 @@ and then link it! Many fonts have separate files for each style margin: 0; /* background-color: #08031A; */ /* you can delete the line below if you'd prefer to not use an image */ - /* background-repeat: no-repeat; + background-repeat: no-repeat; background-attachment: fixed; - background-size: cover; */ + background-size: cover; color: #e9e4de; background-image: var(--body-bg-image); }