Skip to content

Commit

Permalink
fix change_profile logging out
Browse files Browse the repository at this point in the history
  • Loading branch information
victorgrt committed Aug 24, 2024
1 parent 4ee38fd commit 5ffb33f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
1 change: 0 additions & 1 deletion srcs/app_django/pages/static/pages/js/globals.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// ------------ DOM ELEMENTS ---------

var loginForm = document.getElementsByClassName("login_form")[0];
Expand Down
3 changes: 2 additions & 1 deletion srcs/app_django/pages/static/pages/js/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function hideLoggedOutModal()
{
const test = document.getElementById("container-modal-log");
test.style.display = "none";
document.querySelector("modal-backdrop fade show").remove();
// const test2 = document.getElementById("modal-backdrop fade show")
// document.test2.remove();
}

function showPongErrorModal()
Expand Down
18 changes: 13 additions & 5 deletions srcs/app_django/pages/static/pages/js/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ function isMouseOverElement(event, element) {
}

function onMouseMove(event) {
console.log("mouse move:", event);
// Mettre à jour la position du pointeur de la souris
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
Expand All @@ -155,6 +154,12 @@ function onMouseMove(event) {
document.body.style.cursor = 'default';
return;
}
if (event.target.id === "change_prof" || event.target.id === "top")
{
console.log("HIDDDDDDING");
document.body.style.cursor = 'default';
return;
}
}
// Trouver les intersections avec les objets de la scène
var intersects = raycaster.intersectObjects(scene.children, true);
Expand Down Expand Up @@ -273,7 +278,7 @@ function checkEvent(event)
{
console.log("event:", event);
console.log("tagname: ", event.target.id);
if (event.target.id === "notifications" || event.target.id === "notiftitle" || event.target.id === "closeNotifs")
if (event.target.id === "notifications" || event.target.id === "notiftitle" || event.target.id === "closeNotifs" || event.target.id === "top" || event.target.id === "change_prof" || event.target.id === "update_profile" || event.target.id === "new_username" || event.target.id === "new_avatarg" || event.target.id === "settingsForm" || event.target.id === "messageDiv" || event.target.id === "bottom" || event.target.id === "sep" || event.target.id === "old_username")
{
console.log("positiv boss");
return (true);
Expand Down Expand Up @@ -346,14 +351,17 @@ function onClickScene(event) {
const pseudo = document.getElementById("user_stats");
if (pseudo)
{
if (isMouseOverElement(event, friendsDiv)) {
if (isMouseOverElement(event, friendsDiv) || checkEvent(event)) {
document.body.style.cursor = 'default';
return;
}
else if (checkEvent(event))
return
else
{
zoomToDoor();
// showLoggedOutModal();
showLoggedOutModal();
// zoomLogout();
// zoomToDoor();
headerLogoutFunction();
return;
}
Expand Down
6 changes: 5 additions & 1 deletion srcs/app_django/pages/static/pages/js/zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ function zoomToPCWhileLogged() {
friendsVisible = true;
}

function zoomLogout() {
showLoggedModal();
}

function zoomToDoor() {
console.log(isZoomed, " ", isZooming);
if (!isZoomed && !isZooming)
Expand All @@ -134,7 +138,7 @@ function zoomToDoor() {
targetPosition,
targetPosition,
() => {
zoomBack();
// zoomBack();
}
);
}
Expand Down
Binary file modified srcs/app_django/trantran
Binary file not shown.

0 comments on commit 5ffb33f

Please sign in to comment.