Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
judemont committed Aug 3, 2024
2 parents 596b750 + 5b4a52d commit 01a4070
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 77 deletions.
35 changes: 17 additions & 18 deletions api/utils/getClientIp.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<?php
function getClientIp() {
$ipaddress = '';
if (isset($_SERVER['HTTP_CLIENT_IP']))
$ipaddress = $_SERVER['HTTP_CLIENT_IP'];
else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
else if(isset($_SERVER['HTTP_X_FORWARDED']))
$ipaddress = $_SERVER['HTTP_X_FORWARDED'];
else if(isset($_SERVER['HTTP_FORWARDED_FOR']))
$ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
else if(isset($_SERVER['HTTP_FORWARDED']))
$ipaddress = $_SERVER['HTTP_FORWARDED'];
else if(isset($_SERVER['REMOTE_ADDR']))
$ipaddress = $_SERVER['REMOTE_ADDR'];
else
$ipaddress = 'UNKNOWN';
return $ipaddress;
}
$headers = [
'HTTP_CLIENT_IP',
'HTTP_X_FORWARDED_FOR',
'HTTP_X_FORWARDED',
'HTTP_FORWARDED_FOR',
'HTTP_FORWARDED',
'REMOTE_ADDR'
];

foreach ($headers as $header) {
if (isset($_SERVER[$header])) {
return $_SERVER[$header];
}
}

?>
return 'UNKNOWN';
}
?>
62 changes: 29 additions & 33 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

<head>

<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>

<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="./images/favicon.ico" />
<link rel="icon" type="image/x-icon" href="./images/favicon.ico"/>

<!-- Styles -->
<link rel="stylesheet" href="./styles/styles.css" />
<link rel="stylesheet" href="./styles/header.css" />
<link rel="stylesheet" href="./styles/styles.css"/>
<link rel="stylesheet" href="./styles/header.css"/>

<!-- Standard assets -->
<link rel="stylesheet" href="./styles/standard-assets/button.css" />
<link rel="stylesheet" href="./styles/standard-assets/select.css" />
<link rel="stylesheet" href="./styles/standard-assets/input.css" />
<link rel="stylesheet" href="./styles/standard-assets/popup.css" />
<link rel="stylesheet" href="./styles/standard-assets/card.css" />
<link rel="stylesheet" href="./styles/standard-assets/button.css"/>
<link rel="stylesheet" href="./styles/standard-assets/select.css"/>
<link rel="stylesheet" href="./styles/standard-assets/input.css"/>
<link rel="stylesheet" href="./styles/standard-assets/popup.css"/>
<link rel="stylesheet" href="./styles/standard-assets/card.css"/>

<!-- Scripts -->
<script src="./scripts/utils/objectToFormData.js"></script>
Expand Down Expand Up @@ -48,14 +48,14 @@ <h1 class="main-header-title-text2">gl</h1>
</div>
<!-- Search bar -->
<div class="main-header-search">
<input id="searchBar" class="main-header-search-input" type="text" placeholder="chercher un schtroumpf" />
<img class="main-header-search-img" src="./images/search.png" alt="search icon" />
<input id="searchBar" class="main-header-search-input" type="text" placeholder="chercher un schtroumpf"/>
<img class="main-header-search-img" src="./images/search.png" alt="search icon"/>
</div>

<!-- Request new smurf button -->
<button class="standard-button main-header-button" onclick="openPopup('addPopup')">
<p class="main-header-button-text">nouveau schtroumpf</p>
<img class="main-header-button-img" src="./images/plus.png" alt="plus icon" />
<img class="main-header-button-img" src="./images/plus.png" alt="plus icon"/>
</button>
</header>

Expand All @@ -75,11 +75,11 @@ <h1 class="main-header-title-text2">gl</h1>
<div id="addPopup" class="standard-popup">
<div class="standard-popup-whole-section">
<button class="standard-button standard-popup-close" onclick="closePopup('addPopup')">
<img class="standard-popup-close-img" draggable="false" src="./images/close.svg" alt="close icon" />
<img class="standard-popup-close-img" draggable="false" src="./images/close.svg" alt="close icon"/>
</button>
<div class="standard-popup-whole-section-content add-smurf-popup">
<form style="display: contents" method="post" action="api/newSmurf.php">
<input name="name" class="standard-input insert-name" type="text" placeholder="nom du schtroumpf" />
<input name="name" class="standard-input insert-name" type="text" placeholder="nom du schtroumpf"/>
<button type="submit" class="standard-button send-request" onclick="closePopup('addPopup')">
Envoyer
</button>
Expand All @@ -91,14 +91,14 @@ <h1 class="main-header-title-text2">gl</h1>
<div id="commentPopup" class="standard-popup">
<div class="standard-popup-whole-section comment-popup">
<button class="standard-button standard-popup-close" onclick="closePopup('commentPopup')">
<img class="standard-popup-close-img" draggable="false" src="./images/close.svg" alt="close icon" />
<img class="standard-popup-close-img" draggable="false" src="./images/close.svg" alt="close icon"/>
</button>
<div class="standard-popup-whole-section-content comment-popup">
<div id="commentsPlace" class="standard-popup-whole-section-content-messages">
<p>Il n'y a pas de commentaires pour le moment...</p>
</div>
<div class="standard-popup-whole-section-content-send-messages">
<input id="commentContentInput" type="text" class="standard-input send-message" />
<input id="commentContentInput" type="text" class="standard-input send-message"/>
<button id="sendCommentButton" class="standard-button send-message">
Envoyer
</button>
Expand All @@ -110,28 +110,27 @@ <h1 class="main-header-title-text2">gl</h1>
<div id="ratingPopup" class="standard-popup">
<div class="standard-popup-whole-section rating-popup">
<button class="standard-button standard-popup-close" onclick="closePopup('ratingPopup')">
<img class="standard-popup-close-img comment-popup other" draggable="false" src="./images/close.svg"
alt="close icon" />
<img class="standard-popup-close-img comment-popup other" draggable="false" src="./images/close.svg" alt="close icon"/>
</button>
<div class="standard-popup-whole-section-content rating-popup">
<div class="score">
<p class="score-title">Intelligence</p>
<div class="score-value">
<input id="ratingIntelligence" class="value" type="range" min="1" max="10" value="5" />
<input id="ratingIntelligence" class="value" type="range" min="1" max="10" value="5"/>
<p id="ratingText1">5</p>
</div>
</div>
<div class="score">
<p class="score-title">Sympathie</p>
<div class="score-value">
<input id="ratingSympathy" class="value" type="range" min="1" max="10" value="5" />
<input id="ratingSympathy" class="value" type="range" min="1" max="10" value="5"/>
<p id="ratingText2">5</p>
</div>
</div>
<div class="score">
<p class="score-title">Utilité</p>
<div class="score-value">
<input id="ratingUtility" class="value" type="range" min="1" max="10" value="5" />
<input id="ratingUtility" class="value" type="range" min="1" max="10" value="5"/>
<p id="ratingText3">5</p>
</div>
</div>
Expand All @@ -157,16 +156,13 @@ <h1 class="alert-text"><!-- Insert alert text --> Votre vote a été mis a jour<
<div class="standard-popup-whole-section welcome-popup">
<div class="standard-popup-whole-section-content welcome-popup">
<h1 class="welcome-title">Bienvenue sur GARGAMELEAKS !</h1>
<p class="welcome-text">GARGAMELEAKS est un site web permettant aux habitants du village des Schtroumpfs de
donner leur avis sur
leurs amis Schtroumpfs et de leur attribuer une note.<br><br> Nous vous invitons à prendre connaissance, avant
d'utiliser
le site, du règlement.
<br>
Toute ressemblance avec des personnages ou des événements existants serait purement fortuite et ne pourrait
être que le fruit d’une pure coïncidence.
<p class="welcome-text">GARGAMELEAKS est un site web permettant aux habitants du village des Schtroumpfs de donner leur avis sur leurs amis Schtroumpfs et de leur attribuer une note.
<br><br>
Nous vous invitons à prendre connaissance, avant d'utiliser le site, du règlement.
<br><br>
Toute ressemblance avec des personnages ou des événements existants serait purement fortuite et ne pourrait être que le fruit d’une pure coïncidence.
</p>
<div class="welcome-links">
<div class="welcome-link">
<a target="_blank" rel="noopener noreferrer" href="rules.html">Règlement de GARGAMELEAKS</a>
</div>
<button class="standard-button welcome-button"
Expand All @@ -185,8 +181,8 @@ <h1 class="welcome-title">Plus d'info</h1>
<img src="images/smurf_prison.jpeg" alt="" width="100">
Le journal SCHTROUMF NEWS a écrit un article sur GARGAMELEAKS, vous pouvez le lire ici :
</p>
<div class="welcome-links">
<a target="_blank" rel="noopener noreferrer" href="SN">L'article totalement neutre de SCHTROUMF NEWS</a>
<div class="welcome-link">
<a target="_blank" rel="noopener noreferrer" href="news/">L'article totalement neutre de SCHTROUMF NEWS</a>
</div>
<button class="standard-button welcome-button" onclick="closeWelcomePopup('aboutPopup')">Fermer</button>
</div>
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
7 changes: 5 additions & 2 deletions scripts/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ ratingValues.forEach((value, index) => {
// });

document.addEventListener("DOMContentLoaded", function () {
document.body.style.overflow = "hidden";
openPopup("welcomePopup");
if (!localStorage.getItem("welcomePopup")) {
document.body.style.overflow = "hidden";
openPopup("welcomePopup");
}
});

getBann().then(function (result) {
if (result.banned) {
window.location.href = "banned.html";
Expand Down
4 changes: 2 additions & 2 deletions styles/standard-assets/card.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
}

.standart-card-stars-text {
margin-bottom: -10px;
margin-bottom: -14.5px;
margin-top: 10px;
transform: translateX(-1px);
font-size: 17px;
Expand All @@ -79,7 +79,7 @@
width: calc(100% - 20px);
}

@media screen and (max-width: 521px) {
@media screen and (max-width: 560px) {
.standard-card {
transform: scale(1.4) translateY(70px);
}
Expand Down
16 changes: 4 additions & 12 deletions styles/standard-assets/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -227,23 +227,15 @@
}

.welcome-title {
margin-top: -20px;
font-size: 55px;
margin-top: -5px;
font-size: 24px;
}

.welcome-text {
text-align: justify;
font-size: 18px;
}

.welcome-links {
display: flex;
align-items: center;
justify-content: center;
gap: 30px;
font-size: var(--main-font-sizealertPopup)
}

.welcome-button {
font-size: 25px;
}
Expand All @@ -269,7 +261,7 @@
font-size: 4.5vw;
}

.welcome-links {
.welcome-link {
font-size: 3.8vw;
}

Expand Down Expand Up @@ -345,7 +337,7 @@
}
}

@media screen and (max-width: 521px) {
@media screen and (max-width: 560px) {
.standard-popup-whole-section-content.add-smurf-popup {
width: 100dvw;
height: 100dvh;
Expand Down
15 changes: 11 additions & 4 deletions styles/standard-assets/select.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,24 @@

/* Main score select */
.main-score-select {
margin: 10px 17px -7px 17px;
margin-top: 11px;
width: 794px;
}

@media screen and (min-width: 1066px) {
@media screen and (min-width: 1106px) {
.main-score-select {
width: 1066px;
width: 1106px;
}
}

@media screen and (max-width: 521px) {
@media screen and (max-width: 833px) {
.main-score-select {
margin-bottom: -5px;
width: 521;
}
}

@media screen and (max-width: 560px) {
.main-score-select {
margin-bottom: -25px;
width: 352px;
Expand Down
14 changes: 8 additions & 6 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@
color: var(--main-color);
}

/* *::selection {
*::selection {
background-color: var(--border-color);
color: var(--main-background);
} */

}

body {
display: flex;
flex-direction: column;
align-items: center;
background-color: var(--main-background);
}

Expand All @@ -53,10 +55,10 @@ main {
width: 794px;
}

@media screen and (min-width: 1066px) {
@media screen and (min-width: 1106px) {
main {
grid-template-columns: repeat(4, 1fr);
width: 1066px;
width: 1106px;
}
}

Expand All @@ -67,7 +69,7 @@ main {
}
}

@media screen and (max-width: 521px) {
@media screen and (max-width: 560px) {
body {
display: flex;
flex-direction: column;
Expand Down

0 comments on commit 01a4070

Please sign in to comment.