forked from rebillar/site-accueil-insa
Enigma 1
This commit is contained in:
parent
d5863b1907
commit
c2ca941523
11 changed files with 114 additions and 83 deletions
|
@ -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,6 +115,22 @@ function get_enigma_code() {
|
||||||
echo json_encode($data, JSON_FORCE_OBJECT);
|
echo json_encode($data, JSON_FORCE_OBJECT);
|
||||||
break;
|
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:
|
default:
|
||||||
$data["name"] = null;
|
$data["name"] = null;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
body {
|
body {
|
||||||
color: #1a1a1a;
|
color: #b5b5b5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inner {
|
.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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#title_boo {
|
||||||
/* 2020 */
|
color: #7cd43f;
|
||||||
#finNormalEnigme{
|
|
||||||
font-size: 1.1rem;
|
|
||||||
text-align: right;
|
|
||||||
margin-right: 20px;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#petiteFinCitationGary{
|
#title_pek {
|
||||||
text-align: right;
|
color: #9a89fd;
|
||||||
font-size: 0.8rem;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#codeAda{
|
.team-button#buttonBoo {
|
||||||
font-family:'Cutive Mono', monospace;
|
color: #7cd43f;
|
||||||
font-size: 1.8rem;
|
background-color: #35621e;
|
||||||
text-align: left;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pekHint {
|
.team-button#buttonPek {
|
||||||
text-align: center;
|
color: #9a89fd;
|
||||||
|
background-color: #402559;
|
||||||
}
|
}
|
||||||
|
|
||||||
#creditBg{
|
.team-button#buttonBoo:hover {
|
||||||
text-align: right;
|
color: #35821e;
|
||||||
font-size: 10px;
|
background-color: #7cf43f;
|
||||||
margin-right: 8px;
|
box-shadow: 0 0 10px #7c843f;
|
||||||
}
|
}
|
||||||
|
|
||||||
#hideb {
|
.team-button#buttonPek:hover {
|
||||||
color: #C3A67A;
|
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);
|
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)
|
public function save_scores($scores_json, $team)
|
||||||
{
|
{
|
||||||
$sql = 'DELETE FROM scores WHERE team = ?';
|
$sql = 'DELETE FROM scores WHERE team = ?';
|
||||||
$cursor = $this->conn->prepare($sql);
|
$cursor = $this->conn->prepare($sql);
|
||||||
$cursor->execute([$team]);
|
$cursor->execute([$team]);
|
||||||
|
|
||||||
foreach ($scores_json as $value) {
|
foreach ($scores_json as $value) {
|
||||||
$sql = 'INSERT INTO scores (text, points, team) VALUES (?, ?, ?)';
|
$sql = 'INSERT INTO scores (text, points, team) VALUES (?, ?, ?)';
|
||||||
$cursor = $this->conn->prepare($sql);
|
$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/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>)
|
<a href="assets/pdf/Derechos-de-imagen.pdf">o aquí</a>)
|
||||||
</li>
|
</li>
|
||||||
<!--
|
|
||||||
<li>
|
|
||||||
<a href="assets/pdf/Enigma_PDF.pdf">L'énigme que tu cherchais tant</a>
|
|
||||||
</li>
|
|
||||||
-->
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
59
enigma.php
59
enigma.php
|
@ -1,10 +1,23 @@
|
||||||
<?
|
<?
|
||||||
ob_start(); // Start reading html
|
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>
|
<h1>Enigma</h1>
|
||||||
|
|
||||||
</div>
|
</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 : -->
|
Test résultats : -->
|
||||||
<!-- 012345 -->
|
<!-- 012345 -->
|
||||||
|
@ -17,13 +30,55 @@ Test résultats : -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<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() {
|
function getCode() {
|
||||||
let code = document.querySelector('#enigma').value;
|
let code = document.querySelector('#enigma').value;
|
||||||
let date = Date.now() / 1000;
|
let date = Date.now() / 1000;
|
||||||
|
let team = getTeam();
|
||||||
|
|
||||||
|
if(team === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let object = {
|
let object = {
|
||||||
"function": 'get_enigma_code',
|
"function": 'get_enigma_code',
|
||||||
'code': code,
|
'code': code,
|
||||||
'date': date,
|
'date': date,
|
||||||
|
'team': team,
|
||||||
}
|
}
|
||||||
return $.ajax({
|
return $.ajax({
|
||||||
url: 'ajax/read',
|
url: 'ajax/read',
|
||||||
|
@ -45,6 +100,7 @@ Test résultats : -->
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#top-bar-score").load(location.href + " #top-bar-score");
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -52,6 +108,7 @@ Test résultats : -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?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