From f1e1643ae8b36d8eac84d10b59c6e07eca86a218 Mon Sep 17 00:00:00 2001 From: Kum1ta Date: Thu, 14 Nov 2024 15:18:24 +0100 Subject: [PATCH] Login popup - change 3d on left --- .../nginx/static/javascript/login/3d.js | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/docker-compose/requirements/nginx/static/javascript/login/3d.js b/docker-compose/requirements/nginx/static/javascript/login/3d.js index 6c43f7d..86c6ac0 100644 --- a/docker-compose/requirements/nginx/static/javascript/login/3d.js +++ b/docker-compose/requirements/nginx/static/javascript/login/3d.js @@ -6,7 +6,7 @@ /* By: edbernar { const group = new THREE.Group(); - const material = new THREE.MeshPhysicalMaterial({color: 0x2e2e2e}); + const material = new THREE.MeshPhysicalMaterial({color: 0x5e5e5e}); gltf.scene.children.forEach(elem => { elem.traverse((child) => { @@ -54,12 +54,10 @@ function main3d() }); if (nb == 0) - lampSettings(group); - else if (nb == 1) plantSettings(group); - else if (nb == 2) + else if (nb == 1) gameBoySettings(group); - else if (nb == 3) + else if (nb == 2) tvSettings(group); scene.add(group); }); @@ -117,27 +115,34 @@ function loop() scene.children[3].rotation.y += 0.005; } -function lampSettings(group) -{ - group.scale.set(3, 3, 3); -} - function plantSettings(group) { - group.scale.set(0.5, 0.5, 0.5); + group.scale.set(0.8, 0.8, 0.8); + group.position.set(0, -0.8, 0); } function gameBoySettings(group) { - group.scale.set(0.7, 0.7, 0.7); - group.rotation.set(0, 0, -1.5); + let i = 0; + + group.children[0].children.forEach(elem => { + if (i == 0) + elem.material = new THREE.MeshPhysicalMaterial({color: 0x3e3e3e}); + if (i == 4) + elem.material = new THREE.MeshPhysicalMaterial({color: 0x9e9e9e}); + elem.position.x = -20; + i++; + }); + group.scale.set(0.9, 0.9, 0.9); + group.rotation.set(0, -2, -1.5); group.position.set(0, 2, 0); } function tvSettings(group) { - group.scale.set(0.25, 0.25, 0.25); + group.scale.set(0.34, 0.34, 0.34); group.position.set(0, 1.5, 0); + group.rotation.set(0, 2.8, 0); } export { main3d, dispose3d }; \ No newline at end of file