From 5e5475eaa8583aabfafa54d294c2078612cb29e3 Mon Sep 17 00:00:00 2001 From: Kum1ta Date: Wed, 13 Nov 2024 16:23:50 +0100 Subject: [PATCH] Game - remove pub on not chrome web viewer - force opacity 1 when ball pos reset - remove color hue when goal - fix bug when i have no color skin Site - fix style bug on chat tournament - fix style bug on goal selector --- .../nginx/static/javascript/lobbyPage/3d.js | 5 ++-- .../nginx/static/javascript/login/3d.js | 23 +++++++++++++++++++ .../nginx/static/javascript/login/main.js | 4 +++- .../nginx/static/javascript/main.js | 5 ++-- .../static/javascript/multiLocalGame/Map.js | 4 ++-- .../static/javascript/multiOnlineGame/Ball.js | 3 ++- .../javascript/multiOnlineGame/Player.js | 23 +++++-------------- .../multiOnlineGame/multiOnlineGamePage.js | 10 ++++---- .../static/style/lobbyPage/lobbyPage.css | 6 ++++- .../style/tournamentPage/tournamentPage.css | 4 ++++ 10 files changed, 55 insertions(+), 32 deletions(-) create mode 100644 docker-compose/requirements/nginx/static/javascript/login/3d.js diff --git a/docker-compose/requirements/nginx/static/javascript/lobbyPage/3d.js b/docker-compose/requirements/nginx/static/javascript/lobbyPage/3d.js index 2cbba89..043c74d 100644 --- a/docker-compose/requirements/nginx/static/javascript/lobbyPage/3d.js +++ b/docker-compose/requirements/nginx/static/javascript/lobbyPage/3d.js @@ -6,7 +6,7 @@ /* By: edbernar { loadFiles().then(() => { @@ -24,4 +25,4 @@ document.addEventListener('DOMContentLoaded', () => { }); }); -export { pageRenderer, isMobile }; \ No newline at end of file +export { pageRenderer, isMobile, isOnChrome }; \ No newline at end of file diff --git a/docker-compose/requirements/nginx/static/javascript/multiLocalGame/Map.js b/docker-compose/requirements/nginx/static/javascript/multiLocalGame/Map.js index c5665f1..b2b142b 100644 --- a/docker-compose/requirements/nginx/static/javascript/multiLocalGame/Map.js +++ b/docker-compose/requirements/nginx/static/javascript/multiLocalGame/Map.js @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* Map.js :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: hubourge +#+ +:+ +#+ */ +/* By: edbernar { this.mapVar.putVideoOnCanvas(0, null); - if (!isMobile) + if (!isMobile && isOnChrome) this.mapVar.putVideoOnCanvas(2, 3); }, 4000); @@ -176,8 +176,6 @@ class Player const tmpCamera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.1, 10000); const tmp = this.camera; let interval = null; - const startColor = this.object.material.color.clone(); - let hue = 0; document.getElementsByTagName('canvas')[canvasIndex].style.animation = null; document.getElementsByTagName('canvas')[canvasIndex].style.animation = 'fadeInGames 0.199s'; @@ -196,10 +194,6 @@ class Player this.camera = tmpCamera; interval = setInterval(() => { tmpCamera.lookAt(this.object.position); - hue += 0.01; - if (hue > 1) - hue = 0; - this.object.material.color.setHSL(hue, 1, 0.5); tmpCamera.fov -= 0.05; tmpCamera.updateProjectionMatrix(); }, 10); @@ -223,7 +217,6 @@ class Player ball.setCastShadow(true); this.camera = tmp; - this.object.material.color.copy(startColor); isOnPointAnim = false; if (!this.cameraFixed) { @@ -248,7 +241,6 @@ class Player const tmpCamera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.1, 10000); const tmp = this.camera; let interval = null; - const startColor = oppponentObject.material.color.clone(); let hue = 0; document.getElementsByTagName('canvas')[canvasIndex].style.animation = null; @@ -267,10 +259,6 @@ class Player this.camera = tmpCamera; interval = setInterval(() => { tmpCamera.lookAt(oppponentObject.position); - hue += 0.01; - if (hue > 1) - hue = 0; - oppponentObject.material.color.setHSL(hue, 1, 0.5); tmpCamera.fov -= 0.05; tmpCamera.updateProjectionMatrix(); }, 10); @@ -279,7 +267,9 @@ class Player }, 1000); setTimeout(() => { - clearInterval(interval); + if (interval) + clearInterval(interval); + interval = null; document.getElementsByTagName('canvas')[canvasIndex].style.animation = null; document.getElementsByTagName('canvas')[canvasIndex].style.animation = 'fadeInGames 0.99s'; document.getElementsByTagName('canvas')[canvasIndex].style.filter = 'brightness(0)'; @@ -289,7 +279,6 @@ class Player ball.setCastShadow(true); this.camera = tmp; - oppponentObject.material.color.copy(startColor); isOnPointAnim = false; if (!this.cameraFixed) { diff --git a/docker-compose/requirements/nginx/static/javascript/multiOnlineGame/multiOnlineGamePage.js b/docker-compose/requirements/nginx/static/javascript/multiOnlineGame/multiOnlineGamePage.js index ef03f79..875333f 100644 --- a/docker-compose/requirements/nginx/static/javascript/multiOnlineGame/multiOnlineGamePage.js +++ b/docker-compose/requirements/nginx/static/javascript/multiOnlineGame/multiOnlineGamePage.js @@ -6,7 +6,7 @@ /* By: edbernar { if (child.geometry) child.geometry.dispose(); - if (child.material) + if (child.material && child.material.dispose) child.material.dispose(); if (child.texture) child.texture.dispose(); diff --git a/docker-compose/requirements/nginx/static/style/lobbyPage/lobbyPage.css b/docker-compose/requirements/nginx/static/style/lobbyPage/lobbyPage.css index 1a4d8b6..482a93a 100644 --- a/docker-compose/requirements/nginx/static/style/lobbyPage/lobbyPage.css +++ b/docker-compose/requirements/nginx/static/style/lobbyPage/lobbyPage.css @@ -62,7 +62,7 @@ body { align-items: center; } -.main{ +.main { padding-block: 45px; display: flex; flex-direction: row; @@ -607,6 +607,10 @@ input:checked + .slider:before { border-radius: 50%; } +#canvas-left-side{ + background-color: #21f356; +} + @media (max-aspect-ratio: 1/1){ .main { flex-direction: column; diff --git a/docker-compose/requirements/nginx/static/style/tournamentPage/tournamentPage.css b/docker-compose/requirements/nginx/static/style/tournamentPage/tournamentPage.css index a8d2ed5..e41440d 100644 --- a/docker-compose/requirements/nginx/static/style/tournamentPage/tournamentPage.css +++ b/docker-compose/requirements/nginx/static/style/tournamentPage/tournamentPage.css @@ -223,6 +223,10 @@ overflow-x: none; } +#tournamentPage .chat-tournament .chat p { + word-break: break-all; +} + #tournamentPage #chat-title { color: white; font-size: 20px;