blab
This commit is contained in:
parent
f3b715da48
commit
a19233a610
3 changed files with 72 additions and 58 deletions
|
@ -74,7 +74,7 @@ a:hover {
|
|||
background-size: cover;
|
||||
background-position: right;
|
||||
|
||||
transition: 1.5s transform 0s ease-out;
|
||||
transition: 1s transform 0s ease-out;
|
||||
}
|
||||
|
||||
#logo {
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
<div class="column-section">
|
||||
<h1>Chasse au trésor</h1>
|
||||
<p id="chasse-desc">
|
||||
Chaque jour de la semaine tes espions préférés ont préparé pour toi une <i style="font-weight: 900;">chasse au trésor</i> !
|
||||
Pendante toute la semaine tes espions préférés ont préparé pour toi une <i style="font-weight: 900;">chasse au trésor</i> !
|
||||
Résous les énigmes pour tenter de gagner le fameux <u>ticket d'or</u>. Il te permettra de t'abrever gratuitement pendants les évènements festifs !
|
||||
</p>
|
||||
</div>
|
||||
|
@ -118,6 +118,9 @@
|
|||
<div class="form-group">
|
||||
<input type="password" class="form-control" placeholder="Mot de passe secret" name="password" id="register-password" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" class="form-control" placeholder="Confirmer le mot de passe secret" name="password" id="register-password-confirm" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary" id="register-button">S'inscrire</button>
|
||||
</div>
|
||||
|
@ -130,7 +133,7 @@
|
|||
<div class="row banner">
|
||||
<h2>Notice pour l'espion</h2>
|
||||
<p id="notice-espion">
|
||||
Vous êtes espions et devez savoir retenir des mot de passe, car pour des raisons de sécurité celui-ci ne peut pas être changé. Alors faite attention !
|
||||
Vous êtes espions et devez savoir retenir des mots de passe, car pour des raisons de sécurité celui-ci ne peut pas être changé. Alors faite attention !
|
||||
</p>
|
||||
</div>
|
||||
</div> <!-- end login page -->
|
||||
|
@ -138,7 +141,7 @@
|
|||
<div id="demande-page" class="container" style="display: none">
|
||||
<div class="column-section">
|
||||
<h1>Demandes</h1>
|
||||
<p>Ici vous pouvez demandez à un espion aguerri de faire une mission pour vous comme commander des crêpes. Aussi, vous pouvez tentez de valider la chasse au trésor du jour !
|
||||
<p>Ici vous pouvez demandez à un espion aguerri de vous livrer des crêpes. Aussi, vous pouvez tentez de valider la chasse au trésor du jour !
|
||||
Pour cela il suffit d'envoyer une photo du ticket avec l'endroit où vous l'avez trouvé.
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -83,7 +83,17 @@ $("#register-button").click(function (e) {
|
|||
user: $("#register-user").val(),
|
||||
password: $("#register-password").val()
|
||||
});
|
||||
if( $("#register-password-confirm").val() != $("#register-password").val()) {
|
||||
t = new TypeIt('#error-message-register', {
|
||||
speed: 110,
|
||||
lifeLike: true
|
||||
})
|
||||
.type("Oups, les 2 mots de passe ne correspondent pas !")
|
||||
.go();
|
||||
return;
|
||||
}
|
||||
$("#register-password").val('');
|
||||
$("#register-password-confirm").val("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: base_url + "register",
|
||||
|
@ -222,7 +232,7 @@ function get_admin(type) {
|
|||
}
|
||||
$("#admin-content").append(`
|
||||
<span class="prank">
|
||||
<div id=prankDone>Nombre totale de mission achevées: ${doneCnt}</div>
|
||||
<div id=prankDone>Nombre totale de missions achevées: ${doneCnt}</div>
|
||||
</span>
|
||||
`);
|
||||
break;
|
||||
|
@ -626,63 +636,65 @@ $('#demande-button').click(function () {
|
|||
});
|
||||
|
||||
function updateDemandes() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: base_url + "get",
|
||||
data: JSON.stringify({
|
||||
uid: localStorage.getItem('user'),
|
||||
token: localStorage.getItem('token'),
|
||||
type: "prank"
|
||||
if(localStorage.getItem('user') && localStorage.getItem('token')) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: base_url + "get",
|
||||
data: JSON.stringify({
|
||||
uid: localStorage.getItem('user'),
|
||||
token: localStorage.getItem('token'),
|
||||
type: "prank"
|
||||
|
||||
}),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
}),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
|
||||
success: function (data) {
|
||||
if(data.success) {
|
||||
$('#demande-list').html('');
|
||||
let pd = [];
|
||||
for (pd_uid in data.prankData) {
|
||||
if (data.prankData[pd_uid].creator == localStorage.getItem('user')) {
|
||||
data.prankData[pd_uid].prankUid = pd_uid;
|
||||
pd.push(data.prankData[pd_uid]);
|
||||
success: function (data) {
|
||||
if(data.success) {
|
||||
$('#demande-list').html('');
|
||||
let pd = [];
|
||||
for (pd_uid in data.prankData) {
|
||||
if (data.prankData[pd_uid].creator == localStorage.getItem('user')) {
|
||||
data.prankData[pd_uid].prankUid = pd_uid;
|
||||
pd.push(data.prankData[pd_uid]);
|
||||
}
|
||||
}
|
||||
pd.sort((a, b) => new Date(b.date) - new Date(a.date));
|
||||
for(const pd_uid in pd) {
|
||||
$('#demande-list').append(`
|
||||
<span id="${pd[pd_uid].prankUid}" class="prank">
|
||||
<h2 class="prank-title">Demande de crêpe</h2>
|
||||
<div class="prank-amount">Quantité: ${pd[pd_uid].amount}</div>
|
||||
<div class="prank-supplement">Garniture: ${pd[pd_uid].supplement}</div>
|
||||
<div class="prank-where">Livraison: ${pd[pd_uid].where}</div>
|
||||
<div class="prank-note">Notes: ${pd[pd_uid].note}</div>
|
||||
<div class="prank-status">Statue: ${pd[pd_uid].state}</div>
|
||||
<span class="prank-footer">
|
||||
<div class="prank-uid">UID: ${pd[pd_uid].prankUid}</div>
|
||||
<div class="prank-date">DATE: ${pd[pd_uid].date}</div>
|
||||
</span>
|
||||
${ (pd[pd_uid].state != "Accepted" && pd[pd_uid].state != "Refused" ) ?
|
||||
`<span class="prank-btn">
|
||||
<div class="prank-btn-delete">Annuler</div>
|
||||
</span>`
|
||||
: ''
|
||||
}
|
||||
</span>
|
||||
`)
|
||||
}
|
||||
refreshListener();
|
||||
}
|
||||
else {
|
||||
if (data.why == "Not authentificated") {
|
||||
show_page('#login-page');
|
||||
} else {
|
||||
alert(data.why);
|
||||
}
|
||||
}
|
||||
pd.sort((a, b) => new Date(b.date) - new Date(a.date));
|
||||
for(const pd_uid in pd) {
|
||||
$('#demande-list').append(`
|
||||
<span id="${pd[pd_uid].prankUid}" class="prank">
|
||||
<h2 class="prank-title">Demande de crêpe</h2>
|
||||
<div class="prank-amount">Quantité: ${pd[pd_uid].amount}</div>
|
||||
<div class="prank-supplement">Garniture: ${pd[pd_uid].supplement}</div>
|
||||
<div class="prank-where">Livraison: ${pd[pd_uid].where}</div>
|
||||
<div class="prank-note">Notes: ${pd[pd_uid].note}</div>
|
||||
<div class="prank-status">Statue: ${pd[pd_uid].state}</div>
|
||||
<span class="prank-footer">
|
||||
<div class="prank-uid">UID: ${pd[pd_uid].prankUid}</div>
|
||||
<div class="prank-date">DATE: ${pd[pd_uid].date}</div>
|
||||
</span>
|
||||
${ (pd[pd_uid].state != "Accepted" && pd[pd_uid].state != "Refused" ) ?
|
||||
`<span class="prank-btn">
|
||||
<div class="prank-btn-delete">Annuler</div>
|
||||
</span>`
|
||||
: ''
|
||||
}
|
||||
</span>
|
||||
`)
|
||||
}
|
||||
refreshListener();
|
||||
}
|
||||
else {
|
||||
if (data.why == "Not authentificated") {
|
||||
show_page('#login-page');
|
||||
} else {
|
||||
alert(data.why);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updateNextActivity() {
|
||||
|
@ -748,7 +760,6 @@ $(window).on("load", function() {
|
|||
}
|
||||
|
||||
updateNextActivity();
|
||||
updateDemandes();
|
||||
|
||||
/* load timer */
|
||||
window.setInterval(function() {
|
||||
|
@ -779,7 +790,7 @@ $(window).on("load", function() {
|
|||
days = 0;
|
||||
updateNextActivity();
|
||||
}
|
||||
$('#timer').text(days + " jours " +(new Date('December 17, 1995 ' + t.join(':'))).toLocaleTimeString('default', {
|
||||
$('#timer').text( (days == 0 ? "" : days + " jours ") + (new Date('December 17, 1995 ' + t.join(':'))).toLocaleTimeString('default', {
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit'
|
||||
|
|
Loading…
Reference in a new issue