Check all css/js files

This commit is contained in:
hubourge
2024-11-19 15:44:06 +01:00
parent 5a1e40c11d
commit b16a4c26c8
14 changed files with 28 additions and 138 deletions

View File

@ -6,7 +6,7 @@
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/28 12:23:48 by edbernar #+# #+# */
/* Updated: 2024/11/18 19:24:56 by hubourge ### ########.fr */
/* Updated: 2024/11/19 15:06:07 by hubourge ### ########.fr */
/* */
/* ************************************************************************** */
@ -59,7 +59,6 @@ class Map
initialSpeed = 0.1;
speed = 0.4;
// vec2.z = 0 * initialSpeed;
if (Math.random() > 0.5)
{
vec2.z = (Math.random() * 0.8 - 0.4) * initialSpeed;

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* Players.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/28 15:12:25 by edbernar #+# #+# */
/* Updated: 2024/11/18 17:02:43 by edbernar ### ########.fr */
/* Updated: 2024/11/19 15:07:11 by hubourge ### ########.fr */
/* */
/* ************************************************************************** */
@ -17,7 +17,6 @@ const speed = 0.25;
let player1 = null;
let player2 = null;
let pressedButton = [];
let key = null;
class Players

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* multiLocalGamePage.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/28 12:07:39 by edbernar #+# #+# */
/* Updated: 2024/11/18 17:02:43 by edbernar ### ########.fr */
/* Updated: 2024/11/19 15:06:49 by hubourge ### ########.fr */
/* */
/* ************************************************************************** */
@ -20,16 +20,6 @@ let scene = null;
let renderer = null;
let camera = null;
/*
Controls :
- w : monter player1
- s : descendre player1
- haut : monter player2
- bas : descendre player2
- a : restart quand score debug
*/
class multiLocalGamePage
{
static create()
@ -80,33 +70,19 @@ class multiLocalGamePage
scene = null;
}
};
// /////////////
// const fps = 10; // change to 30 for 30 fps
// const frameDuration = 1000 / fps;
// let lastTime = 0;
// /////////////
function loop(timestamp) // retirer timestamp
function loop()
{
if (gameEndStatus)
{
renderer.setAnimationLoop(null);
gameFinish()
}
// const deltaTime = timestamp - lastTime; //
// if (deltaTime >= frameDuration)//
// {
// lastTime = timestamp;//
//
Ball.update();
Map.update();
Players.update();
if (renderer) {
renderer.render(scene, camera);
}
// }
Ball.update();
Map.update();
Players.update();
if (renderer)
renderer.render(scene, camera);
}
function gameFinish()

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* Ball.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/20 17:02:47 by edbernar #+# #+# */
/* Updated: 2024/11/18 17:02:43 by edbernar ### ########.fr */
/* Updated: 2024/11/19 15:09:24 by hubourge ### ########.fr */
/* */
/* ************************************************************************** */
@ -147,22 +147,15 @@ class Ball
getBetterPositions()
{
let walls = []
// let jumpers = []
for(let x = 0; x < map.arrObject.length; x++)
{
// if(map.arrObject[x].type == "jumperBottom" || map.arrObject[x].type == "jumperTop")
// {
// let jumper = map.arrObject[x]
// jumpers.push({pos:[jumper.mesh.children[0].position.x,jumper.mesh.children[0].position.z],
// isUp : jumper.type == "jumperTop"})
// }
if(map.arrObject[x].type == "wallObstacle")
{
let wall = map.arrObject[x]
walls.push({pos:[wall.mesh.position.x, wall.mesh.position.z],isUp:wall.isUp})
}
}
return({walls:walls/*,jumpers:jumpers*/})
return({walls:walls})
}
hitPlayer(ballSlope, ballOffset, ballVel)
@ -252,7 +245,6 @@ class Ball
calcNewPos(delta,obstacles, ballPos, ballVel, ballUp)
{
//kill me
let iter = 0
if((ballVel[0] == 0 && ballVel[1] == 0) || delta <= 0)
return(ballPos)
@ -277,7 +269,6 @@ class Ball
update()
{
// TODO: m[ae]th
this.object.material.color.set(0xff5555)
let gameTime = performance.now() - this.start
let lastPosDelta = gameTime - this.srvPos.time
@ -331,7 +322,6 @@ class Ball
trailGeometry.attributes.size.needsUpdate = true;
trailGeometry.attributes.customColor.needsUpdate = true;
}
dispose()
{
@ -399,5 +389,4 @@ function makeParticules(scene) {
scene.add(trail);
}
export { Ball };

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* Map.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/20 14:52:55 by hubourge #+# #+# */
/* Updated: 2024/11/18 17:02:45 by edbernar ### ########.fr */
/* Updated: 2024/11/19 15:10:55 by hubourge ### ########.fr */
/* */
/* ************************************************************************** */
@ -48,7 +48,7 @@ const colorList = [
0xFCF7DE, 0xDBFFD6, 0xD4E2D4, 0xFFD6E0, 0xFFEDDF, // Soft beige, mint, light rose
0xF5F0E1, 0xB1E1FF, 0xFAD4C0, 0xFFC9DE, 0xBFD7EA, // Soft tan, peach, blue, light pink
0xFFFAE3, 0xE7D3D3, 0xFDE3A7, 0xCDE0C9, 0xF4D9E3 // Soft light peach, pale pink, green, lavender
]; // Merci chatGPT
];
let spacingImages = [
100 * 2.33 * 10 - (100 * 2.33), // 2 images
@ -131,27 +131,6 @@ class Map
scene.add(this.#createPlanes(7.5, length, (Math.PI / 2), "planeTop", false, files.planeTexture));
scene.add(this.#createWall(-3.5, 0.4, -length/2, "wallLeft"));
scene.add(this.#createWall(3.5, 0.4, -length/2, "wallRight"));
{ // A retirer
/* Style de couleur why not
0xFFCCCC
0xFF9999
0xFF6666
0xFF3333
0xCC0000
0xCCFFCC
0x99FF99
0x66FF66
0x33FF33
0x009900
0xCCCCFF
0x9999FF
0x6666FF
0x3333FF
0x0000CC
*/
}
sourceImageLeft = pfpSelf;
sourceImageRight = pfpOpponent;
this.putScoreboard(0xCCCCFF);
@ -307,20 +286,12 @@ class Map
circle2.rotateX(-Math.PI / 2);
circle2.position.set(0, 0 - 0.049, 0);
// geometry6 = new THREE.CylinderGeometry(0.15, 0.15, 0.35);
// material6 = new THREE.MeshPhysicalMaterial({color: 0x00ff00});
// collider = new THREE.Mesh(geometry6, material6);
// collider.position.set(0, 0 + 0.1, 0);
// material6.transparent = true;
// material6.opacity = 0.1;
groupJumper = new THREE.Group();
groupJumper.add(ring1);
groupJumper.add(ring2);
groupJumper.add(ring3);
groupJumper.add(circle1);
groupJumper.add(circle2);
// groupJumper.add(collider);
// Set groupJumper position groud / top
for (let i = 0; i < groupJumper.children.length && onTop; i++)
@ -356,7 +327,6 @@ class Map
geometryWallObs = new THREE.BoxGeometry(size, 0.5, 0.1);
// materialWallObs = new THREE.MeshPhysicalMaterial({ map: files.wallTexture });
textureLoaderPlane = new THREE.TextureLoader();
materialWallObs = new THREE.MeshPhysicalMaterial({ map: textureLoaderPlane.load(files.wallTexture) });
meshWallObs = new THREE.Mesh(geometryWallObs, materialWallObs);
@ -370,7 +340,7 @@ class Map
putScoreboard(color)
{
this.#putPlayerProfile(color); // METTRE NE ARGUMENT LE CHEMIN DES IMAGES
this.#putPlayerProfile(color);
let materialScoreboard = null;
let geometryScoreboard1 = null;

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* Player.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/18 00:30:31 by edbernar #+# #+# */
/* Updated: 2024/11/18 17:02:43 by edbernar ### ########.fr */
/* Updated: 2024/11/19 15:11:45 by hubourge ### ########.fr */
/* */
/* ************************************************************************** */
@ -18,37 +18,6 @@ import * as THREE from '/static/javascript/three/build/three.module.js'
import { layoutSelected } from '/static/javascript/lobbyPage/main.js'
import { isMobile, isOnChrome } from '/static/javascript/main.js'
/*
Explication du code :
- Un seul joueur peut etre instancié, sinon ça throw une erreur
- Lorsqu'une touche est pressée, celle-ci sera ajoutée à la variable "pressedButton"
Exemple : w et a sont pressées -> pressedButton = ['w', 'a']
- Les lignes avec cleanup sont l'êquivalent d'un destructeur en CPP
- Pour appliquer des actions sur les touches, il suffit de faire ça dans la fonction
update en regardant si la touche voulue est dans la variable "pressedButton"
- Par défaut, la caméra est accrochée, si on veut qu'elle ne bouge plus, il faut
modifier "cameraFixed" à true (se fait avec la touche 'm' en jeu)
- Si on utilise une touche qui ne sera utilisée que pour un appui simple, il faudra la
mettre dans 'addEventListerner('keypress') et pas dans update() pour eviter les
problèmes de touche non détecté
- La variable "limits" sert à délimiter les mouvements de la barre
*/
/*
Todo (Eddy) :
- Ajouter une camera sur l'object (OK)
- Faire une fonction pour changer le mode de la camera (fix ou accrochée) (OK)
- Ajouter une rotation quand la caméra est fixe (OK)
- Corriger bug quand changement de caméra (camera qui se remet au dessus
quand on repasse au dessus alors qu'elle devrait être en dessous vu que la
barre est en haut). Mais peut etre faire ça quand la barre aura des mouvements
définis sur la hauteur. (OK)
- Ajouter les mouvements définis sur l'axe y (OK)
- Faire une fonction qui change de camera quand il y a un but avec un fondu en noir (OK)
- Ajouter un zoom sur la camera de la fonction pointAnimation (OK)
- Ajouter une fonction pour l'animation de point marqué (OK)
*/
let playerExist = false;
let isOnPointAnim = false;
let pressedButton = [];

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* typeErrorInvalidToken42.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/10 14:29:34 by edbernar #+# #+# */
/* Updated: 2024/08/24 23:43:44 by edbernar ### ########.fr */
/* Updated: 2024/11/19 15:13:46 by hubourge ### ########.fr */
/* */
/* ************************************************************************** */
@ -15,7 +15,6 @@ import { createNotification as NC } from "/static/javascript/notification/main.j
function typeErrorInvalidToken42()
{
// |Eddy| Changer le path pour mettre le bon path quand il y aura un vrai serveur
window.history.replaceState({}, document.title, "/site/");
NC.new("Error 42", "Invalid token", NC.defaultIcon.error);
}

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* games.css :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/20 11:23:41 by edbernar #+# #+# */
/* Updated: 2024/10/08 19:48:26 by edbernar ### ########.fr */
/* Updated: 2024/11/19 15:14:06 by hubourge ### ########.fr */
/* */
/* ************************************************************************** */
@ -94,7 +94,6 @@ body {
margin: 0;
padding: 0;
white-space: nowrap;
/* font-weight: 900; */
color: rgb(255, 255, 255, 0.1);
}

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* notification.css :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42.fr> +#+ +:+ +#+ */
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/04 23:44:17 by edbernar #+# #+# */
/* Updated: 2024/08/07 18:04:17 by edbernar ### ########.fr */
/* Updated: 2024/11/19 15:14:12 by hubourge ### ########.fr */
/* */
/* ************************************************************************** */
@ -96,7 +96,6 @@
margin-top: auto;
margin-bottom: 0;
padding: 0;
/* position: fixed; */
}
.progress {

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* home.css :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: madegryc <madegryc@student.42.fr> +#+ +:+ +#+ */
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/07 12:00:55 by edbernar #+# #+# */
/* Updated: 2024/11/15 14:08:22 by madegryc ### ########.fr */
/* Updated: 2024/11/19 15:14:21 by hubourge ### ########.fr */
/* */
/* ************************************************************************** */
@ -95,7 +95,6 @@
}
#topButton p:hover:after {
/* color: blue; */
width: 100%;
}
@ -185,7 +184,6 @@
display: none;
position: absolute;
top: 20px;
/* right: 20px; */
left: 20px;
width: 70px;
height: 70px;

View File

@ -638,7 +638,6 @@ input:checked + .slider:before {
flex-direction: column;
}
#whatGame {
/* display: none; */
margin-inline: 20px;
margin-left: auto;
margin-right: auto;

View File

@ -128,7 +128,6 @@
background-color: white;
width: 48%;
height: 42vh;
/* padding: 20px; */
text-align: center;
}

View File

@ -85,7 +85,6 @@
width: 70%;
padding: 20px;
margin: 20px;
/* margin-bottom: 5px; */
border: none;
background-color: white;
font-family: "Poppins", sans-serif;

View File

@ -47,14 +47,12 @@
#tournamentPage .left{
padding: 82px;
/* width: 50%; */
height: 100%;
}
#tournamentPage .right{
padding: 82px;
padding-top: 350px;
/* width: 50%; */
height: 100%;
}
@ -66,7 +64,6 @@
#tournamentPage .mid-container {
display: flex;
/* flex-direction: column; */
align-items: center;
margin-top: 50px;
}
@ -183,7 +180,6 @@
#tournamentPage .alert-info {
display: flex;
/* flex-direction: row; */
justify-content: space-between;
width: 90%;
height: 10%;