forked from vergnet/site-accueil-insa
Enigma 1
This commit is contained in:
parent
d5863b1907
commit
c2ca941523
11 changed files with 114 additions and 83 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
|
||||
|
|
@ -115,7 +115,23 @@ function get_enigma_code() {
|
|||
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||
break;
|
||||
|
||||
|
||||
case 'PEETA' :
|
||||
$data["name"] = "enigme-2";
|
||||
$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;
|
||||
|
||||
default:
|
||||
$data["name"] = null;
|
||||
$points_data["points"] = 0;
|
||||
|
|
|
@ -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.
|
@ -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