diff --git a/src/css/fonts/Montserrat-Black.ttf b/src/css/fonts/Montserrat-Black.ttf new file mode 100644 index 0000000..437b115 Binary files /dev/null and b/src/css/fonts/Montserrat-Black.ttf differ diff --git a/src/css/fonts/Montserrat-Black.woff b/src/css/fonts/Montserrat-Black.woff new file mode 100644 index 0000000..de437e0 Binary files /dev/null and b/src/css/fonts/Montserrat-Black.woff differ diff --git a/src/css/fonts/Montserrat-Black.woff2 b/src/css/fonts/Montserrat-Black.woff2 new file mode 100644 index 0000000..63265f8 Binary files /dev/null and b/src/css/fonts/Montserrat-Black.woff2 differ diff --git a/src/css/fonts/Montserrat-ExtraBold.ttf b/src/css/fonts/Montserrat-ExtraBold.ttf new file mode 100644 index 0000000..80ea806 Binary files /dev/null and b/src/css/fonts/Montserrat-ExtraBold.ttf differ diff --git a/src/css/fonts/Montserrat-ExtraBold.woff2 b/src/css/fonts/Montserrat-ExtraBold.woff2 new file mode 100644 index 0000000..9e51d11 Binary files /dev/null and b/src/css/fonts/Montserrat-ExtraBold.woff2 differ diff --git a/src/css/style.css b/src/css/style.css index 1a1154b..47eff13 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -1,89 +1,672 @@ -body { - background-color: purple; - color:white; - display: flex; - flex-wrap: wrap; +:root{ + /*couleur héhé*/ + --lightprima: #DEDEDE; + --lightsedonca: #B7B7B7; + --lighttercia: #E6E6E6; } -.cbleu >div{ - background-color: blue; +@font-face { + font-family: "Montserrat"; + src: url("/fonts/MonstMontserrat-Black.woff") format("woff"), + url("/fonts/MonstMontserrat-Black.woff2") format("woff2"); } -.cvert >div{ - background-color: green; +a { + cursor: pointer; + z-index: 60; } -.corange >div{ - background-color: orange; +body{ + background-color: var(--lightprima); + overflow-x: hidden; + overflow-y: hidden; + /*Desactiver la selection*/ + -webkit-user-select: none; /* Chrome / Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE 10+ */ + user-select: none; } +/* versions mobiles, tablette à faire*/ + +/*Version mobile V1*/ +@media only screen and (min-width: 320px) { + + .logop2 img { + position: absolute; + width: 25vw; + left: 37vw; + top: 98vw; + z-index: 30; + } + + .logo img{ + position: absolute; + width: 50vw; + left: 25vw; + top: 13%; + z-index: 11; + } + + .mounts img { + object-fit: cover; + position: absolute; + height: 100%; + width: 100%; + pointer-events: none; + margin-left: -10px; + } + + #contourbuttonvalider{ + position: absolute; + border-radius: 45px; + left: -12vw; + top: 6vw; + height: 13vw; + width: 55vw; + background-color: var(--lightsedonca); + z-index: 15; + } + + .bouttonvalider{ + position: absolute; + height: 11vw; + width: 53vw; + top: 1vw; + left: 1vw; + border-radius: 40px; + background-color: #B130DE; + } + + #textjouer{ + font-family: Montserrat, impact, Arial Black; + position: absolute; + font-size: 10vw; + margin-top: -0.7vw; + margin-left: 13.5vw; + color: var(--lightsedonca); + } + + #ContainBottom { + position: absolute; + margin-left: 25vw; + height: 25vw; + width: auto; + bottom: 0; + z-index: 20; + } + + #clic{ + visibility: hidden; + } + + #card-conteneur{ + z-index: 20; + position: absolute; + left: 0vw; + height: 100%; + } + + .flex-container { + padding: 0; + margin: 0; + list-style: none; + display: flex; + height: 100%; + + -webkit-flex-flow: row wrap; + justify-content: space-around; + margin-top: -3vw; + } + + .flex-item { + background: var(--lightsedonca); + width: 25vw; + height: 40vw; + margin-top: 8vw; + border-radius: 25px; + line-height: 10vw; + color: white; + font-weight: bold; + font-size: 3em; + text-align: center; + padding-right: 0.4vw; + padding-left: 0.4vw; + padding-top: 0.4vw; + + list-style: none; + display: flex; + + -webkit-flex-flow: row wrap; + justify-content: space-around; + } + + .item-form { + width: 6vw; + padding-left: 0.8vw; + margin-top: 0.9vw; + height: 7.5vw; + border-radius: 10px; + background-color: var(--lighttercia); + } + + .buttonretour{ + position: absolute; + height: 6vw; + width: 6vw; + left: 63vw; + top: 99vw; + border-radius: 55vw; + background-color: var(--lightsedonca); + + } + + .txt{ + position: absolute; + font-family: Arial Black; + color: var(--lightprima); + font-size: 5vw; + padding-left: 1vw; + top : -2.9vw; + } -.cviolet >div{ - background-color: purple; } -#cercle { - width: 20px; - height: 20px; - border-radius: 10px; - margin: auto; - margin-top: 25%; + +/*Grande version*/ +@media only screen and (min-width: 1280px) { + + .logop2 img { + position: absolute; + width: 12vw; + left: 44vw; + top: 22vw; + z-index: 30; + } + + .logo img{ + position: absolute; + width: 12vw; + left: 44vw; + top: 13%; + z-index: 11; + } + + .mounts img { + position: absolute; + height: 100%; + width: 100%; + pointer-events: none; + margin-left: -10px; + } + + #contourbuttonvalider{ + position: absolute; + border-radius: 45px; + left: 9.2vw; + top: 5.5vw; + height: 4vw; + width: 12vw; + background-color: var(--lightsedonca); + z-index: 15; + } + + .bouttonvalider{ + position: absolute; + height: 3.4vw; + width: 11.4vw; + top: 0.3vw; + left: 0.3vw; + border-radius: 30px; + background-color: #B130DE; + } + + #textjouer{ + font-family: Montserrat, impact, Arial Black; + position: absolute; + font-size: 2.5vw; + margin-top: 0.2vw; + margin-left: 2.7vw; + color: var(--lightsedonca); + } + + #ContainBottom { + position: absolute; + margin-left: 25vw; + height: 12vw; + width: auto; + bottom: 0; + z-index: 20; + } + + #clic{ + position: absolute; + left: 55vw; + top : 7vw; + height: auto; + width: 15vw; + } + + #card-conteneur{ + z-index: 20; + position: absolute; + left: 0vw; + } + + .flex-container { + padding: 0; + margin: 0; + list-style: none; + + display: -webkit-box; + display: -moz-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + + -webkit-flex-flow: row wrap; + justify-content: space-around; + margin-top: -7vw; + } + + .flex-item { + background: var(--lightsedonca); + width: 14vw; + height: 19vw; + margin-top: 8vw; + border-radius: 25px; + line-height: 10vw; + color: white; + font-weight: bold; + font-size: 3em; + text-align: center; + padding-right: 0.4vw; + padding-left: 0.4vw; + padding-top: 0.4vw; + padding-top: 0.4vw; + + list-style: none; + display: flex; + + -webkit-flex-flow: row wrap; + justify-content: space-around; + } + + .item-form { + width: 3vw; + padding-left: 0.8vw; + margin-top: 0.55vw; + height: 3.5vw; + border-radius: 10px; + background-color: var(--lighttercia); + } + + + + .buttonretour{ + position: absolute; + height: 3vw; + width: 3vw; + left: 57vw; + top: 22.6vw; + border-radius: 25px; + background-color: var(--lightsedonca); + + } + + .txt{ + position: absolute; + font-family: Arial Black; + color: var(--lightprima); + font-size: 2vw; + padding-left: 0.7vw; + top : -0.9vw; + } + } -#bague { - width: 30px; - height: 30px; - border-radius: 15px; - margin: auto; - position: relative; - margin-top: 13%; + +#pageGame{ + visibility: hidden; +} + +#pageAccueil{ + visibility: visible; +} + + +#cloud{ + z-index: 10 +} + +#mount1 { + z-index: 11; +} + +#mount2 { + z-index: 10; +} + + + +/* PARTIE ANNEAU / ROND */ +.anneau{ + background-color: #DE3030; + border-radius: 3vw; + height: 5vw; + width: 5vw; + display: table-cell; + vertical-align: middle; +} + +.rondinterieur{ + background-color: var(--lightsedonca); + height: 3vw; + width: 3vw; + display: table; + margin: 0 auto; + border-radius: 3vw; +} + +.containform{ + border-radius: 3vw; + height: 5vw; + width: 5vw; + display: table-cell; + vertical-align: middle; +} + +.rond{ + display: table; + margin: 0 auto; + background-color: #DE3030; + height: 3vw; + width: 3vw; + border-radius: 3vw; +} + +/* PARTIE CARRE */ +.carre{ + background-color: #30C0DE; + height: 5vw; + width: 5vw; + display: table-cell; + vertical-align: middle +} + +.carreinterieur{ + background-color: var(--lightsedonca); + height: 3vw; + width: 3vw; + display: table; + margin: 0 auto; +} + +.pcarre{ + display: table; + margin: 0 auto; + background-color: #30C0DE; + height: 3vw; + width: 3vw; } -#bague-inté { - width: 20px; - height: 20px; - border-radius: 10px; - background-color: #bbada0; +/* PARTIE TRIANGLE */ +.triangle{ + border-left: 2.5vw solid transparent; + border-right: 2.5vw solid transparent; + border-bottom: 5vw solid #DEA430; + display: table-cell; + vertical-align: middle +} + +.trianglerinterieur{ position: absolute; - margin: auto; - top : 17%; - left: 17%; + left: 21.1vw; + bottom: 7.75vw; + border-left: 1.5vw solid transparent; + border-right: 1.5vw solid transparent; + border-bottom: 3vw solid var(--lightsedonca); } -.container { - width: 200px; +.ptriangle{ + display: table; margin: 0 auto; + border-left: 1.5vw solid transparent; + border-right: 1.5vw solid transparent; + border-bottom: 3vw solid #DEA430; +} + +/* PARTIE PENTA*/ +.pentagone{ + position: absolute; + width: 3vw; + box-sizing: content-box; + border-width: 3.15vw 1.2vw 0; + border-style: solid; + border-color: #6FDE30 transparent; +} +.pentagone:before{ + content: ""; + position: absolute; + top: -5.3vw; + left: -1.15vw; + border-width: 0 2.68vw 2.2vw; + border-style: solid; + border-color: transparent transparent #6FDE30; +} + +.pentagoneinterieur{ + position: absolute; + width: 1.5vw; + box-sizing: content-box; + top: -2.75vw; + left: 0.25vw; + border-width: 1.5vw 0.5vw 0; + border-style: solid; + border-color: var(--lightsedonca) transparent; } -.game-container { - margin-top: 40px; +.pentagoneinterieur:before{ + content: ""; + position: absolute; + top: -2.4vw; + left: -0.486vw; + border-width: 0 1.3vw 1vw; + border-style: solid; + border-color: transparent transparent var(--lightsedonca); +} + +.ppentagone{ position: relative; - padding: 15px; - cursor: default; - -moz-user-select:none; - background: #bbada0; - border-radius: 15px; - width: 160px; - height: 225px; - box-sizing: border-box; + width: 1.5vw; + box-sizing: content-box; + top: 1vw; + left: 1vw; + border-width: 1.5vw 0.5vw 0; + border-style: solid; + border-color: #6FDE30 transparent; +} + +.ppentagone:before{ + content: ""; + position: absolute; + top: -2.45vw; + left: -0.5vw; + border-width: 0 1.3vw 1vw; + border-style: solid; + border-color: transparent transparent #6FDE30; } -.grid-container { +/* PARTIE LOSANGE */ +.losange { + width : 0; + height : 0; + border : 1.5vw solid transparent; + border-bottom : 2.25vw solid #B130DE; + position : relative; + top : -1.5vw; +} +.losange:after { + content : ''; + position : absolute; + left : -1.53vw; + top : 2.2vw; + border : 1.5vw solid transparent; + border-top : 2.25vw solid #B130DE; +} + +.losangeinterieur { + width : 0; + height : 0; + border : 0.75vw solid transparent; + border-bottom : 1.125vw solid var(--lightsedonca); + position : relative; + top : 0.45vw; + left: -0.74vw; + z-index: 2; +} +.losangeinterieur:after { + content : ''; + position : absolute; + left : -0.75vw; + top : 1.1vw; + border : 0.75vw solid transparent; + border-top : 1.125vw solid var(--lightsedonca); + z-index: 2; +} + +.plosange { + width : 0; + height : 0; + border : 0.75vw solid transparent; + border-bottom : 1.125vw solid #B130DE; + position : relative; + top : -0.5vw; + left: -0.74vw; + z-index: 2; +} +.plosange:after { + content : ''; + position : absolute; + left : -0.75vw; + top : 1.1vw; + border : 0.75vw solid transparent; + border-top : 1.125vw solid #B130DE; + z-index: 2; +} + +.retourstp{ position: absolute; - z-index: 1; } -.grid-row { - margin-bottom: 15px; + +/* J'ai trop avancé, mode multi*/ + + +#containpseudo{ + position: absolute; + height: 15%; + width: 30%; + z-index: 12; + left: 35%; + top: 30%; } -.grid-cell { - width: 40px; - height: 40px; - margin-right: 5px; - margin-bottom: 12px; - float: left; - border-radius: 15px; - background: rgba(238, 228, 218, 0.35); +#pseudoenter{ + background-color: red; + height: 100%; + border-radius: 45px; + background-color: #B130DE; } +#inputpseudo{ + position: absolute; + width: 99%; + height: 65%; + border-radius: 30px; + font-size: 3vw; + background-color: transparent; + appearance: none; + text-align: center; + color: #707070; + border-color: transparent; + font-family: impact, Arial Black; + z-index: 11; +} + +#fondinput{ + background-color: red; + position: absolute; + width: 97%; + background-color: var(--lightsedonca); + height: 90%; + border-radius: 40px; + left: 1.5%; + top: 5%; + z-index: 10; +} + +#buttonadd{ + position: absolute; + top: 30%; + right: -12%; + height: 3vw; + width: 3vw; + border-radius: 2vw; + background-color: #B130DE; + z-index: 18; +} + +#textplus{ + font-size: 3vw; + font-family: arial, Arial Black; + position: absolute; + margin-top: -0.15vw; + margin-left: 0.65vw; + color: var(--lightprima); +} + +#containplayers{ + position: absolute; + background-color: transparent; + color: var(--lightsedonca); + width: 15vw; + height: 20vw; + z-index: 17; + right: 0%; + top: 8vw; +} + +.pseudojoueur { + float: right; + margin-top: 0px; + margin-bottom: 3%; + margin-right: 10%; + font-family: Lucida Console, Arial Black, Arial; + font-size: 2vw; +} + +#pseudolist { + width: 100%; + height: 1.7vw; +} + + + + + + + + + + + + + + + + + + + + diff --git a/src/imgs/clicjour.png b/src/imgs/clicjour.png new file mode 100644 index 0000000..bfe5bdb Binary files /dev/null and b/src/imgs/clicjour.png differ diff --git a/src/imgs/clicnuit.png b/src/imgs/clicnuit.png new file mode 100644 index 0000000..ddab3c8 Binary files /dev/null and b/src/imgs/clicnuit.png differ diff --git a/src/imgs/darkcloud.png b/src/imgs/darkcloud.png new file mode 100644 index 0000000..1180ae6 Binary files /dev/null and b/src/imgs/darkcloud.png differ diff --git a/src/imgs/darkmount1.png b/src/imgs/darkmount1.png new file mode 100644 index 0000000..9db0759 Binary files /dev/null and b/src/imgs/darkmount1.png differ diff --git a/src/imgs/darkmount2.png b/src/imgs/darkmount2.png new file mode 100644 index 0000000..a50ab6d Binary files /dev/null and b/src/imgs/darkmount2.png differ diff --git a/src/imgs/lightcloud.png b/src/imgs/lightcloud.png new file mode 100644 index 0000000..7fffe28 Binary files /dev/null and b/src/imgs/lightcloud.png differ diff --git a/src/imgs/mount1.png b/src/imgs/mount1.png new file mode 100644 index 0000000..01b4e6e Binary files /dev/null and b/src/imgs/mount1.png differ diff --git a/src/imgs/mount2.png b/src/imgs/mount2.png new file mode 100644 index 0000000..99db5d6 Binary files /dev/null and b/src/imgs/mount2.png differ diff --git a/src/imgs/swishjour.png b/src/imgs/swishjour.png new file mode 100644 index 0000000..bd18f11 Binary files /dev/null and b/src/imgs/swishjour.png differ diff --git a/src/imgs/swishnuit.png b/src/imgs/swishnuit.png new file mode 100644 index 0000000..df07fe2 Binary files /dev/null and b/src/imgs/swishnuit.png differ diff --git a/src/index.html b/src/index.html index 731f1a0..3378ebb 100644 --- a/src/index.html +++ b/src/index.html @@ -1,396 +1,307 @@ - 666 + SwishGame - -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
+ + + +
+ -
-
-
-
-
-
-
- -
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- + + -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
+ +
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
+ --> + +
+ +
+
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
+ + +
+
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
+ + +
+
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
+ + +
+
+
-
-
-
-
+
+ +
+
+
+ + +
+
+
+ +
+
+
+ + +
+ +
+ + + + +
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
+ + +
+
+ + + +
+ + +
+

X

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ diff --git a/src/js/main.js b/src/js/main.js index 1302f24..04ac4e0 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -1,176 +1,74 @@ -//1 = rond -//-1 = anneau - -var carte = [//violet - "000010020000", - "000010010000", - //verte - "010000000020", - "020000000010", - //orange - "000201000000", - "000201000000", - "000002100000", - "000002100000", - "000002001000", - "000002001000", - //bleu - "200000000100", - "200000000100", - "100000000002", - "100000000002", - "201000000000", - "201000000000", - //vert orange - "000001000020", - "010000002000", - "010002000000", - "010002000000", - "020001000000", - "020001000000", - //bleu violet - "002000010000", - "000020000100", - "000000010200", - "000000010200", - "000000020100", - "000000020100", - //bleu vert - "000000000210", - "000000000021", - "001000000020", - "001000000020", - "002000000010", - "002000000010", - //violet orange - "000010002000", - "000100020000", - "000000012000", - "000000012000", - "000000120000", - "000000120000", - //violet vert - "010000020000", - "010000020000", - "020010000000", - "020010000000", - "010020000000", - "010020000000", - "000010000020", - "000010000020", - //orange bleu - "002000001000", - "002000001000", - "000200000100", - "000200000100", - "200001000000", - "200001000000", - "001200000000", - "001200000000", - "001002000000", - "002001000000", - "000200000001", - "000100000002"]; - -var carteselect = 0; -var cartesAffiches = []; -var cartesSelect = []; - -//fonction au lancement -window.onload = function() { - //partie tirage au sort - for(var i=1; i<=12;i++){ - var ale = Math.floor(Math.random() * Math.floor(60)); - ale = ale +1; - var nomcarte = carte+i; - var macarte = carte[ale-1]; - cartesAffiches.push(macarte); - generationcarte("card"+i,macarte); - } -}; - -function generationcarte (cartenum, nbcarte) { - for(var i=0; i<12; i++) { - if(nbcarte[i] == 1 || nbcarte[i] == 2) - { - if(nbcarte[i] == 1){ - var p = document.getElementById(cartenum+" num"+ (i+1)); - var e=document.createElement("div"); - e.setAttribute("id","cercle"); - p.appendChild(e); - } - if(nbcarte[i] == 2){ - var p = document.getElementById(cartenum+" num"+ (i+1)); - var e=document.createElement("div"); - var f=document.createElement("div"); - e.setAttribute("id","bague"); - f.setAttribute("id","bague-inté") - e.appendChild(f); - p.appendChild(e); - } - } - } +var mode = 1; +var nbplayers = 1; +var lightprima = "#DEDEDE"; +var lightsedonca = "#B7B7B7"; +var lighttercia = "#E6E6E6"; + +var darkprima = "#474747"; +var darkseconda = "#393939"; +var darktercia = "#606060"; + +function journuit(){ + //mode jour + if(mode%2 == 0){ + //changer logo swish + document.getElementById("imglogo").src = "imgs/swishjour.png"; + document.getElementById("imglogo2").src = "imgs/swishjour.png"; + /*//bouttonjouer + document.getElementById("fondinput").style.backgroundColor = lightsedonca; + document.getElementById("contourbuttonvalider").style.backgroundColor = lightsedonca; + document.getElementById("textjouer").style.color = lightsedonca; + document.getElementById("textplus").style.color = lightprima;*/ + //changer montagnesfond + document.getElementById("mount1").src = "imgs/mount1.png"; + document.getElementById("mount2").src = "imgs/mount2.png"; + //nuages + document.getElementById("cloud").src = "imgs/lightcloud.png"; + document.getElementById("clic").src = "imgs/clicjour.png"; + //changer background color + //document.getElementById("containplayers").style.color = lightsedonca; + //maj couleur principales + document.documentElement.style.setProperty('--lightprima',lightprima); + document.documentElement.style.setProperty('--lightsedonca',lightsedonca); + document.documentElement.style.setProperty('--lighttercia',lighttercia); + } + //mode nuit + else { + //changer logo swish + document.getElementById("imglogo").src = "imgs/swishnuit.png"; + document.getElementById("imglogo2").src = "imgs/swishnuit.png"; + /*//bouttonjouer + document.getElementById("fondinput").style.backgroundColor = darkseconda; + document.getElementById("contourbuttonvalider").style.backgroundColor = darkseconda; + document.getElementById("textjouer").style.color = darkseconda; + document.getElementById("textplus").style.color = darkprima;*/ + //changer montagnesfond + document.getElementById("mount1").src = "imgs/darkmount1.png"; + document.getElementById("mount2").src = "imgs/darkmount2.png"; + //nuages + document.getElementById("cloud").src = "imgs/darkcloud.png"; + document.getElementById("clic").src = "imgs/clicnuit.png"; + //mode nuit + //document.getElementById("containplayers").style.color = darkseconda; + //maj couleur principales + document.documentElement.style.setProperty('--lightprima',darkprima); + document.documentElement.style.setProperty('--lightsedonca',darkseconda); + document.documentElement.style.setProperty('--lighttercia',darktercia); + } + mode=mode+1; } -function ajoutercarte(carte) { - var lacarte = document.getElementById(carte); - if(lacarte.style.backgroundColor == "red") - { - lacarte.style.backgroundColor = "#bbada0"; - carteselect = carteselect-1; - //suppression dans les cartes select - var pos = cartesSelect.indexOf(carte); - cartesSelect.splice(pos,1); - } - else { - if(carteselect == 5) - alert("non"); - else { - lacarte.style.backgroundColor = "red"; - carteselect = carteselect +1; - //ajout dans les cartes select - cartesSelect.push(carte); - } - } +function lancerpartie(){ + document.getElementById("pageAccueil").style.visibility = "hidden"; + document.getElementById("pageGame").style.visibility = "visible"; } -function verification(carte1, carte2){ - var carte2_1 = carte2[2]+carte2[1]+carte2[0]+carte2[5]+carte2[4]+carte2[3]+carte2[8]+carte2[7]+carte2[6]+carte2[11]+carte2[10]+carte2[9]; - var carte2_2 = carte2[9]+carte2[10]+carte2[11]+carte2[6]+carte2[7]+carte2[8]+carte2[3]+carte2[4]+carte2[5]+carte2[0]+carte2[1]+carte2[2]; - var carte2_3 = carte2[11]+carte2[10]+carte2[9]+carte2[8]+carte2[7]+carte2[6]+carte2[5]+carte2[4]+carte2[3]+carte2[2]+carte2[1]+carte2[0]; +function retour(){ + document.getElementById("pageAccueil").style.visibility = "visible"; + document.getElementById("pageGame").style.visibility = "hidden"; } -/* -=== POSSIBILITE === - -123 | 321 -456 | 654 -789 | 987 -ABC | CBA ---------- -ABC | CBA -789 | 987 -456 | 654 -123 | 321 - -=== DEROULEMENT ALGO === - -3cartes et + ->Comparer carte1 et carte2 -==> poser une carte 1 sans la toucher -==> Superposer la carte2 et essayer les 4 cas -*** SI BON - Ajouter la carte3+ et la superposer dans tt les cas - ==> Vérifier qu'il y ait que des 3 || 0 -*** SI PAS BON - Stoper le jeu -*/ - - - - - @@ -179,7 +77,41 @@ ABC | CBA +/* +Je n'avais rien à faire, je me suis amusé à faire l'ajout des joueurs +function addplayer(){ + //j'ai mis une limite de 6joueurs, mais c'est à voir + if(nbplayers < 7){ + //création de la div contenant le pseudo + var divpseudo = document.createElement('div'); + divpseudo.id = 'pseudolist'; + //reprise du pseudo entré par le joueur + var pseudo = document.getElementById("inputpseudo").value; + //vérification si pseudo vide pour lui donner un pseudo du style "Joueur3" + if(pseudo == "") + { + pseudo = "Joueur " + nbplayers; + } + //création du text-pseudo + var tag = document.createElement("p"); + tag.className = "pseudojoueur"; + var text = document.createTextNode(pseudo); + tag.appendChild(text); + //mise du text dans la division + divpseudo.appendChild(tag); + //insertion pseudo dans liste + document.getElementById("containplayers").appendChild(divpseudo); + //remise input vide ;) + document.getElementById("inputpseudo").value = ""; + nbplayers = nbplayers +1; + } +} +function ajouterplayer(event){ + if(event.keyCode == 13) + addplayer(); +} +*/