il faudrait ajouter la verification du mot de passe

This commit is contained in:
2024-12-24 02:53:21 +01:00
parent 39adc39b45
commit d185b9a7f3
3 changed files with 52 additions and 6 deletions

View File

@@ -10,12 +10,12 @@ liste_carte_defaut:
image: static/css/img/cartes/E_b.webp image: static/css/img/cartes/E_b.webp
contenu: E contenu: E
couleur: bleu couleur: bleu
donné: oui donné: non
- numero: 3 - numero: 3
image: static/css/img/cartes/R_b.webp image: static/css/img/cartes/R_b.webp
contenu: R contenu: R
couleur: bleu couleur: bleu
donné: oui donné: non
- numero: 4 - numero: 4
image: static/css/img/cartes/P_j.webp image: static/css/img/cartes/P_j.webp
contenu: P contenu: P
@@ -25,7 +25,7 @@ liste_carte_defaut:
image: static/css/img/cartes/T_b.webp image: static/css/img/cartes/T_b.webp
contenu: T contenu: T
couleur: bleu couleur: bleu
donné: oui donné: non
- numero: 6 - numero: 6
image: static/css/img/cartes/E_j.webp image: static/css/img/cartes/E_j.webp
contenu: E contenu: E
@@ -41,12 +41,12 @@ liste_carte_échangé:
image: static/css/img/cartes/L_j.webp image: static/css/img/cartes/L_j.webp
contenu: L contenu: L
couleur: violet couleur: violet
recupéré: oui recupéré: non
- numero: 9 - numero: 9
image: static/css/img/cartes/I_j.webp image: static/css/img/cartes/I_j.webp
contenu: I contenu: I
couleur: violet couleur: violet
recupéré: oui recupéré: non
- numero: 10 - numero: 10
image: static/css/img/cartes/U_b.webp image: static/css/img/cartes/U_b.webp
contenu: U contenu: U
@@ -56,7 +56,7 @@ liste_carte_échangé:
image: static/css/img/cartes/S_j.webp image: static/css/img/cartes/S_j.webp
contenu: S contenu: S
couleur: violet couleur: violet
recupéré: oui recupéré: non
- numero: 12 - numero: 12
image: static/css/img/cartes/O_b.webp image: static/css/img/cartes/O_b.webp
contenu: O contenu: O

View File

@@ -15,6 +15,7 @@ html, body {
} }
.carte { .carte {
animation: zoomOut 0.4s ease-out; /* Applique l'animation à chaque carte */
position: absolute; position: absolute;
width: 15vw; /* Taille des cartes */ width: 15vw; /* Taille des cartes */
height: calc(15vw * 1.4); /* Respecte le ratio */ height: calc(15vw * 1.4); /* Respecte le ratio */
@@ -24,6 +25,16 @@ html, body {
touch-action: none; touch-action: none;
} }
#zone_cartes .carte.zoom-in {
transform: scale(1.8) !important;
z-index: 20 !important;
transition: transform 0.2s ease-in-out !important;
}
#emplacements { #emplacements {
position: absolute; position: absolute;
bottom: 150px; /* Augmente la distance par rapport au bas de l'écran */ bottom: 150px; /* Augmente la distance par rapport au bas de l'écran */
@@ -56,3 +67,15 @@ html, body {
border: 2px solid black; border: 2px solid black;
z-index: 5; z-index: 5;
} }
/* Animation de zoom */
@keyframes zoomOut {
from {
transform: scale(10); /* Taille initiale (double) */
opacity: 0; /* Invisible */
}
to {
transform: scale(1); /* Taille normale */
opacity: 1; /* Visible */
}
}

View File

@@ -133,12 +133,18 @@ function positionAleatoire(zone, carte) {
function rendreDeplacable(carte) { function rendreDeplacable(carte) {
let offsetX, offsetY; let offsetX, offsetY;
let hasMoved = false; // Indique si la carte a été déplacée
carte.addEventListener('pointerdown', (e) => { carte.addEventListener('pointerdown', (e) => {
console.log("Pointer down : Début du déplacement.");
offsetX = e.clientX - carte.getBoundingClientRect().left; offsetX = e.clientX - carte.getBoundingClientRect().left;
offsetY = e.clientY - carte.getBoundingClientRect().top; offsetY = e.clientY - carte.getBoundingClientRect().top;
carte.style.cursor = 'grabbing'; carte.style.cursor = 'grabbing';
// Ajout de la classe pour zoom in
carte.classList.add('zoom-in');
console.log("Classe zoom-in ajoutée.");
const pointerMove = (e) => { const pointerMove = (e) => {
carte.style.left = `${e.clientX - offsetX}px`; carte.style.left = `${e.clientX - offsetX}px`;
@@ -149,7 +155,17 @@ function rendreDeplacable(carte) {
}; };
const pointerUp = () => { const pointerUp = () => {
console.log("Pointer up : Fin du déplacement.");
carte.style.cursor = 'grab'; carte.style.cursor = 'grab';
// Retirer la classe pour zoom in
carte.classList.remove('zoom-in');
console.log("Classe zoom-in retirée.");
if (carte.dataset.aimantee === "true") {
console.log("Carte reste aimantée");
} else {
console.log("Carte n'est plus aimantée");
}
// Vérifier si la carte est dans la zone blanche // Vérifier si la carte est dans la zone blanche
if (isInZoneBlanche(carte)) { if (isInZoneBlanche(carte)) {
@@ -223,6 +239,7 @@ async function supprimerCarte(carte) {
function verifierAimantation(carte) { function verifierAimantation(carte) {
const emplacements = document.querySelectorAll('.emplacement'); const emplacements = document.querySelectorAll('.emplacement');
const aimantationDistance = 50; // Augmenter la distance pour plus de tolérance const aimantationDistance = 50; // Augmenter la distance pour plus de tolérance
let aimantationEffectuee = false; // Initialisation de la variable
emplacements.forEach((rond) => { emplacements.forEach((rond) => {
const rondRect = rond.getBoundingClientRect(); const rondRect = rond.getBoundingClientRect();
@@ -240,8 +257,14 @@ function verifierAimantation(carte) {
if (distanceX <= aimantationDistance && distanceY <= aimantationDistance) { if (distanceX <= aimantationDistance && distanceY <= aimantationDistance) {
aimanterCarte(carte, rond); aimanterCarte(carte, rond);
carte.dataset.aimantee = "true"; // Marque la carte comme aimantée
aimantationEffectuee = true;
carte.classList.remove('zoom-in'); // Désactive le zoom après aimantation
} }
}); });
if (!aimantationEffectuee) {
carte.dataset.aimantee = "false"; // La carte n'est plus aimantée
}
} }
// Faire glisser et pivoter une carte relâchée en dehors des zones d'aimantation // Faire glisser et pivoter une carte relâchée en dehors des zones d'aimantation
function lancerCarte(carte) { function lancerCarte(carte) {