Suppression easteregg + fix captcha
This commit is contained in:
@@ -74,125 +74,5 @@ if (isset($_GET['success']) && $_GET['success'] === '1') {
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- Easter egg : code Konami (↑↑↓↓←→←→BA) => ouvre le mini-jeu "Presse-Citron" -->
|
||||
<style>
|
||||
#konami-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.72);
|
||||
z-index: 9999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 3vh 3vw;
|
||||
animation: konami-fade-in 0.2s ease;
|
||||
}
|
||||
|
||||
@keyframes konami-fade-in {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
.konami-modal {
|
||||
position: relative;
|
||||
width: min(1100px, 100%);
|
||||
height: min(760px, 94vh);
|
||||
border-radius: 18px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
|
||||
}
|
||||
|
||||
.konami-modal iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.konami-close {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border-radius: 50%;
|
||||
border: none;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
color: #fff;
|
||||
font-size: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.konami-close:hover {
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
(function () {
|
||||
// Séquence classique : Haut Haut Bas Bas Gauche Droite Gauche Droite B A
|
||||
var sequence = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'b', 'a'];
|
||||
var progres = 0;
|
||||
|
||||
document.addEventListener('keydown', function (e) {
|
||||
// Ignore la saisie dans un champ de formulaire (évite de déclencher pendant qu'on tape)
|
||||
var cible = e.target;
|
||||
if (cible && (cible.tagName === 'INPUT' || cible.tagName === 'TEXTAREA' || cible.isContentEditable)) return;
|
||||
|
||||
var touche = e.key.length === 1 ? e.key.toLowerCase() : e.key;
|
||||
var attendue = sequence[progres];
|
||||
|
||||
if (touche === attendue) {
|
||||
progres++;
|
||||
if (progres === sequence.length) {
|
||||
progres = 0;
|
||||
ouvrirPresseCitron();
|
||||
}
|
||||
} else {
|
||||
// Permet de relancer la séquence même si elle recommence par la même touche
|
||||
progres = (touche === sequence[0]) ? 1 : 0;
|
||||
}
|
||||
});
|
||||
|
||||
function ouvrirPresseCitron() {
|
||||
if (document.getElementById('konami-overlay')) return;
|
||||
|
||||
var overlay = document.createElement('div');
|
||||
overlay.id = 'konami-overlay';
|
||||
overlay.innerHTML =
|
||||
'<div class="konami-modal">' +
|
||||
'<button class="konami-close" aria-label="Fermer"><i class="fa-solid fa-xmark"></i></button>' +
|
||||
'<iframe src="./../pages/citron.php" title="Presse-Citron"></iframe>' +
|
||||
'</div>';
|
||||
document.body.appendChild(overlay);
|
||||
|
||||
overlay.querySelector('.konami-close').addEventListener('click', fermerPresseCitron);
|
||||
overlay.addEventListener('click', function (e) {
|
||||
if (e.target === overlay) fermerPresseCitron();
|
||||
});
|
||||
document.addEventListener('keydown', echapFerme);
|
||||
}
|
||||
|
||||
function echapFerme(e) {
|
||||
if (e.key === 'Escape') fermerPresseCitron();
|
||||
}
|
||||
|
||||
function fermerPresseCitron() {
|
||||
var overlay = document.getElementById('konami-overlay');
|
||||
if (overlay) overlay.remove();
|
||||
document.removeEventListener('keydown', echapFerme);
|
||||
}
|
||||
|
||||
// Le jeu (dans l'iframe) peut aussi demander la fermeture (touche Échap captée à
|
||||
// l'intérieur de l'iframe, qui ne reçoit pas les événements clavier de la page parente)
|
||||
window.addEventListener('message', function (e) {
|
||||
if (e.data === 'citron-close') fermerPresseCitron();
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user