Compare commits
2 commits
7c4dfb5a33
...
c2ca941523
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2ca941523 | ||
|
|
d5863b1907 |
12 changed files with 149 additions and 196 deletions
|
|
@ -5,7 +5,7 @@ $relativePath = "../";
|
|||
<div class="inner">
|
||||
<h1>ADMIN</h1>
|
||||
<h2>Bienvenue sur la page d'administration</h2>
|
||||
|
||||
|
||||
<p>
|
||||
Sur cette page, tu vas pouvoir animer le site en changeant les scores, le planning ou les informations de la
|
||||
carte.
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
AuthName "MDP ?"
|
||||
AuthType Basic
|
||||
AuthUserFile /home_clubs/accueil_insa/public_html/includes/pass/.htpass_gda
|
||||
require valid-user
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
AuthName "MDP ?"
|
||||
AuthType Basic
|
||||
AuthUserFile /home_clubs/accueil_insa/public_html/includes/pass/.htpass_admin
|
||||
require valid-user
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
AuthName "MDP ?"
|
||||
AuthType Basic
|
||||
AuthUserFile /home_clubs/accueil_insa/public_html/includes/pass/.htpass_webmaster
|
||||
require valid-user
|
||||
|
||||
|
|
@ -16,6 +16,12 @@ if (isset($_GET['function'])) {
|
|||
} else
|
||||
show_error();
|
||||
|
||||
function get_map_selectors() {
|
||||
header('Content-Type: application/json');
|
||||
$dao = new Dao();
|
||||
echo json_encode($dao->get_map_selectors());
|
||||
}
|
||||
|
||||
function get_scores() {
|
||||
if (isset($_GET['team'])) {
|
||||
header('Content-Type: application/json');
|
||||
|
|
@ -51,15 +57,45 @@ function get_activities_of_day() {
|
|||
// Section pour les énigmes
|
||||
//
|
||||
|
||||
function isFirstTeamToSolve($score_data) {
|
||||
$team = $score_data['team'];
|
||||
$enigme = $score_data['text'];
|
||||
$dao = new Dao();
|
||||
$scorePek = $dao->get_score_team('pek');
|
||||
$scoreBoo = $dao->get_score_team('boo');
|
||||
$score = array_merge($scorePek, $scoreBoo);
|
||||
|
||||
foreach($score as $value) {
|
||||
|
||||
if ($value['text'] == $enigme)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function get_enigma_code() {
|
||||
if (isset($_GET['code'])) {
|
||||
$data = array(
|
||||
"name" => $_GET['code'],
|
||||
"info" => null,
|
||||
);
|
||||
|
||||
$team = $_GET['team'];
|
||||
|
||||
$score_data = array(
|
||||
"text" => null,
|
||||
"points" => 0,
|
||||
"team" => $team,
|
||||
);
|
||||
|
||||
|
||||
switch ($_GET['code']) {
|
||||
case '501432' :
|
||||
$data["name"] = "enigme-1";
|
||||
$score_data["text"] = 'Énigme 1';
|
||||
$score_data["points"] = 200;
|
||||
|
||||
if($_GET['date'] < 1627221618 ) {
|
||||
$data["info"] = "<h2>Énigme 1</h2>Code trouvé, reviens demain pour avoir la suite ;)";
|
||||
} else {
|
||||
|
|
@ -71,133 +107,35 @@ function get_enigma_code() {
|
|||
est, est, est, ouest, sud, sud, sud; <br>
|
||||
nord,nord,nord-est, , sud-est, sud, sud, nord, ouest; <br>
|
||||
</p>";
|
||||
if(isFirstTeamToSolve($score_data)) {
|
||||
$dao = new Dao();
|
||||
$dao->add_score($score_data);
|
||||
}
|
||||
}
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
|
||||
case 'PEETA' :
|
||||
$data["name"] = "enigme-2";
|
||||
if($_GET['date'] < 1627221618 ) {
|
||||
$score_data["text"] = 'Énigme 2';
|
||||
$score_data["points"] = 500;
|
||||
|
||||
if($_GET['date'] < 1628361000 ) {
|
||||
$data["info"] = "<h2>Énigme 2</h2>Code trouvé, reviens demain pour avoir la suite ;)";
|
||||
} else {
|
||||
$data["info"] = "<h2>Énigme 2</h2>Dès l'aube, un oiseau aux sifflements merveilleux fit son apparition sur l'arène de l'INSA";
|
||||
if(isFirstTeamToSolve($score_data)) {
|
||||
$dao = new Dao();
|
||||
$dao->add_score($score_data);
|
||||
}
|
||||
}
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
|
||||
case 'Lucy Gray Baird' :
|
||||
$data["name"] = "enigme-3";
|
||||
if($_GET['date'] < 1627221618 ) {
|
||||
$data["info"] = "<h2>Énigme 3</h2><img src=\"assets/images/enigmes/Caesar.jpg\"></img>";
|
||||
} else {
|
||||
$data["info"] = "<h2>Énigme 3</h2>
|
||||
<p>OaduaxmzgeEzai</p>
|
||||
<img src=\"assets/enigmes/Caesar.jpg\"></img>";
|
||||
}
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
|
||||
case 'CoriolanusSnow' :
|
||||
$data["name"] = "enigme-4";
|
||||
if($_GET['date'] < 1627221618 ) {
|
||||
$data["info"] = "<h2>Énigme 4</h2>
|
||||
Code trouvé ! Parcours du site en cours...";
|
||||
} else {
|
||||
$data["info"] = "<h2>Énigme 4</h2>
|
||||
Code trouvé ! Parcours du site en cours...
|
||||
<p>Voilà plusieurs jours que tu parcours les énigmes, augmentons un peu la difficulté</p>";
|
||||
}
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
|
||||
case 'PANEM' :
|
||||
$data["name"] = "enigme-5";
|
||||
if($_GET['date'] < 1627221618 ) {
|
||||
$data["info"] = "<h2>Énigme 5</h2>
|
||||
Code trouvé !";
|
||||
} else {
|
||||
$data["info"] = "<h2>Énigme 5</h2>
|
||||
<p>N'aurais tu pas oublié quelque chose ?</p>";
|
||||
}
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
|
||||
case 'Théorème de Gauss' :
|
||||
$data["name"] = "enigme-6";
|
||||
if($_GET['date'] < 1627221618 ) {
|
||||
$data["info"] = "<h2>Énigme 6</h2>
|
||||
Code trouvé ! T'es turbo rapide toi !";
|
||||
} else {
|
||||
$data["info"] = "<h2>Énigme 6</h2>
|
||||
<p>Quelle est la somme des lettres des solutions des deux dernières énigmes ? (ASCII)</p>";
|
||||
}
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
|
||||
case '2234' :
|
||||
$data["name"] = "enigme-7";
|
||||
if($_GET['date'] < 1627221618 ) {
|
||||
$data["info"] = "<h2>Énigme 7</h2>
|
||||
Code trouvé ! Tu es fort, je m'en vais créer de nouvelles énigmes encore plus difficiles..";
|
||||
} else {
|
||||
$data["info"] = "<h2>Énigme 7</h2>
|
||||
<!--Katniss-->
|
||||
<p>Entre deux épisodes, une idée m'est venue <a href=\"https://Ppmmpppppmpmmpppmfmppmffmppfpm\">.</a></p>";
|
||||
}
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
|
||||
case '1985281616' :
|
||||
$data["name"] = "enigme-8";
|
||||
if($_GET['date'] < 1627221618 ) {
|
||||
$data["info"] = "<h2>Énigme 8</h2>
|
||||
Code trouvé !";
|
||||
} else {
|
||||
$data["info"] = "<h2>Énigme 8</h2>
|
||||
<!--<a href=\"assets/enigmes/crypto.py\">Courage</a>-->";
|
||||
}
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
|
||||
case 'BAILA' :
|
||||
$data["name"] = "enigme-9";
|
||||
if($_GET['date'] < 1627221618 ) {
|
||||
$data["info"] = "<h2>Énigme 9</h2>
|
||||
Code trouvé !";
|
||||
} else {
|
||||
$data["info"] = "<h2>Énigme 9</h2>
|
||||
Il te reste toujours à déchiffrer ce code mystérieux ;)";
|
||||
}
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
|
||||
case 'Hacker la NASA en HTML' :
|
||||
$data["name"] = "enigme-10";
|
||||
if($_GET['date'] < 1627221618 ) {
|
||||
$data["info"] = "<h2>Énigme 10</h2>
|
||||
Code trouvé !";
|
||||
} else {
|
||||
$data["info"] = "<h2>Énigme 10</h2>
|
||||
<p>Maintenant que tu as hacké la NASA en HTML et trouvé le code précédent,
|
||||
dis moi quelle est la ville autour de Toulouse qui commence phonétiquement par le code précédent en verlant ? </p>";
|
||||
}
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
|
||||
case 'Labège' :
|
||||
$data["name"] = "enigme-11";
|
||||
if($_GET['date'] < 1627221618 ) {
|
||||
$data["info"] = "<h2>Énigme 11</h2>
|
||||
Code trouvé !";
|
||||
} else {
|
||||
$data["info"] = "<h2>Énigme 11</h2>
|
||||
<p>Petit rappel, va écouter la <a href=https://youtu.be/8Eapq5TOzn4\"\">musique</a> de JAG</p>";
|
||||
}
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
|
||||
default:
|
||||
$data["name"] = null;
|
||||
$points_data["points"] = 0;
|
||||
|
||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
body {
|
||||
color: #1a1a1a;
|
||||
color: #b5b5b5;
|
||||
}
|
||||
|
||||
.inner {
|
||||
|
|
@ -9,75 +9,46 @@ body {
|
|||
|
||||
}
|
||||
|
||||
#poemeRimbaud, #citationGary{
|
||||
font-family: manuscrit, cursive;
|
||||
font-size: 3rem;
|
||||
|
||||
|
||||
.team-button {
|
||||
border-radius: 0.2rem;
|
||||
font-size: 2.5rem;
|
||||
font-family: Harry-P, fantasy;
|
||||
cursor: pointer;
|
||||
padding: 15px 20px;
|
||||
margin: 10px;
|
||||
transition: 0.2s;
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
/* 2020 */
|
||||
#finNormalEnigme{
|
||||
font-size: 1.1rem;
|
||||
text-align: right;
|
||||
margin-right: 20px;
|
||||
font-style: italic;
|
||||
#title_boo {
|
||||
color: #7cd43f;
|
||||
}
|
||||
|
||||
#petiteFinCitationGary{
|
||||
text-align: right;
|
||||
font-size: 0.8rem;
|
||||
margin-right: 20px;
|
||||
#title_pek {
|
||||
color: #9a89fd;
|
||||
}
|
||||
|
||||
#codeAda{
|
||||
font-family:'Cutive Mono', monospace;
|
||||
font-size: 1.8rem;
|
||||
text-align: left;
|
||||
.team-button#buttonBoo {
|
||||
color: #7cd43f;
|
||||
background-color: #35621e;
|
||||
}
|
||||
|
||||
#pekHint {
|
||||
text-align: center;
|
||||
.team-button#buttonPek {
|
||||
color: #9a89fd;
|
||||
background-color: #402559;
|
||||
}
|
||||
|
||||
#creditBg{
|
||||
text-align: right;
|
||||
font-size: 10px;
|
||||
margin-right: 8px;
|
||||
.team-button#buttonBoo:hover {
|
||||
color: #35821e;
|
||||
background-color: #7cf43f;
|
||||
box-shadow: 0 0 10px #7c843f;
|
||||
}
|
||||
|
||||
#hideb {
|
||||
color: #C3A67A;
|
||||
.team-button#buttonPek:hover {
|
||||
color: #402559;
|
||||
background-color: #aaa9fd;
|
||||
box-shadow: 0 0 10px #9a89dd;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
#poemeRimbaud, #citationGary{
|
||||
font-family: manuscrit, cursive;
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
#codeAda{
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 576px) {
|
||||
#poemeRimbaud, #citationGary{
|
||||
font-family: manuscrit, cursive;
|
||||
font-size: 1.3rem;
|
||||
}
|
||||
|
||||
#codeAda{
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
/* 2020 */
|
||||
#finNormalEnigme{
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
#petiteFinCitationGary{
|
||||
text-align: right;
|
||||
font-size: 0.6rem;
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -160,8 +160,8 @@ function handleClickOnBuilding(x,y) {
|
|||
|
||||
// If we clicked on a building
|
||||
if (intersects.length > 0) {
|
||||
console.log(intersects);
|
||||
|
||||
// console.log(intersects);
|
||||
//console.log( intersects[0].object.name.toString());
|
||||
var selector = intersects[0].object.name.toString().toLowerCase();
|
||||
|
||||
// Wait for getSelectors() to be done
|
||||
|
|
|
|||
|
|
@ -34,11 +34,17 @@ class Dao
|
|||
return $cursor->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function add_score($score_data) {
|
||||
$sql = 'INSERT INTO scores (text, points, team) VALUES (?, ?, ?)';
|
||||
$cursor = $this->conn->prepare($sql);
|
||||
$cursor->execute([$score_data['text'], $score_data['points'], $score_data['team']]);
|
||||
}
|
||||
public function save_scores($scores_json, $team)
|
||||
{
|
||||
$sql = 'DELETE FROM scores WHERE team = ?';
|
||||
$cursor = $this->conn->prepare($sql);
|
||||
$cursor->execute([$team]);
|
||||
|
||||
foreach ($scores_json as $value) {
|
||||
$sql = 'INSERT INTO scores (text, points, team) VALUES (?, ?, ?)';
|
||||
$cursor = $this->conn->prepare($sql);
|
||||
|
|
|
|||
|
|
@ -20,11 +20,7 @@ ob_start(); // Start reading html
|
|||
<a href="assets/pdf/Droit-Image.pdf">La charte de droit à l'image</a> (<a href="assets/pdf/Image-rights.pdf">or here</a>,
|
||||
<a href="assets/pdf/Derechos-de-imagen.pdf">o aquí</a>)
|
||||
</li>
|
||||
<!--
|
||||
<li>
|
||||
<a href="assets/pdf/Enigma_PDF.pdf">L'énigme que tu cherchais tant</a>
|
||||
</li>
|
||||
-->
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
61
enigma.php
61
enigma.php
|
|
@ -1,10 +1,23 @@
|
|||
<?
|
||||
ob_start(); // Start reading html
|
||||
?>
|
||||
<div class="inner">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="assets/css/enigma.css"><div class="inner">
|
||||
<h1>Enigma</h1>
|
||||
|
||||
</div>
|
||||
<p>Pour résoudre les énigmes, un ordinateur est conseillé.</p>
|
||||
<p>Petit tuto pour lire un code source (HTML) :</p>
|
||||
<ul>
|
||||
<li>Ouvrir l'inspecteur d'élements, avec le clique droit ou dans le menu outils du navigateur (ou CTRL+Shift+I pour les intimes</li>
|
||||
<li>Parce qu'on a la flemme de lire l'entièreté du code, il faut utiliser le petit outil magique.</li>
|
||||
<li>Cet outil magique est le sélectionneur d'élements, petite icône rectangle + curseur sur le haut à droite de la fenêtre fraichement ouverte. (ou CTRL+Shift+C)
|
||||
<li>Trouver beaucoup d'éléments pour l'énigme </li>
|
||||
</ul>
|
||||
<h4> Choisis ton équipe !</h4>
|
||||
<div id="enigma-teams">
|
||||
<button onclick="setTeam(this.id)" class="team-button" id="buttonBoo">Boomiflore</button>
|
||||
<button onclick="setTeam(this.id)" class="team-button" id="buttonPek">Peksureau</button>
|
||||
</div>
|
||||
<!--
|
||||
Test résultats : -->
|
||||
<!-- 012345 -->
|
||||
|
|
@ -17,13 +30,55 @@ Test résultats : -->
|
|||
</div>
|
||||
|
||||
<script>
|
||||
function getTeam() {
|
||||
var selected = document.querySelector('#enigma-teams .active');
|
||||
if(selected === null) {
|
||||
alert("Choisissez votre équipe !");
|
||||
return;
|
||||
}
|
||||
|
||||
return selected.id.substring(6, selected.length).toLowerCase();
|
||||
}
|
||||
|
||||
function setTeam(team) {
|
||||
var selected = document.querySelector('#' + team);
|
||||
var buttonBoo = document.querySelector('#buttonBoo');
|
||||
var buttonPek = document.querySelector('#buttonPek');
|
||||
var mainContent = document.querySelector('#main-content-wrap');
|
||||
|
||||
//alert(selected.id)
|
||||
selected.classList.add('active');
|
||||
|
||||
team = team.substring(6, team.length);
|
||||
|
||||
switch(team) {
|
||||
case 'Boo':
|
||||
mainContent.style.background = "#0A1406";
|
||||
buttonPek.classList.remove('active');
|
||||
break;
|
||||
case 'Pek' :
|
||||
mainContent.style.background = "#0D0712";
|
||||
buttonBoo.classList.remove('active');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function getCode() {
|
||||
let code = document.querySelector('#enigma').value;
|
||||
let date = Date.now() / 1000;
|
||||
let team = getTeam();
|
||||
|
||||
if(team === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
let object = {
|
||||
"function": 'get_enigma_code',
|
||||
'code': code,
|
||||
'date': date,
|
||||
'team': team,
|
||||
}
|
||||
return $.ajax({
|
||||
url: 'ajax/read',
|
||||
|
|
@ -45,13 +100,15 @@ Test résultats : -->
|
|||
|
||||
}
|
||||
|
||||
//console.log(data);
|
||||
$("#top-bar-score").load(location.href + " #top-bar-score");
|
||||
//console.log(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<?php
|
||||
|
||||
|
|
|
|||
BIN
favicon.ico
Executable file → Normal file
BIN
favicon.ico
Executable file → Normal file
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 15 KiB |
Loading…
Reference in a new issue