- reset ball position when goal
Site
    - starting settings
This commit is contained in:
Kum1ta
2024-09-25 17:08:50 +02:00
parent 859158e9b9
commit d78fcd7cda
9 changed files with 200 additions and 6 deletions

View File

@ -13,6 +13,7 @@
<link rel='stylesheet' type='text/css' href='/static/style/lobbyPage/lobbyPage.css'> <link rel='stylesheet' type='text/css' href='/static/style/lobbyPage/lobbyPage.css'>
<link rel='stylesheet' type='text/css' href='/static/style/game/games.css'> <link rel='stylesheet' type='text/css' href='/static/style/game/games.css'>
<link rel='stylesheet' type='text/css' href='/static/style/profilPage/profil.css'> <link rel='stylesheet' type='text/css' href='/static/style/profilPage/profil.css'>
<link rel='stylesheet' type='text/css' href='/static/style/settings/settings.css'>
<script type="module" src='/static/javascript/main.js'></script> <script type="module" src='/static/javascript/main.js'></script>
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

View File

@ -0,0 +1,55 @@
<div id="settingsBody">
<div class="container-settings">
<div class="left-section">
<div class="form-group-settings">
<label for="username">Username</label>
<input type="text" id="username" placeholder="Username">
<div class="form-footer">
<small>Your username allows other players to find you.</small>
<button class="save-btn-settings">SAVE</button>
</div>
</div>
<div class="form-group-settings">
<label for="email">Email</label>
<input type="email" id="email" placeholder="Email">
<div class="form-footer">
<small>You have changed your email, you can modify it here.</small>
<button class="save-btn-settings">SAVE</button>
</div>
</div>
<div class="form-group-settings">
<label for="discord">Discord</label>
<input type="text" id="discord" placeholder="Discord">
<div class="form-footer">
<small>Share your discord for more fun!</small>
<button class="save-btn-settings">SAVE</button>
</div>
</div>
</div>
<div class="right-section">
<div class="form-group-settings">
<label for="password">Password</label>
<input type="password" id="password" placeholder="Password">
</div>
<div class="form-group-settings">
<label for="new-password">New password</label>
<input type="password" id="new-password" placeholder="New password">
</div>
<div class="form-group-settings">
<label for="confirm-password">Confirm new password</label>
<input type="password" id="confirm-password" placeholder="Confirm password">
<div class="form-footer">
<small>We advise you to change your password regularly to reduce the risk of unauthorized access.</small>
<button class="save-btn-settings">SAVE</button>
</div>
</div>
<button class="delete-btn">Delete the account</button>
</div>
</div>
</div>

View File

@ -33,6 +33,7 @@ urlpatterns = [
path("404", views.err404, name='err404'), path("404", views.err404, name='err404'),
path("pfp/<str>", views.pfp, name='pfp'), path("pfp/<str>", views.pfp, name='pfp'),
path("banner/<str>", views.banner, name='banner'), path("banner/<str>", views.banner, name='banner'),
path("settingsPage", views.settingsPage, name='settingsPage'),
] ]
handler404 = "server.views.handler404" handler404 = "server.views.handler404"

View File

@ -147,4 +147,11 @@ def banner(request, str):
ret = FileResponse(open(image_path, 'rb'), content_type='image/png') ret = FileResponse(open(image_path, 'rb'), content_type='image/png')
except Exception: except Exception:
ret = FileResponse("banner not found", status=404) ret = FileResponse("banner not found", status=404)
return ret return ret
def settingsPage(request):
if(request.method != "POST"):
return index(request)
if(not request.session.get("logged_in", False)):
return(HttpResponse("you are not logged in",status=403))
return render(request, "settingsPage.html", {})

View File

@ -6,12 +6,13 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/25 00:00:21 by edbernar #+# #+# */ /* Created: 2024/08/25 00:00:21 by edbernar #+# #+# */
/* Updated: 2024/09/25 15:47:22 by edbernar ### ########.fr */ /* Updated: 2024/09/25 17:01:12 by edbernar ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
import { MultiOnlineGamePage } from "/static/javascript/multiOnlineGame/multiOnlineGamePage.js" import { MultiOnlineGamePage } from "/static/javascript/multiOnlineGame/multiOnlineGamePage.js"
import { multiLocalGamePage } from "/static/javascript/multiLocalGame/multiLocalGamePage.js" import { multiLocalGamePage } from "/static/javascript/multiLocalGame/multiLocalGamePage.js"
import { settingsPage } from "/static/javascript/settingsPage/settingsPage.js"
import { WaitingGamePage } from "/static/javascript/waitingGame/main.js" import { WaitingGamePage } from "/static/javascript/waitingGame/main.js"
import { ProfilPage } from "/static/javascript/profilPage/main.js"; import { ProfilPage } from "/static/javascript/profilPage/main.js";
import { LobbyPage } from "/static/javascript/lobbyPage/main.js"; import { LobbyPage } from "/static/javascript/lobbyPage/main.js";
@ -28,6 +29,7 @@ class Page
{suffix: false, url:'/wait_game', servUrl: '/waitingGamePage', class: WaitingGamePage, name: 'waitingGamePage', title: 'METH - Wait for a game'}, {suffix: false, url:'/wait_game', servUrl: '/waitingGamePage', class: WaitingGamePage, name: 'waitingGamePage', title: 'METH - Wait for a game'},
{suffix: false, url:'/game', servUrl: '/multiOnlineGamePage', class: MultiOnlineGamePage, name: 'multiOnlineGamePage', title: 'METH - Game'}, {suffix: false, url:'/game', servUrl: '/multiOnlineGamePage', class: MultiOnlineGamePage, name: 'multiOnlineGamePage', title: 'METH - Game'},
{suffix: true, url:'/profil', servUrl: '/profilPage', class: ProfilPage, name: 'profilPage', title: 'METH - Profil'}, {suffix: true, url:'/profil', servUrl: '/profilPage', class: ProfilPage, name: 'profilPage', title: 'METH - Profil'},
{suffix: false, url:'/settings', servUrl: '/settingsPage', class: settingsPage, name: 'settingsPage', title: 'METH - Settings'},
] ]
constructor() constructor()

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/20 14:52:55 by hubourge #+# #+# */ /* Created: 2024/08/20 14:52:55 by hubourge #+# #+# */
/* Updated: 2024/09/25 13:58:28 by edbernar ### ########.fr */ /* Updated: 2024/09/25 17:07:57 by edbernar ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -841,7 +841,7 @@ class Map
activeJumper(index) activeJumper(index)
{ {
ball.changeGravity(); ball.changeGravity();
if (listObject[index].isUp) if (this.arrObject[index].isUp)
this.#animationGravityChanger(this.arrObject[index].mesh, true); this.#animationGravityChanger(this.arrObject[index].mesh, true);
else else
this.#animationGravityChanger(this.arrObject[index].mesh, false); this.#animationGravityChanger(this.arrObject[index].mesh, false);
@ -1021,7 +1021,7 @@ class Map
this.updateScore(name, this.score); this.updateScore(name, this.score);
player.reserCameraPlayer(); player.reserCameraPlayer();
// ball.resetScaleBall(); ball.resetScaleBall();
// player.resetPosPlayer(); // player.resetPosPlayer();
// opponent.resetPosOpponent(); // opponent.resetPosOpponent();
}; };

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/18 00:53:53 by edbernar #+# #+# */ /* Created: 2024/08/18 00:53:53 by edbernar #+# #+# */
/* Updated: 2024/09/25 15:22:28 by edbernar ### ########.fr */ /* Updated: 2024/09/25 17:07:14 by edbernar ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@ -0,0 +1,26 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* settingsPage.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/25 17:00:35 by edbernar #+# #+# */
/* Updated: 2024/09/25 17:01:06 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
class settingsPage
{
static create()
{
}
static dispose()
{
}
}
export { settingsPage };

View File

@ -0,0 +1,102 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
#settingsBody {
background-color: #020202;
color: white;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: "Poppins", sans-serif;
font-weight: 500;
font-style: normal;
}
#settingsBody .container-settings {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 40px;
width: 60%;
padding: 20px;
}
#settingsBody .left-section,
#settingsBody .right-section {
display: flex;
flex-direction: column;
}
#settingsBody .form-group-settings {
display: flex;
flex-direction: column;
margin-bottom: 20px;
}
#settingsBody label {
margin-bottom: 5px;
}
#settingsBody input {
padding: 20px;
margin-bottom: 5px;
border: none;
background-color: white;
font-family: "Poppins", sans-serif;
font-weight: 500;
font-style: normal;
}
#settingsBody button{
font-family: "Poppins", sans-serif;
font-weight: 500;
font-style: normal;
}
#settingsBody button.save-btn-settings {
padding: 10px;
background-color: white;
color: #020202;
border: none;
cursor: pointer;
margin-top: 5px;
min-width: 100px;
transition: 0.3s ease;
}
#settingsBody button.save-btn-settings:hover {
transform: scale(1.1);
}
#settingsBody button.delete-btn {
padding: 10px;
width: 50%;
background-color: #D94343;
color: white;
border: none;
cursor: pointer;
margin-top: 20px;
margin-left: auto;
transition: 0.3s ease;
}
#settingsBody button.delete-btn:hover {
transform: scale(1.1);
}
#settingsBody .form-footer {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 5px;
}
#settingsBody small {
font-size: 13px;
color: #999;
margin-right: 10px;
margin-top: 5px;
}