diff --git a/src/css/style.css b/src/css/style.css
index 2807bfb..5509932 100644
--- a/src/css/style.css
+++ b/src/css/style.css
@@ -343,7 +343,7 @@ body{
}
/*DemTéléphone 1i Ecran*/
-@media screen and (min-width: 350px) and (max-height: 850px) {
+@media screen and (max-width: 550px) and (max-height: 850px) {
.anneau{
box-sizing: border-box;
background-color: #DE3030;
diff --git a/src/index.html b/src/index.html
index 7af360f..8010075 100644
--- a/src/index.html
+++ b/src/index.html
@@ -1,6 +1,6 @@
-
+
SwishGame
@@ -138,273 +138,9 @@
-
-
-
-
-
-
+
diff --git a/src/js/main.js b/src/js/main.js
index 04dd559..c4b447e 100644
--- a/src/js/main.js
+++ b/src/js/main.js
@@ -59,6 +59,7 @@ function journuit(){
function lancerpartie(){
document.getElementById("pageAccueil").style.visibility = "hidden";
+ creecarte();
document.getElementById("pageGame").style.visibility = "visible";
}
@@ -67,23 +68,44 @@ function retour(){
document.getElementById("pageGame").style.visibility = "hidden";
}
-//PARTIE SELECTION
-function selectioncarte(lcarte){
- lacarte = "card"+ lcarte ;
- if(document.getElementById(lacarte).style.boxShadow != "")
- {
- var pos = carteselect.indexOf(lacarte);
- carteselect.splice(pos, 1);
- document.getElementById(lacarte).style.boxShadow = "";
- }
- else{
- if(carteselect.length < 5)
- {
- carteselect.push(lacarte);
- document.getElementById(lacarte).style.boxShadow = "0 0 1vw red, 0 0 1vw red";
+function creecarte(){
+ for (var j = 1; j <= 16; j++) {
+ //lien clicable
+ var newlink = document.createElement('a');
+ newlink.id = j;
+ //fonction de selection
+ newlink.onclick = function selectioncarte(){
+ macarte = this.id;
+ lacarte = "card"+macarte;
+ if(document.getElementById(lacarte).style.boxShadow != "")
+ {
+ var pos = carteselect.indexOf(lacarte);
+ carteselect.splice(pos, 1);
+ document.getElementById(lacarte).style.boxShadow = "";
+ }
+ else{
+ if(carteselect.length < 5)
+ {
+ carteselect.push(lacarte);
+ document.getElementById(lacarte).style.boxShadow = "0 0 1vw red, 0 0 1vw red";
+ }
+ else
+ window.alert("Bonjour !");
+ }
+ };
+ //div carte
+ var divconteneur = document.createElement('div');
+ divconteneur.className = "flex-item";
+ divconteneur.id = "card"+j;
+ //div case
+ //ICI A VOIR POUR AJOUTER LES FORMES EN FONCTION DE LA MATRICE
+ for (var i = 0; i < 12; i++) {
+ var divcase = document.createElement('div');
+ divcase.className = "item-form";
+ divconteneur.appendChild(divcase);
}
- else
- window.alert("Bonjour !");
+ newlink.appendChild(divconteneur);
+ document.getElementById("containcards").appendChild(newlink);
}
}
@@ -92,8 +114,6 @@ function selectioncarte(lcarte){
-
-
/*
Je n'avais rien à faire, je me suis amusé à faire l'ajout des joueurs
function addplayer(){