Site
- add bar/goal selector on all gamemode in lobby page - fix three js warn on lobby page - fix history on profil page
This commit is contained in:
@ -91,10 +91,10 @@
|
||||
</div>
|
||||
|
||||
<div class="skin-select">
|
||||
<div id="bar">
|
||||
<div class="barSelection" id="bar">
|
||||
|
||||
</div>
|
||||
<div id="goal">
|
||||
<div class="goalSelection" id="goal">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -102,23 +102,38 @@
|
||||
|
||||
<div class="menuSelected" id="rankedSelected">
|
||||
<div id="whatGame">
|
||||
<p>Bonsoir non ?</p>
|
||||
<p>AAAAAAAAAA</p>
|
||||
<span class="line"></span>
|
||||
<p>BBBBBBBBBB</p>
|
||||
</div>
|
||||
|
||||
<div class="skin-select">
|
||||
<!-- Make sure you have ids and classes to make multiple "bars" and "goals" -->
|
||||
<div class="barSelection" id="bar1">
|
||||
|
||||
</div>
|
||||
<div class="goalSelection" id="goal1">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="menuSelected" id="tournamentSelected">
|
||||
<div id="whatGame">
|
||||
<p>Bonsoir non ?</p>
|
||||
<p>CCCCCCCCCC</p>
|
||||
<span class="line"></span>
|
||||
<p>DDDDDDDDDD</p>
|
||||
</div>
|
||||
|
||||
<div class="skin-select">
|
||||
<!-- Make sure you have ids and classes to make multiple "bars" and "goals" -->
|
||||
<div class="barSelection" id="bar2">
|
||||
|
||||
</div>
|
||||
<div class="goalSelection" id="goal2">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--------------------- END OF CHANGES --------------------->
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
|
@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="history" id="history">
|
||||
<h3>History</h3>
|
||||
<h3 style="margin-top: 20px;">History</h3>
|
||||
<div id="scroll-match"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/29 22:36:43 by edbernar #+# #+# */
|
||||
/* Updated: 2024/09/30 00:56:01 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/09/30 23:08:59 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -67,8 +67,6 @@ async function loadFiles()
|
||||
loadBar.style.width = value;
|
||||
await sleep(50);
|
||||
}
|
||||
console.log(Object.values(files).length * 100 / Object.values(url_files).length + '%');
|
||||
console.log('files loaded :', files);
|
||||
}
|
||||
|
||||
export { files, loadFiles };
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/22 17:19:17 by edbernar #+# #+# */
|
||||
/* Updated: 2024/09/30 14:01:36 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/09/30 23:07:19 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -430,8 +430,7 @@ function moveCamera()
|
||||
const distance = camera.position.distanceTo(screen.tv.position);
|
||||
|
||||
camera.position.copy(position);
|
||||
console.log(distance);
|
||||
if (position.equals(targetPosition) || distance < 0.15)
|
||||
if (position.equals(targetPosition) || distance < 1)
|
||||
{
|
||||
pageRenderer.changePage('lobbyPage');
|
||||
return ;
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/13 13:59:46 by edbernar #+# #+# */
|
||||
/* Updated: 2024/09/29 23:24:39 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/09/30 23:53:04 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -131,7 +131,10 @@ class barSelecter
|
||||
dispose()
|
||||
{
|
||||
if (this.renderer)
|
||||
{
|
||||
this.renderer.dispose();
|
||||
this.renderer.forceContextLoss();
|
||||
}
|
||||
this.renderer = null;
|
||||
if (this.scene)
|
||||
{
|
||||
@ -197,7 +200,10 @@ class goalSelecter
|
||||
dispose()
|
||||
{
|
||||
if (this.renderer)
|
||||
{
|
||||
this.renderer.dispose();
|
||||
this.renderer.forceContextLoss();
|
||||
}
|
||||
this.renderer = null;
|
||||
if (this.scene)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/22 17:08:46 by madegryc #+# #+# */
|
||||
/* Updated: 2024/09/29 01:34:41 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/09/30 23:46:19 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -208,6 +208,13 @@ function selectGameModeTwo()
|
||||
goalSelector.dispose();
|
||||
document.getElementById('bar').innerHTML = '';
|
||||
document.getElementById('goal').innerHTML = '';
|
||||
if (barSelector)
|
||||
barSelector.dispose();
|
||||
if (goalSelector)
|
||||
goalSelector.dispose();
|
||||
barSelector = null;
|
||||
goalSelector = null;
|
||||
window.gc();
|
||||
barSelector = new barSelecter(document.getElementById('bar'));
|
||||
goalSelector = new goalSelecter(document.getElementById('goal'));
|
||||
gameMode = 1;
|
||||
@ -222,7 +229,18 @@ function selectGameModeThree()
|
||||
{
|
||||
menuList[i].style.display = 'none';
|
||||
}
|
||||
document.getElementById('bar1').innerHTML = '';
|
||||
document.getElementById('goal1').innerHTML = '';
|
||||
document.getElementsByClassName('menuSelected')[2].style.display = 'flex';
|
||||
if (barSelector)
|
||||
barSelector.dispose();
|
||||
if (goalSelector)
|
||||
goalSelector.dispose();
|
||||
barSelector = null;
|
||||
goalSelector = null;
|
||||
window.gc();
|
||||
barSelector = new barSelecter(document.getElementById('bar1'));
|
||||
goalSelector = new goalSelecter(document.getElementById('goal1'));
|
||||
gameMode = 2;
|
||||
}
|
||||
|
||||
@ -235,7 +253,15 @@ function selectGameModeFour()
|
||||
{
|
||||
menuList[i].style.display = 'none';
|
||||
}
|
||||
document.getElementById('bar2').innerHTML = '';
|
||||
document.getElementById('goal2').innerHTML = '';
|
||||
document.getElementsByClassName('menuSelected')[3].style.display = 'flex';
|
||||
if (barSelector)
|
||||
barSelector.dispose();
|
||||
if (goalSelector)
|
||||
goalSelector.dispose();
|
||||
barSelector = new barSelecter(document.getElementById('bar2'));
|
||||
goalSelector = new goalSelecter(document.getElementById('goal2'));
|
||||
gameMode = 3;
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/19 23:08:31 by edbernar #+# #+# */
|
||||
/* Updated: 2024/09/29 02:08:41 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/10/01 00:21:50 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -206,14 +206,16 @@ function createGraph(ctx, data)
|
||||
|
||||
function showHistory(userInfo)
|
||||
{
|
||||
const divHistory = document.getElementById('history');
|
||||
const divHistory = document.getElementById('scroll-match');
|
||||
const history = userInfo.history;
|
||||
|
||||
history.forEach(element => {
|
||||
const div = document.createElement('div');
|
||||
|
||||
div.setAttribute('class', 'history-card');
|
||||
if (element.won)
|
||||
if (element.forfeit)
|
||||
div.style.backgroundColor = '#c45f0c';
|
||||
else if (element.won)
|
||||
div.style.backgroundColor = '#11ad11';
|
||||
div.innerHTML = `
|
||||
<div id="user-1">
|
||||
|
@ -239,7 +239,7 @@ body {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#bar{
|
||||
.barSelection{
|
||||
margin: 25px;
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
@ -247,11 +247,11 @@ body {
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
#bar:hover{
|
||||
.barSelection:hover{
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
#goal{
|
||||
.goalSelection{
|
||||
margin: 25px;
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
@ -259,7 +259,7 @@ body {
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
#goal:hover{
|
||||
.goalSelection:hover{
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
|
@ -112,16 +112,20 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#profil .scroll-match {
|
||||
#profil .history #scroll-match {
|
||||
overflow-y: auto;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
height: calc(100% - 60px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#profil .history {
|
||||
background-color: white;
|
||||
width: 48%;
|
||||
height: 42vh;
|
||||
padding: 20px;
|
||||
/* padding: 20px; */
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@ -131,6 +135,7 @@
|
||||
margin-top: 20px;
|
||||
background-color: #E74040;
|
||||
height: 110px;
|
||||
width: 90%;
|
||||
padding: 15px;
|
||||
padding-inline: 40px;
|
||||
transition: 0.3s ease;
|
||||
|
Reference in New Issue
Block a user