Site
- trunc username if > 8 in loginButton - reduct vague effect on home page - replace ground by infinite wall home page - change pong video
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/29 22:36:43 by edbernar #+# #+# */
|
||||
/* Updated: 2024/10/01 21:58:57 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/10/06 16:42:07 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -16,6 +16,7 @@ const url_files = {
|
||||
gameboyModel: '/static/models3D/homePage/gameboy.glb',
|
||||
tvModel: '/static/models3D/homePage/tv.glb',
|
||||
bannerModel: '/static/models3D/multiOnlineGame/banner.glb',
|
||||
infinitPlane: '/static/models3D/homePage/infinitPlane.glb',
|
||||
|
||||
pongVideo: '/static/video/homePage/pong.mp4',
|
||||
notLoginVideo: '/static/video/homePage/notLogin.webm',
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/22 23:13:53 by edbernar #+# #+# */
|
||||
/* Updated: 2024/10/03 02:33:35 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/10/06 16:47:57 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -24,7 +24,6 @@ class Screen
|
||||
screenMaterial = null;
|
||||
canvasVideo = null;
|
||||
interval = null;
|
||||
intervalLight = null;
|
||||
|
||||
constructor(scene)
|
||||
{
|
||||
@ -37,9 +36,7 @@ class Screen
|
||||
tv.geometry.center();
|
||||
this.tv = tv;
|
||||
tv.position.set(0, 0.99, 2);
|
||||
tv.material = new THREE.MeshPhysicalMaterial({color: 0x454545});
|
||||
tv.material.roughness = 1;
|
||||
tv.material.metalness = 1.05;
|
||||
tv.material = new THREE.MeshPhysicalMaterial({color: 0x050505});
|
||||
tv.scale.set(0.05, 0.05, 0.05);
|
||||
tv.castShadow = true;
|
||||
tv.receiveShadow = true;
|
||||
@ -159,8 +156,6 @@ class Screen
|
||||
dispose()
|
||||
{
|
||||
this.#disposeVideo();
|
||||
if (this.intervalLight)
|
||||
clearInterval(this.intervalLight);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/22 17:19:17 by edbernar #+# #+# */
|
||||
/* Updated: 2024/10/03 02:39:58 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/10/06 16:58:43 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -101,7 +101,7 @@ function home3D()
|
||||
const loader = new GLTFLoader();
|
||||
let actualVideo = -1;
|
||||
let globalSpeed = 0.75;
|
||||
const ambiantLight = new THREE.AmbientLight(0xffffff, 35);
|
||||
const ambiantLight = new THREE.AmbientLight(0xffffff, 1);
|
||||
const video = {
|
||||
pong: files.pongVideo,
|
||||
login: files.notLoginVideo
|
||||
@ -117,7 +117,7 @@ function home3D()
|
||||
isInFade = false;
|
||||
spotLight = new THREE.SpotLight(0xffffff, 1000);
|
||||
|
||||
spotLight.angle = Math.PI / 6; // angle d'ouverture
|
||||
spotLight.angle = Math.PI / 6;
|
||||
spotLight.penumbra = 0.5;
|
||||
spotLight.decay = 2;
|
||||
spotLight.distance = 50;
|
||||
@ -128,10 +128,10 @@ function home3D()
|
||||
|
||||
if (Math.random() % 100 > 0.99)
|
||||
video.pong = files.easterEggVideo;
|
||||
// newBgWall();
|
||||
putObject(files.lampModel, -2.5, 0, 2.5, 3, 0, Math.PI + Math.PI / 8, 0);
|
||||
putObject(files.plantModel, 1.5, 0, 3, 0.5, 0, 0, 0);
|
||||
putObject(files.gameboyModel, -0.5, -0.075, 0.5, 0.1, 0, 0.4, 0);
|
||||
putObject(files.infinitPlane, -1, 0, 0, 10, 0, Math.PI / 2 + 0.5, 0, 0x252525);
|
||||
renderer.toneMapping = THREE.LinearToneMapping;
|
||||
renderer.shadowMap.enabled = true;
|
||||
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
||||
@ -141,7 +141,7 @@ function home3D()
|
||||
scene.background = new THREE.Color(0x020202)
|
||||
scene.add(ambiantLight);
|
||||
|
||||
createPlane();
|
||||
// createPlane();
|
||||
createCube();
|
||||
document.body.getElementsByClassName('homeSection')[0].appendChild(renderer.domElement);
|
||||
|
||||
@ -172,7 +172,7 @@ function home3D()
|
||||
if (camera.position.x < 3.3 && interval)
|
||||
fadeInOut();
|
||||
if (dofPass.materialBokeh.uniforms.aperture.value > 0 && interval)
|
||||
dofPass.materialBokeh.uniforms.aperture.value -= 0.0001;
|
||||
dofPass.materialBokeh.uniforms.aperture.value -= 0.0003;
|
||||
if (camera.position.x < 3 && interval)
|
||||
{
|
||||
clearInterval(interval);
|
||||
@ -271,10 +271,11 @@ function home3D()
|
||||
composer.render();
|
||||
}
|
||||
|
||||
function putObject(objUrl, x, y, z, scale, rX, rY, rZ) {
|
||||
function putObject(objUrl, x, y, z, scale, rX, rY, rZ, color = 0x080808)
|
||||
{
|
||||
loader.load(objUrl, (gltf) => {
|
||||
const group = new THREE.Group();
|
||||
const material = new THREE.MeshPhysicalMaterial({color: 0x080808});
|
||||
const material = new THREE.MeshPhysicalMaterial({color: color});
|
||||
|
||||
gltf.scene.children.forEach(elem => {
|
||||
elem.traverse((child) => {
|
||||
@ -294,21 +295,6 @@ function home3D()
|
||||
});
|
||||
}
|
||||
|
||||
function newBgWall()
|
||||
{
|
||||
const geometry = new THREE.BoxGeometry(100, 100, 0.1);
|
||||
const material = new THREE.MeshStandardMaterial({color: 0x020202});
|
||||
const mesh = new THREE.Mesh(geometry, material);
|
||||
const geometry2 = new THREE.BoxGeometry(10, 10, 0.1);
|
||||
const material2 = new THREE.MeshStandardMaterial({color: 0x020202});
|
||||
const mesh2 = new THREE.Mesh(geometry2, material2);
|
||||
mesh.position.set(0, 0, 5);
|
||||
scene.add(mesh);
|
||||
mesh2.position.set(-5, 0, 0);
|
||||
mesh2.rotateY(Math.PI / 2);
|
||||
scene.add(mesh2);
|
||||
}
|
||||
|
||||
function createCube()
|
||||
{
|
||||
const geometry = new THREE.BoxGeometry(5, 5, 0.1);
|
||||
@ -319,18 +305,6 @@ function home3D()
|
||||
scene.add(mesh);
|
||||
}
|
||||
|
||||
function createPlane()
|
||||
{
|
||||
const geometry = new THREE.PlaneGeometry(500, 500);
|
||||
const material = new THREE.MeshPhysicalMaterial({side: THREE.DoubleSide, color: 0x020202});
|
||||
const mesh = new THREE.Mesh(geometry, material);
|
||||
|
||||
mesh.position.set(0, 0, 0);
|
||||
mesh.rotateX(-(Math.PI / 2));
|
||||
mesh.receiveShadow = true;
|
||||
scene.add(mesh);
|
||||
}
|
||||
|
||||
function fadeInOut() {
|
||||
if (isInFade)
|
||||
return;
|
||||
|
@ -3,10 +3,10 @@
|
||||
/* ::: :::::::: */
|
||||
/* main.js :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: madegryc <madegryc@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/22 17:08:46 by madegryc #+# #+# */
|
||||
/* Updated: 2024/10/05 22:12:30 by madegryc ### ########.fr */
|
||||
/* Updated: 2024/10/06 17:00:12 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -48,6 +48,8 @@ class LobbyPage
|
||||
waitForLogin().then(() => usernameP.innerHTML = userMeInfo.username);
|
||||
else
|
||||
usernameP.innerHTML = userMeInfo.username;
|
||||
if (usernameP.length > 8)
|
||||
usernameP.innerHTML = usernameP.innerHTML.substring(0, 8) + '...';
|
||||
LiveChat.create();
|
||||
inputUser.addEventListener('input', searchUser);
|
||||
loginButton.addEventListener('click', showMenu);
|
||||
|
@ -3,10 +3,10 @@
|
||||
/* ::: :::::::: */
|
||||
/* main.js :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: madegryc <madegryc@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/07 17:40:15 by edbernar #+# #+# */
|
||||
/* Updated: 2024/10/05 22:32:01 by madegryc ### ########.fr */
|
||||
/* Updated: 2024/10/06 17:01:31 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -35,7 +35,7 @@ class Login
|
||||
button42.addEventListener('click', redirection);
|
||||
if (userMeInfo.id !== -1)
|
||||
{
|
||||
usernameNode = document.createTextNode(userMeInfo.username);
|
||||
usernameNode = document.createTextNode(userMeInfo.username.lenght > 8 ? userMeInfo.username.substring(0, 8) + '...' : userMeInfo.username);
|
||||
loginButton.replaceChild(usernameNode, pLoginButton);
|
||||
loginButton.addEventListener('click', showMenu);
|
||||
window.addEventListener('resize', movePopMenuLoginButton);
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/19 23:08:31 by edbernar #+# #+# */
|
||||
/* Updated: 2024/10/02 13:34:58 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/10/06 16:32:51 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -184,10 +184,9 @@ function createGraph(ctx, data)
|
||||
data: {
|
||||
labels: [' Win ', ' Lose '],
|
||||
datasets: [{
|
||||
label: 'Couleurs',
|
||||
data: [data.win, data.lose],
|
||||
backgroundColor: ['#11ad11', '#E74040'],
|
||||
hoverOffset: 4
|
||||
hoverOffset: 1,
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/25 17:00:35 by edbernar #+# #+# */
|
||||
/* Updated: 2024/09/30 22:47:54 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/10/06 17:02:12 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -51,7 +51,7 @@ class settingsPage
|
||||
interval = setInterval(() => {
|
||||
if (userMeInfo.username != "")
|
||||
{
|
||||
loginButton.innerText = userMeInfo.username;
|
||||
loginButton.innerText = userMeInfo.username.length > 8 ? userMeInfo.username.substring(0, 8) + '...' : userMeInfo.username;
|
||||
clearInterval(interval);
|
||||
}
|
||||
}, 200);
|
||||
|
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user