- Add notif for new message
    - remove buttons "private" and "game" in chat
    - add function on button newConv in profilPage
    - fix camera who change position (2 to 1.5 in z axe) when a goal is scored
    - fix some bug in responses functions
    - add button chat in profil page and lobby page
This commit is contained in:
Kum1ta
2024-09-21 23:14:27 +02:00
parent 696447a0d1
commit d29c58ae42
17 changed files with 161 additions and 167 deletions

View File

@ -6,26 +6,33 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/19 23:08:31 by edbernar #+# #+# */
/* Updated: 2024/09/20 14:17:56 by edbernar ### ########.fr */
/* Updated: 2024/09/21 21:51:43 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
import { waitForUserInfo } from "/static/javascript/typeResponse/typeUserInfo.js";
import { userMeInfo } from "/static/javascript/typeResponse/typeLogin.js";
import { createNotification as CN } from "/static/javascript/notification/main.js";
import { waitForUserInfo } from "/static/javascript/typeResponse/typeUserInfo.js";
import { showPrivateChat } from "/static/javascript/liveChat/showPrivateChat.js";
import { LiveChat, showChatMenu } from "/static/javascript/liveChat/main.js";
import { userMeInfo } from "/static/javascript/typeResponse/typeLogin.js";
import { sendRequest } from "/static/javascript/websocket.js";
class ProfilPage
{
static create(userId)
{
const username = document.getElementsByTagName('h2')[0];
const pfp = document.getElementsByClassName('profile-image')[0];
const banner = document.getElementsByClassName('background-card')[0];
const username = document.getElementsByTagName('h2')[0];
const pfp = document.getElementsByClassName('profile-image')[0];
const banner = document.getElementsByClassName('background-card')[0];
const githubButton = document.getElementById('github');
const discordButton = document.getElementById('discord');
const convButton = document.getElementById('newConv');
let usernameText = null;
LiveChat.create();
sendRequest("get_user_info", {id: userId});
waitForUserInfo().then((userInfo) => {
usernameText = userInfo.username;
username.innerText = userInfo.username + ' (status not implemented)';
pfp.style.backgroundImage = `url("${userInfo.pfp}")`
pfp.style.backgroundSize = "cover";
@ -39,11 +46,15 @@ class ProfilPage
banner.innerHTML = `<img class='editPen' src='/static/img/profilPage/editPen.png'/>`
}
});
convButton.addEventListener('click', () => {
showChatMenu();
showPrivateChat({id: userId, name: usernameText});
});
}
static dispose()
{
LiveChat.dispose();
}
}