diff --git a/SwichGIT/src/ActualiserIDPartie.php b/SwichGIT/src/ActualiserIDPartie.php new file mode 100644 index 0000000..c28f63f --- /dev/null +++ b/SwichGIT/src/ActualiserIDPartie.php @@ -0,0 +1,27 @@ +Identifiant partie : "; +echo ""; +echo " "; + + +$db=new MyDB(); +$afficher = $db->query('SELECT * FROM partieCartes where IdPartie="'.$idparte.'" '); +$tableau =[]; +while ($row = $afficher->fetchArray()) { + $un=$row['colUn']; + $deux=$row['colDeux']; + $trois=$row['colTrois']; + $tout=$un.','.$deux.','.$trois; + // $entier=$entier+1; + array_push($tableau,$tout); +} + +foreach ($tableau as $val) { + //echo "

$val d

"; +} +$comma_separated = implode(",", $tableau); +$_SESSION['listecartebdd']=$comma_separated; \ No newline at end of file diff --git a/SwichGIT/src/ConnexionBDD.php b/SwichGIT/src/ConnexionBDD.php new file mode 100644 index 0000000..c6b7ff2 --- /dev/null +++ b/SwichGIT/src/ConnexionBDD.php @@ -0,0 +1,24 @@ +open('mysqlitedb.db'); + //$this->exec('CREATE TABLE partieScore(IdPartie STRING PRIMARY KEY,scorePremierJ STRING,scoreDeuxiemeJ STRING, pseudoPremierJ STRING,pseudoDeuxiemeJ STRING)'); + //$this->exec('CREATE TABLE partieCartes(IdPartie STRING ,IdCarte STRING,colUn STRING, colDeux STRING, colTrois STRING)'); + + } +} + +function genererChaineAleatoire($longueur = 10) +{ + $caracteres = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + $longueurMax = strlen($caracteres); + $chaineAleatoire = ''; + for ($i = 0; $i < $longueur; $i++) + { + $chaineAleatoire .= $caracteres[rand(0, $longueurMax - 1)]; + } + return $chaineAleatoire; +} + diff --git a/SwichGIT/src/SupprimerEtCreerPartie.php b/SwichGIT/src/SupprimerEtCreerPartie.php new file mode 100644 index 0000000..a17c8fe --- /dev/null +++ b/SwichGIT/src/SupprimerEtCreerPartie.php @@ -0,0 +1,21 @@ +query($requete); + +$newid=genererChaineAleatoire(10); +$_SESSION['idpartie']=$newid; +$db->query('INSERT INTO partieScore(IdPartie) VALUES("'.$newid.'")'); + +$requete2 ="DELETE FROM partieCartes where IdPartie='".$id."'"; +$suppression2 = $db->query($requete2); + +for ($i = 1; $i <= 16; $i++) { + $db->query('INSERT INTO partieCartes(IdPartie,IdCarte) VALUES("'.$newid.'","'.$i.'")'); +} + + diff --git a/SwichGIT/src/ajouterScore.php b/SwichGIT/src/ajouterScore.php new file mode 100644 index 0000000..1961947 --- /dev/null +++ b/SwichGIT/src/ajouterScore.php @@ -0,0 +1,13 @@ +query($requete); +if (isset($resultat)) echo "1\n"; diff --git a/SwichGIT/src/cleanBase.php b/SwichGIT/src/cleanBase.php new file mode 100644 index 0000000..46b6a29 --- /dev/null +++ b/SwichGIT/src/cleanBase.php @@ -0,0 +1,5 @@ +query('DELETE FROM partieCartes'); +$update = $db->query('DELETE FROM partieScore'); \ No newline at end of file diff --git a/SwichGIT/src/css/PageDaccueil.css b/SwichGIT/src/css/PageDaccueil.css new file mode 100644 index 0000000..244a910 --- /dev/null +++ b/SwichGIT/src/css/PageDaccueil.css @@ -0,0 +1,536 @@ +#pageAccueil { + visibility: visible; +} + +#cloud { + z-index: 10 +} + +#mount1 { + z-index: 11; + position: absolute; +} + +#mount2 { + z-index: 10; +} + +.containerparam{ + position: absolute; + display: flex; + margin-left: 1vw; +} + +.containerparam > div { + margin-right: 4vh; +} + +/*SETTINGS*/ +#forme{ + visibility: hidden; +} + +#couleurs{ + z-index: 1; +} + +.pannel{ + height: 100px; + width: 100px; + background-color: red; +} + +#pickrcontner{ + position: relative; + display: flex; + flex-wrap: wrap; + justify-content: space-around; +} + +.Mode_Setting{ + height: 20vw; + position: relative; + margin : 0 auto; +} +#BottomSetings{ + position: absolute; + left: 0; + bottom: 0; + height: 5vw; + width: 100%; + border-radius: 0 0 0.3vw 0.3vw; +} + +#SettingBefore{ + height: 5vw; + width: 5vw; + background-color: var(--lightsedonca); + color: black; + font-size: 3vw; + visibility: collapse; +} +#SettingAfter{ + bottom: 5vw; + position: relative; + height: 5vw; + width: 5vw; + background-color: var(--lightsedonca); + float: right; +} + +#testSettings{ + position: absolute; + color: black; + bottom: 0; + left: 18vw; +} + + +#ShapeSettings{ + height: 100%; + width: 100%; + margin: auto 2vw; + display: flex; + flex-wrap: wrap; +} +.ShapeContener{ + height: 9vw; + width: 9vw; + margin-left: 1vw; + position: relative; + display: table-cell; + vertical-align: middle; +} +.settingShape{ + background-color: #333; +} + +.Colorone{background-color: var(--colorbase);} +.Colortwo{background-color: var(--colorcarre);} +.Colorthree{background-color: var(--colorone);} +.Colorfour{background-color: var(--colortwo);} +.Colorfive{background-color: var(--colorthree);} + + + +/*Bouton info*/ +#infosec{ + z-index:15; + width: 2vw; + margin: 0 auto; +} + +#info { + color: var(--lightprima); + text-decoration: none; + font-size: 45px; +} + +#info:hover { + color: var(--lightprima); +} + +.activity { + padding: 0; + list-style: none; +} + +li { + -webkit-transition: box-shadow 0.2s ease; + -moz-transition: box-shadow 0.2s ease; + transition: box-shadow 0.2s ease; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + border-radius: 50%; + color: #B7B7B7; + display: inline-block; + font-size: 0.889em; + height: 3em; + position: relative; + text-align: center; + text-transform: lowercase; + width: 3em; + line-height: 3em; +} + + li a { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + } + + li:hover { + box-shadow: 0 0 0 7px var(--lightsedonca); + font-size:99%; + position:relative; + right:5%; + } + + li:before { + border-radius: 50%; + bottom: 0; + box-shadow: 0 0 0 4px var(--lightsedonca); + content: ''; + left: 0; + position: absolute; + right: 0; + top: 0; + background-color: var(--lightsedonca); + } + +/*Les r�gles popups*/ +.overlay { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: rgba(0, 0, 0, 0.7); + transition: opacity 500ms; + visibility: hidden; + opacity: 0; + z-index: 210; +} + + .overlay:target { + visibility: visible; + opacity: 1; + } + +.popup { + margin: 70px auto; + padding: 20px; + background: #fff; + border-radius: 5px; + width: 30%; + position: relative; + top:25%; +} + + .popup h2 { + margin-top: 0; + color: #333; + font-family: Tahoma, Arial, sans-serif; + } + + .popup .close { + position: absolute; + top: 20px; + right: 30px; + transition: all 200ms; + font-size: 30px; + font-weight: bold; + text-decoration: none; + color: #333; + } + + .popup .close:hover { + color: #06D85F; + } + + .popup .content { + max-height: 30%; + overflow: auto; + } + + /*Parametres*/ + +.popup2 { + margin: 70px auto; + padding: 20px; + background: #fff; + border-radius: 5px; + width: 45%; + height: 65%; + position: relative; + top:10%; +} + +.popup2 h2 { + margin-top: 0; + color: #333; + font-family: Tahoma, Arial, sans-serif; +} +h3 { + margin: 0; + color: #333; + font-family: Tahoma, Arial, sans-serif; +} +.popup2 .close { + position: absolute; + top: 20px; + right: 30px; + transition: all 200ms; + font-size: 30px; + font-weight: bold; + text-decoration: none; + color: #333; +} + .popup2 .close:hover { + color: #06D85F; + } +.popup2 .content { + max-height: 30%; +} + +.titre{ + display: ruby-base; +} + +label { + cursor: pointer; + text-indent: -9999px; + width: 2vw; + height: 1vw; + background: grey; + display: block; + border-radius: 100px; + position: relative; +} + +label:after { + content: ''; + position: absolute; + top: 0.1vw; + left: 0.1vw; + width: 0.8vw; + height: 0.8vw; + background: #fff; + border-radius: 90px; + transition: 0.3s; +} + +input:checked + label { + background: #bada55; +} + +input:checked + label:after { + left: calc(100% - 0.1vw); + transform: translateX(-100%); +} + +label:active:after { + width: 1.4vw; +} +/* J'ai trop avanc�, mode multi*/ + + +#containpseudo { + position: absolute; + height: 15%; + width: 30%; + z-index: 12; + left: 35%; + top: 30%; +} + +.bouttonvalider:hover { + box-shadow: 0 0 0 8px var(--lightsedonca); + font-size: 100%; + position: relative; + transition: box-shadow 0.2s ease; +} + +#bouttonvalider:hover { + box-shadow: 0 0 0 5px var(--lightsedonca); + position: relative; +} + +#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; + -moz-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; +} + + + +#modeprec{ + height: 100%; + width: 15%; + float: left; + position: relative; +} + +#modesuiv{ + height: 100%; + width: 15%; + float: right; + position: relative; +} + +#textdumode{ + height: 100%; + width: 70%; + position: absolute; + left: 15%; +} + + + + + +#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; +} + +/* === FORMES === */ + +.contentButton{ + height: 3vw; + width: 15%; + margin : 0 auto; + position: relative; + bottom: 5vw; +} + +.buttonvalidersettings{ + height: 100%; + width: 100%; + border-style: none; + background-color: red; + color: white; + font-family: arial; + font-size: 2vw; + border-radius: 15px; +} + +.buttonvalidersettings:active{ + background-color: blue; +} +/* LANGUES */ + + +#cf2 img { + position:absolute; + left:0; + cursor: pointer; + -webkit-transition: opacity 0.2s ease-in-out; + -moz-transition: opacity 0.2s ease-in-out; + -o-transition: opacity 0.2s ease-in-out; + transition: opacity 0.2s ease-in-out; +} + +#cf2 img.transparent { +opacity:0; +} +#cf_onclick { +cursor:pointer; +} + +#table_HS_Match { + visibility: visible; +} + +#table_HS_Timer { + visibility: hidden; +} + +#HighscorePage { + display: none; +} + +.nominput { + font: 700 3vh "Poppins", sans-serif; + color: #2B2D2F; +} + +#nom { + font-family: inherit; + font-size: 1vw; + color: black; + padding: 0.8vh 0; + background: transparent; + transition: border-color 0.2s; + margin-left: 1.5vw; + text-align: center; +} + +.boutonajouterHS { + font-family: Montserrat, impact, Arial Black; + font-size: 1.5vw; + margin-top: 0.1vw; + color: var(--lightsedonca); + text-align: center; + width: inherit; + background-color: #B130DE; + border-radius: 45px; +} + +#score { + visibility: hidden; +} + +#modeJeu { + visibility: hidden; +} diff --git a/SwichGIT/src/css/PartieGame.css b/SwichGIT/src/css/PartieGame.css new file mode 100644 index 0000000..01657e7 --- /dev/null +++ b/SwichGIT/src/css/PartieGame.css @@ -0,0 +1,111 @@ + +#pageGame { + visibility: hidden; + top: -10vh; + position: relative; +} + +.menuhaut { + height: 10vh; + width: inherit; + display: flex; +} + +/*Partie Menu du haut*/ +.menu{ + align-items: center; + justify-content: center; +} + + +.retourstp { + position: absolute; +} + +#Redistribution{ + position:relative; + top:-3vw; +} + + +#affSolution { + text-align: center; + font-family: Montserrat, impact, Arial Black; + font-size: 2.5vw; + color: var(--lightsedonca); + width: inherit; +} + +#textjouer2 { + position: absolute; + text-align: center; + font-family: Montserrat, impact, Arial Black; + margin-top: 0.6vw; + color: var(--lightsedonca); + width: inherit; + +} + +#btnvalider2 { + position: relative; + text-align: center; + font-family: Montserrat, impact, Arial Black; + font-size: 2.5vw; + margin-top: 0.2vw; + margin-left: 0.2vw; + color: var(--lightsedonca); +} + +#btnvalider3 { + position: relative; + text-align: center; + font-family: Montserrat, impact, Arial Black; + font-size: 2.5vw; + margin-top: 0.2vw; + margin-left: 0.2vw; + color: var(--lightsedonca); +} + +#Redistribution2 { + position: relative; + top:-3vw; + left:68%; +} + +#Redistribution3 { + position: relative; + top:-3vw; + left: 50%; +} + + +.bouttonvalider2:hover { + box-shadow: 0 0 0 8px var(--lightsedonca); + font-size: 100%; + position: relative; + transition: box-shadow 0.2s ease; +} + +#progressbar +{ + position : relative; + width: 1100px; + padding:1px; + background-color:white; + border:1px solid black; + height:10px; + border-radius: 5px; + margin-top: 40px; + margin-right: auto; + margin-left: auto; + +} + +#indicateur +{ + width: 800px; + background-color : green; + height:10px; + margin: 0; + +} \ No newline at end of file diff --git a/SwichGIT/src/css/Resp3.css b/SwichGIT/src/css/Resp3.css new file mode 100644 index 0000000..1bc656a --- /dev/null +++ b/SwichGIT/src/css/Resp3.css @@ -0,0 +1,84 @@ +/*Ecran*/ +@media screen and (min-width: 960px) { + /*ROND*/ + .anneau { + position: relative; + background-color: var(--colorbase); + border-radius: var(--v); + height: var(--v); + width: var(--v); + display: table-cell; + vertical-align: middle; + } + .anneau2 { + position: relative; + background-color: white; + border-radius: var(--v); + height: var(--v); + width: var(--v); + left : calc((var(--u) - var(--v))/2); + display: table-cell; + vertical-align: middle; + } + .anneau3 { + position: relative; + background-color: var(--colorbase); + border-radius: var(--v); + height: var(--v); + width: var(--v); + margin-left: auto; + margin-right: auto; + } + .rondinterieur { + background-color: var(--lighttercia); + height: var(--w); + width: var(--w); + display: table; + margin: 0 auto; + border-radius: var(--w); + } + .rond { + display: table; + margin: 0 auto; + background-color: var(--colorbase); + height: var(--w); + width: var(--w); + border-radius: var(--w); + } + + .rondcache { + display: table; + margin: 0 auto; + background-color: black; + border-radius: var(--y); + } + .rond2 { + display: table; + margin: 0 auto; + background-color: white; + height: var(--w); + width: var(--w); + border-radius: var(--w); + } + .rond3 { + position: relative; + top : calc((var(--v) - var(--w))/ 2); + left : calc((var(--v) - var(--w))/2); + display: table-cell; + vertical-align: middle; + background-color: white; + height: var(--w); + width: var(--w); + border-radius: var(--w); + } + .rond4 { + display: table; + margin: 0 auto; + background-color: var(--colorbase); + height: var(--w); + width: var(--w); + border-radius: var(--w); + } +} + + \ No newline at end of file diff --git a/SwichGIT/src/css/base.css b/SwichGIT/src/css/base.css new file mode 100644 index 0000000..e15eca2 --- /dev/null +++ b/SwichGIT/src/css/base.css @@ -0,0 +1,128 @@ +:root{ + /*couleur héhé*/ + --lightprima: #DEDEDE; + --lightsedonca: #B7B7B7; + --lighttercia: #E6E6E6; + /*Couleur bases*/ + + --colorbase : #e9546f;/*ROND*/ + --colorcarre : #c97fb3;/*CARRE*/ + --colorone : #00a088;/*TRIANGLE*/ + --colortwo : #5880c1;/*CROIX*/ + + --colorseven : #e9546f;/*ROND*/ + --coloreight : #c97fb3;/*CARRE*/ + --colornine : #00a088;/*TRIANGLE*/ + --colorten : #5880c1;/*CROIX*/ + --colorthree : #E6792F;/*LOSANGE*/ + --colorfour : #E6DA27;/*PENTA*/ + --colorfive : #2E6DB4;/*HEXA*/ + --colorsix : #E6792F;/*HOCTO*/ + + /*Tailles cartes*/ + --taille: 10vw; + /*Les formes*/ + --u: calc(var(--x) / 2.75); + --v: calc(var(--y) / 2.75); + --w: calc(var(--z) / 2.75); + /*Les formes settings*/ + --x : 10vw; + --y : 7vw; + --z : 3.75vw; + /*Formes ete*/ + --l: 3vw; + --m: 2.5vw; + --n: 1.5vw; +} + +.test{ + color: black; +} + +a { + cursor: pointer; + z-index: 60; +} + + + + +body { + background-color: var(--lightprima); + height: 100%; + 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; +} + + +#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; +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwichGIT/src/css/desktops.css b/SwichGIT/src/css/desktops.css new file mode 100644 index 0000000..b2c6ded --- /dev/null +++ b/SwichGIT/src/css/desktops.css @@ -0,0 +1,619 @@ +/*Ecran*/ +@media screen and (min-width: 992px) { + + /*PARTIE FORMES*/ + .containform3 { + position: relative; + height: var(--x); + width: var(--x); + display: table-cell; + /*vertical-align: middle;*/ + } + + .containinteCarte{ + top:calc((var(--l) - var(--n)) / 2); + left:calc((var(--l) - var(--n)) / 2); + height: var(--n); + width: var(--n); + z-index: 2; + position: absolute; + } + + .containexteCarte{ + top:calc((var(--l) - var(--m)) / 2); + left:calc((var(--l) - var(--m)) / 2); + height: var(--m); + width: var(--m); + z-index: 1; + position: absolute; + } + + .containform3carte { + position: relative; + height: var(--l); + width: var(--l); + display: table-cell; + /*vertical-align: middle;*/ + } + + .containinte { + /*PROBLEME SIZE*/ + top: calc((var(--y) - var(--z)) / 2); + left: calc((var(--y) - var(--z)) / 2); + height: var(--z); + width: var(--z); + z-index: 2; + position: absolute; + } + + .cache { + top: calc((var(--x) - var(--y)) / 2.8); + left: calc((var(--x) - var(--y)) / 2.2); + height: calc(var(--y)*1.05); + width: calc(var(--y)*1.05); + z-index: 2; + position: absolute; + z-index: 15; + } + + #choosemode { + height: 4vw; + width: 16vw; + position: absolute; + left: 42vw; + top: 44vh; + z-index: 15; + } + + #choosedimension { + height: 4vw; + width: 16vw; + position: absolute; + left: 42vw; + top: 50vh; + z-index: 15; + } + + #conteneurmode { + width: 80%; + height: 2vw; + left: 10%; + top: 25%; + position: absolute; + margin: 0 auto; + background-color: var(--lightsedonca); + border-radius: 5vw; + } + + #triangleprec { + width: 0; + height: 0; + margin: 0.25vw auto 0 auto; + border-top: 0.75vw solid transparent; + border-right: 1.25vw solid grey; + border-bottom: 0.75vw solid transparent; + } + + #trianglesuiv { + width: 0; + height: 0; + margin: 0.25vw auto 0 auto; + border-top: 0.75vw solid transparent; + border-left: 1.25vw solid grey; + border-bottom: 0.75vw solid transparent; + } + + #textmode { + font-family: Lucida Console, Arial Black, Arial; + font-size: 1vw; + color: #707070; + text-align: center; + margin: 5% auto 0 auto; + } + + #textdimension { + font-family: Lucida Console, Arial Black, Arial; + font-size: 1vw; + color: #707070; + text-align: center; + margin: 5% auto 0 auto; + } + + #formSize { + margin: 0 auto; + width: 100%; + height: 3vw; + } + + .slider-container .bar .fill { + display: block; + width: 50%; + height: 100%; + background-color: #6200ee; + } + + .slider-container .slider { + position: relative; + z-index: 2; + -webkit-appearance: none; + width: 100%; + height: 10px; + border-radius: 5px; + outline: none; + background-color: transparent; + } + + .slider.container { + position: relative; + } + + .slider-container .bar { + position: absolute; + z-index: 1; + left: 0; + width: 100%; + height: 10px; + border-radius: 5px; + background-color: #c6aee7; + overflow: hidden; + } + /*Moz*/ + .slider-container .slider::-moz-range-thumb { + -webkit-appearance: none; + width: 1vw; + height: 1vw; + background-color: #6200ee; + border-radius: 1vw; + cursor: pointer; + outline: none; + box-shadow: 0 0 0 0 rgba(98, 0,238, .1); + transition: .3s ease-in-out; + } + + .slider-container .slider::-moz-range-thumb:hover { + box-shadow: 0 0 0 10px rgba(98,0,238,.1); + } + + .slider-container .slider:active::-moz-range-thumb { + box-shadow: 0 0 0 20px rgba(98,0,238,.2); + } + + /*===========================================*/ + + .logoboutton { + font-size: 2vw; + color: var(--lightprima); + margin: 0.25vw; + } + + /*Externe*/ + .bouttonMenuHaut { + height: 4vw; + width: 4vw; + background-color: var(--lightsedonca); + border-radius: 50%; + margin: 0 auto; + margin-top: 0.45vw; + position: relative; + display: block; + } + + #affPoints { + text-align: center; + font-family: Montserrat, impact, Arial Black; + font-size: 2vw; + margin-top: 1.2vw; + color: var(--lightsedonca); + } + + .divmenu { + width: 10vw; + height: inherit; + margin-right: 1vw; + } + + .containButtonForm { + height: 2.5vw; + width: 2.5vw; + margin: 0.75vw; + position: absolute; + } + + .buttonretour { + position: relative; + height: 4vh; + width: 4vh; + border-radius: 55vw; + background-color: var(--lightsedonca); + z-index: 5; + margin-left: 2vw; + top: 1.75vw; + } + + .flex-item { + background: var(--lightsedonca); + width: var(--taille); + border-radius: 0.75vw; + padding-right: 0.15vw; + padding-left: 0.15vw; + padding-bottom: 0.25vw; + list-style: none; + display: flex; + margin-right: 0.4vw; + margin-left: 0.4vw; + margin-bottom: 1vw; + -webkit-flex-flow: row wrap; + justify-content: space-around; + } + + .item-form { + width: 3vw; + padding-left: 0.1vw; + margin-top: 0.25vw; + height: 3vw; + border-radius: 10px; + display: table-cell; + position: relative; + vertical-align: middle; + background-color: var(--lighttercia); + } + + .containcards { + overflow-x: auto; + display: grid; + grid-template-columns: repeat(8,auto); + grid-template-rows: repeat(2,auto); + padding-top: 1vw; + justify-content: center; + } + + .logop2 img { + width: 12vw; + padding-top: 1vh; + position: relative; + } + + + .txt { + position: absolute; + font-family: Arial Black; + color: var(--lightprima); + font-size: 1.5vw; + left: 0.4vw; + top: -1.6vh; + } + + .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; + height: 4vw; + width: 12vw; + top: 1vw; + 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; + } + + .violet { + background-color: #B130DE; + } + + .vert { + background-color: #00CC66; + } + + #textjouerr { + font-family: Montserrat, impact, Arial Black; + position: absolute; + font-size: 2.5vw; + margin-top: 0.2vw; + color: var(--lightsedonca); + text-align: center; + width: inherit; + } + + #containBottom{ + position: absolute; + bottom: 3vh; + width: auto; + left: 50%; + z-index: 20; + height: auto; + } + + #containScore { + display: flex; + justify-content: center; + position: relative; + left: -50%; + + } + + .titreScore{ + font: 700 5vh "Poppins", sans-serif; + color: #2B2D2F; + position: relative; + left: -50%; + text-align: center; + } + + .case-score{ + padding: 4px; + position: relative; + z-index: 1; + width: 6vw; + height: 6vw; + margin: 1vw; + cursor: default; + transition: all 0.3s ease; + } + + .case-score .score-description { + background-color: var(--lightsedonca); + padding: 10px 15px; + width: calc(100% - 30px); + height: calc(100% - 20px); + transition: inherit; + } + + .case-score .score-position { + font: 700 2vw/1.3 "Poppins", sans-serif; + margin: 0 0 0; + transition: 0.2s ease 150ms; + font-size: 2vw; + font-family:"Poppins", sans-serif; + } + .case-score .score-pseudo, .score-points { + font: 500 12px "Poppins", sans-serif; + margin-top: -0.2em; + font-size: 0.8vw; + } + + .case-score:after { + z-index: 10; + background: #f9f8f7; + color: #333; + width: 180px; + position: absolute; + top: 80%; + opacity: 0; + transition: opacity 0.3s ease 0.3s, top 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s; + height: auto; + font-size: 12px; + line-height: 1.4; + padding: 10px; + margin: 0 0 0 -50px; + border-radius: 6px; + text-align: center; + } + .case-score:hover { + transform: scale(1.12); + z-index: 10; + } + + .case-score:hover .score-description { + background: transparent; + } + .case-score:hover .score-position, + .case-score:hover .score-pseudo, + .case-score:hover .score-points { + -webkit-text-fill-color: #222; + } + .case-score:hover:after { + top: 105%; + opacity: 1; + } + + .first { + background: linear-gradient(to bottom right, #f3f9a6 0%, #cbc634 100%); + } + .first .score-position, + .first .score-pseudo, + .first .score-points { + background: -webkit-linear-gradient(#2B2D2F, #2B2D2F); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + + .second { + background: linear-gradient(to bottom right, #37cfdc 0%, #5a88e5 100%); + } + + .second .score-position, + .second .score-pseudo, + .second .score-points { + background: -webkit-linear-gradient(#2B2D2F, #2B2D2F); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + + .third { + background: linear-gradient(to bottom right, #ff616d 0%, #ffc171 100%); + } + + .third .score-position, + .third .score-pseudo, + .third .score-points { + background: -webkit-linear-gradient(#2B2D2F, #2B2D2F); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + + .nopodium { + background: linear-gradient(to bottom right, #2c3e50 0%, #B7B7B7 90%); + } + + .nopodium .score-position, + .nopodium .score-pseudo, + .nopodium .score-points { + background: -webkit-linear-gradient(#3A3B3C, #3A3B3C ); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + + #infosec2{ + z-index:15; + width: 2vw; + position: relative; + margin: 0 auto; + margin-left: 0px; + } + + + #multiParams{ + height: 5vw; + width: 25vw; + position: absolute; + margin: 0 auto; + top: 58vh; + left: 38.5%; + z-index: 15; + display: none; + } + + #buttonMulti { + border-radius: 45px; + height: 2.5vw; + width: 10.4vw; + top: 1vw; + background-color: var(--lightsedonca); + z-index: 15; + } + + #buttonMulti2 { + border-radius: 45px; + height: 2.5vw; + width: 10.4vw; + background-color: var(--lightsedonca); + z-index: 15; + margin-top: 1vh; + } + + .bouttonvalider2 { + position: relative; + height: 2vw; + width: 10vw; + top: 0.25vw; + left: 0.2vw; + border-radius: 30px; + } + + #textmulticreer { + font-family: Montserrat, impact, Arial Black; + font-size: 1.5vw; + margin-top: 0.1vw; + color: var(--lightsedonca); + text-align: center; + width: inherit; + } + #textmultirejoindre { + font-family: Montserrat, impact, Arial Black; + font-size: 1.5vw; + margin-top: 0.1vw; + color: var(--lightsedonca); + text-align: center; + width: inherit; + } + + #conteneurCreate{ + width: 40%; + height: 2.2vw; + left: 50%; + top: 3%; + position: absolute; + margin: 0 auto; + background-color: var(--lightsedonca); + border-radius: 5vw; + } + + + #conteneurJoin{ + width: 40%; + height: 2.2vw; + left: 50%; + top: 65%; + position: absolute; + margin: 0 auto; + background-color: var(--lightsedonca); + border-radius: 5vw; + } + + .form__field { + font-family: inherit; + width: 70%; + border: 0; + border-bottom: 2px solid #9b9b9b; + outline: 0; + font-size: 1vw; + color: black; + padding: 0.8vh 0; + background: transparent; + transition: border-color 0.2s; + margin-left: 1.5vw; + text-align: center; + } + .form__field::placeholder { + color: gray; + } + .form__field:placeholder-shown ~ .form__label { + font-size: 1.3rem; + cursor: text; + top: 20px; + } + + .form__label { + position: absolute; + top: 0; + display: block; + transition: 0.2s; + font-size: 1rem; + color: black; + } + + .form__field:focus { + padding-bottom: 6px; + font-weight: 700; + border-width: 3px; + border-image: linear-gradient(to right, #11998e, #38ef7d); + border-image-slice: 1; + } + .form__field:focus ~ .form__label { + position: absolute; + top: 0; + display: block; + transition: 0.2s; + font-size: 1rem; + color: #11998e; + font-weight: 700; + } + + + + + +} diff --git a/SwichGIT/src/css/formes.css b/SwichGIT/src/css/formes.css new file mode 100644 index 0000000..f3e4604 --- /dev/null +++ b/SwichGIT/src/css/formes.css @@ -0,0 +1,138 @@ +.containform { + position: relative; + +} + +.ajustementPetiteForme{ + margin-top: 25%; +} + +.ajustementGrandeForme{ + margin-top: 0.2vw; + margin-left: 0.2vw; +} + +.containform2{ + position: relative; + height: var(--x); + width: var(--x); + display: table-cell; + vertical-align: middle; + background-color: black; +} + + +/*ROND*/ +.containexte{ + height: var(--y); + width: var(--y); + margin: 0 auto; + position: relative; + top: calc(var(--x)/8); +} + +#cacherond{ + display: none; +} + + + +.round{ + border-radius: 5vw; +} + +.cb{ + background-color: white; +} + +.cn{ + background-color: black; +} + + + + + +/* UTILISATION FORMES CARTES*/ +.containformCarte{ + position: relative; + height: var(--x); + width: var(--x); + display: table-cell; +} + +.carre{ + -webkit-clip-path: inset(0 0 0 0); + clip-path: inset(0 0 0 0); +} + +.triangle{ + -webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%); + clip-path: polygon(50% 0%, 0% 100%, 100% 100%); +} + +.castriangle{ + margin-top: calc( (var(--y) - var(--z)) / 5); +} + +.caspenta{ + margin-top: calc( (var(--y) - var(--z)) / 10); +} + +.castrianglec{ + margin-top: calc( (var(--m) - var(--n)) / 5); +} + +.caspentac{ + margin-top: calc( (var(--m) - var(--n)) / 10); +} + +.losange{ + -webkit-clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); + clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); +} + +.croix{ + -webkit-clip-path: polygon(20% 0%, 0% 20%, 30% 50%, 0% 80%, 20% 100%, 50% 70%, 80% 100%, 100% 80%, 70% 50%, 100% 20%, 80% 0%, 50% 30%); + clip-path: polygon(20% 0%, 0% 20%, 30% 50%, 0% 80%, 20% 100%, 50% 70%, 80% 100%, 100% 80%, 70% 50%, 100% 20%, 80% 0%, 50% 30%); +} + +.croixinte{ + -webkit-clip-path: polygon(26% 23%, 22% 27%, 45% 50%, 22% 74%, 27% 78%, 50% 55%, 74% 78%, 78% 73%, 55% 50%, 78% 27%, 73% 23%, 50% 46%); + clip-path: polygon(26% 23%, 22% 27%, 45% 50%, 22% 74%, 27% 78%, 50% 55%, 74% 78%, 78% 73%, 55% 50%, 78% 27%, 73% 23%, 50% 46%); + +} + +.penta{ + -webkit-clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); + clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); +} + +.hexa{ + -webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); + clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); +} + +.hocto{ + -webkit-clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%); + clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%); +} + +.rondv2{ + -webkit-clip-path: circle(50% at 50% 50%); + clip-path: circle(50% at 50% 50%); +} + +.rond{ + -webkit-clip-path: circle(50% at 50% 50%); + clip-path: circle(50% at 50% 50%); +} + +.formeinte{ + height: 100%; + width: 100%; +} +.formeexte{ + height: 100%; + width: 100%; +} \ No newline at end of file diff --git a/SwichGIT/src/css/phone.css b/SwichGIT/src/css/phone.css new file mode 100644 index 0000000..a81f295 --- /dev/null +++ b/SwichGIT/src/css/phone.css @@ -0,0 +1,111 @@ +@media screen and (max-width: 990px){ + + .flex-item { + flex-grow: 1; + background: var(--lightsedonca); + width: 14vw; + border-radius: 0.75vw; + padding-right: 0.15vw; + padding-left: 0.15vw; + padding-bottom: 0.25vw; + list-style: none; + display: flex; + margin-right: 0.4vw; + margin-left: 0.4vw; + margin-bottom: 1vw; + -webkit-flex-flow: row wrap; + justify-content: space-around; + } +} + + +@media screen and (max-width: 880px) { + .flex-item { + flex-grow: 1; + background: var(--lightsedonca); + width: 14vw; + border-radius: 0.75vw; + padding-right: 0.15vw; + padding-left: 0.15vw; + padding-bottom: 0.25vw; + list-style: none; + display: flex; + margin-right: 0.4vw; + margin-left: 0.4vw; + margin-bottom: 1vw; + -webkit-flex-flow: row wrap; + justify-content: space-around; + } +} + +@media screen and (max-width: 720px) { + .flex-item { + flex-grow: 1; + background: var(--lightsedonca); + width: 17vw; + border-radius: 0.75vw; + padding-right: 0.15vw; + padding-left: 0.15vw; + padding-bottom: 0.25vw; + list-style: none; + display: flex; + margin-right: 0.4vw; + margin-left: 0.4vw; + margin-bottom: 1vw; + -webkit-flex-flow: row wrap; + justify-content: space-around; + } +} + +@media screen and (max-width: 590px) { + .flex-item { + flex-grow: 1; + background: var(--lightsedonca); + width: 20vw; + border-radius: 0.75vw; + padding-right: 0.15vw; + padding-left: 0.15vw; + padding-bottom: 0.25vw; + list-style: none; + display: flex; + margin-right: 0.4vw; + margin-left: 0.4vw; + margin-bottom: 1vw; + -webkit-flex-flow: row wrap; + justify-content: space-around; + } +} + +@media screen and (max-width: 510px) { + body{ + background-color: red; + } + .flex-item { + flex-grow: 1; + background: var(--lightsedonca); + width: 17vw; + border-radius: 0.75vw; + padding-right: 0.15vw; + padding-left: 0.15vw; + padding-bottom: 0.25vw; + list-style: none; + display: flex; + margin-right: 0.4vw; + margin-left: 0.4vw; + margin-bottom: 1vw; + -webkit-flex-flow: row wrap; + justify-content: space-around; + } + + .item-form { + width: 3vh; + padding-left: 0.1vw; + margin-top: 0.25vw; + height: 3vh; + border-radius: 10px; + display: table-cell; + position: relative; + vertical-align: middle; + background-color: var(--lighttercia); + } +} diff --git a/SwichGIT/src/css/pickr.min.css b/SwichGIT/src/css/pickr.min.css new file mode 100644 index 0000000..5470ec2 --- /dev/null +++ b/SwichGIT/src/css/pickr.min.css @@ -0,0 +1,2041 @@ +/*DESKTOP*/ +@media screen and (min-width: 992px) { + /*! Pickr 1.0.1 MIT | https://github.com/Simonwep/pickr */ + .pickr{ + position:relative; + overflow:visible; + transform:translateY(0); + + } + .pickr *{ + box-sizing:border-box + } + .pickr .pcr-button{ + position:relative; + height:var(--y); + width: var(--y); + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s; + } + .pickr .pcr-button:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr .pcr-button:after,.pickr .pcr-button:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + } + .pickr .pcr-button:after{ + transition:background .3s; + background:currentColor + } + .pickr .pcr-button.clear{ + background-size:70% + } + .pickr .pcr-button.clear:before{ + opacity:0 + } + .pickr .pcr-button.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr .pcr-button.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr button,.pickr input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr button:focus,.pickr input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + /*! Pickr2 1.0.1 MIT | https://github.com/Simonwep/pickr2 */ + .pickr2{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + + } + .pickr2 *{ + box-sizing:border-box + } + .pickr2 .pcr-button2{ + position:relative; + height:7vw; + width:7vw; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr2 .pcr-button2:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr2 .pcr-button2:after,.pickr2 .pcr-button2:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr2 .pcr-button2:after{ + transition:background .3s; + background:currentColor + } + .pickr2 .pcr-button2.clear{ + background-size:70% + } + .pickr2 .pcr-button2.clear:before{ + opacity:0 + } + .pickr2 .pcr-button2.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr2 .pcr-button2.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr2 button,.pickr2 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr2 button:focus,.pickr2 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + /*! Pickr3 1.0.1 MIT | https://github.com/Simonwep/pickr3 */ + .pickr3{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + } + .pickr3 *{ + box-sizing:border-box + } + .pickr3 .pcr-button3{ + position:relative; + height:7vw; + width:7vw; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr3 .pcr-button3:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr3 .pcr-button3:after,.pickr3 .pcr-button3:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr3 .pcr-button3:after{ + transition:background .3s; + background:currentColor + } + .pickr3 .pcr-button3.clear{ + background-size:70% + } + .pickr3 .pcr-button3.clear:before{ + opacity:0 + } + .pickr3 .pcr-button3.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr3 .pcr-button3.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr3 button,.pickr3 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr3 button:focus,.pickr3 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + + /*! Pickr4 1.0.1 MIT | https://github.com/Simonwep/pickr4 */ + .pickr4{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + } + .pickr4 *{ + box-sizing:border-box + } + .pickr4 .pcr-button4{ + position:relative; + height:7vw; + width:7vw; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr4 .pcr-button4:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr4 .pcr-button4:after,.pickr4 .pcr-button4:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr4 .pcr-button4:after{ + transition:background .3s; + background:currentColor + } + .pickr4 .pcr-button4.clear{ + background-size:70% + } + .pickr4 .pcr-button4.clear:before{ + opacity:0 + } + .pickr4 .pcr-button4.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr4 .pcr-button4.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr4 button,.pickr4 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr4 button:focus,.pickr4 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + + /*! Pickr5 1.0.1 MIT | https://github.com/Simonwep/pickr5 */ + .pickr5{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + } + .pickr5 *{ + box-sizing:border-box + } + .pickr5 .pcr-button5{ + position:relative; + height:2em; + width:2em; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr5 .pcr-button5:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr5 .pcr-button5:after,.pickr5 .pcr-button5:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr5 .pcr-button5:after{ + transition:background .3s; + background:currentColor + } + .pickr5 .pcr-button5.clear{ + background-size:70% + } + .pickr5 .pcr-button5.clear:before{ + opacity:0 + } + .pickr5 .pcr-button5.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr5 .pcr-button5.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr5 button,.pickr5 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr5 button:focus,.pickr5 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + .pcr-app[data-theme=classic] .pcr-swatches>button{ + position:relative; + width:1.75em; + height:1.75em; + border-radius:.15em; + cursor:pointer; + margin:2.5px; + flex-shrink:0; + justify-self:center; + transition:all .15s; + overflow:hidden; + background:transparent; + z-index:1 + } + .pcr-app[data-theme=classic] .pcr-swatches>button:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + background:url('data:image/svg+xml; utf8, '); + background-size:6px; + border-radius:.15em; + z-index:-1 + } + .pcr-app[data-theme=classic] .pcr-swatches>button:after{ + content:""; + position:absolute; + top:0; + left:0; + width:100%; + height:100%; + background:currentColor; + border:1px solid rgba(0,0,0,.05); + border-radius:.15em; + box-sizing:border-box + } + .pcr-app[data-theme=classic] .pcr-swatches>button:hover{ + filter:brightness(1.05) + } + .pcr-app[data-theme=classic] .pcr-interaction{ + display:flex; + flex-wrap:wrap; + align-items:center; + margin:0 -.2em + } + .pcr-app[data-theme=classic] .pcr-interaction>*{ + margin:0 .2em + } + .pcr-app[data-theme=classic] .pcr-interaction input{ + letter-spacing:.07em; + font-size:.75em; + text-align:center; + cursor:pointer; + color:#75797e; + background:#f1f3f4; + border-radius:.15em; + transition:all .15s; + padding:.45em .5em; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-interaction input:hover{ + filter:brightness(.975) + } + .pcr-app[data-theme=classic] .pcr-interaction input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px rgba(66,133,244,.75) + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-result{ + color:#75797e; + text-align:left; + flex:1 1 8em; + min-width:8em; + transition:all .2s; + border-radius:.15em; + background:#f1f3f4; + cursor:text + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-result::selection{ + background:#4285f4; + color:#fff + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-type.active{ + color:#fff; + background:#4285f4 + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-clear,.pcr-app[data-theme=classic] .pcr-interaction .pcr-save{ + width:auto; + color:#fff + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-clear:hover,.pcr-app[data-theme=classic] .pcr-interaction .pcr-save:hover{ + filter:brightness(.925) + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-save{ + background:#4285f4 + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-clear{ + background:#f44250 + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px rgba(244,66,80,.75) + } + .pcr-app[data-theme=classic] .pcr-selection{ + display:flex; + justify-content:space-between; + flex-grow:1 + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-picker{ + position:absolute; + height:18px; + width:18px; + border:2px solid #fff; + border-radius:100%; + user-select:none + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-preview{ + position:relative; + z-index:1; + width:2em; + display:flex; + flex-direction:column; + justify-content:space-between; + margin-right:.75em + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-preview:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + border-radius:.15em; + z-index:-1 + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-preview .pcr-last-color{ + cursor:pointer; + transition:background-color .3s,box-shadow .3s; + border-radius:.15em .15em 0 0; + z-index:2 + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-preview .pcr-current-color{ + border-radius:0 0 .15em .15em + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-preview .pcr-current-color,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-preview .pcr-last-color{ + background:currentColor; + width:100%; + height:50% + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-chooser,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-opacity,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-palette{ + position:relative; + user-select:none; + display:flex; + flex-direction:column; + cursor:grab; + cursor:-moz-grab; + cursor:-webkit-grab + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-chooser:active,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-opacity:active,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-palette:active{ + cursor:grabbing; + cursor:-moz-grabbing; + cursor:-webkit-grabbing + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-palette{ + width:100%; + height:8em; + z-index:1 + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-palette .pcr-palette{ + flex-grow:1; + border-radius:.15em + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-palette .pcr-palette:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + border-radius:.15em; + z-index:-1 + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-chooser,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-opacity{ + margin-left:.75em + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-chooser .pcr-picker,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-opacity .pcr-picker{ + left:50%; + transform:translateX(-50%) + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-chooser .pcr-slider,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-opacity .pcr-slider{ + width:8px; + flex-grow:1; + border-radius:50em + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-chooser .pcr-slider{ + background:linear-gradient(180deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red) + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-opacity .pcr-slider{ + background:linear-gradient(180deg,transparent,#000),url('data:image/svg+xml; utf8, '); + background-size:100%,50% + } + + + /*! Pickr6 1.0.1 MIT | https://github.com/Simonwep/pickr6 */ + .pickr6{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + } + .pickr6 *{ + box-sizing:border-box + } + .pickr6 .pcr-button6{ + position:relative; + height:7vw; + width:7vw; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr6 .pcr-button6:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr6 .pcr-button6:after,.pickr6 .pcr-button6:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr6 .pcr-button6:after{ + transition:background .3s; + background:currentColor + } + .pickr6 .pcr-button6.clear{ + background-size:70% + } + .pickr6 .pcr-button6.clear:before{ + opacity:0 + } + .pickr6 .pcr-button6.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr6 .pcr-button6.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr6 button,.pickr6 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr6 button:focus,.pickr6 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + + /*! Pickr7 1.0.1 MIT | https://github.com/Simonwep/pickr7 */ + .pickr7{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + } + .pickr7 *{ + box-sizing:border-box + } + .pickr7 .pcr-button7{ + position:relative; + height:7vw; + width:7vw; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr7 .pcr-button7:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr7 .pcr-button7:after,.pickr7 .pcr-button7:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr7 .pcr-button7:after{ + transition:background .3s; + background:currentColor + } + .pickr7 .pcr-button7.clear{ + background-size:70% + } + .pickr7 .pcr-button7.clear:before{ + opacity:0 + } + .pickr7 .pcr-button7.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr7 .pcr-button7.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr7 button,.pickr7 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr7 button:focus,.pickr7 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + + /*! Pickr8 1.0.1 MIT | https://github.com/Simonwep/pickr8 */ + .pickr8{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + } + .pickr8 *{ + box-sizing:border-box + } + .pickr8 .pcr-button8{ + position:relative; + height:7vw; + width:7vw; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr8 .pcr-button8:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr8 .pcr-button8:after,.pickr8 .pcr-button8:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr8 .pcr-button8:after{ + transition:background .3s; + background:currentColor + } + .pickr8 .pcr-button8.clear{ + background-size:70% + } + .pickr8 .pcr-button8.clear:before{ + opacity:0 + } + .pickr8 .pcr-button8.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr8 .pcr-button8.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr8 button,.pickr8 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr8 button:focus,.pickr8 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + +} + +@media screen and (min-width: 0px) and (max-width: 992px) { + /*! Pickr 1.0.1 MIT | https://github.com/Simonwep/pickr */ + .pickr{ + position:relative; + overflow:visible; + transform:translateY(0); + + } + .pickr *{ + box-sizing:border-box + } + .pickr .pcr-button{ + position:relative; + height: calc(1.5*var(--y)); + width: calc(1.5*var(--y)); + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s; + } + .pickr .pcr-button:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr .pcr-button:after,.pickr .pcr-button:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + } + .pickr .pcr-button:after{ + transition:background .3s; + background:currentColor + } + .pickr .pcr-button.clear{ + background-size:70% + } + .pickr .pcr-button.clear:before{ + opacity:0 + } + .pickr .pcr-button.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr .pcr-button.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr button,.pickr input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr button:focus,.pickr input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + /*! Pickr2 1.0.1 MIT | https://github.com/Simonwep/pickr2 */ + .pickr2{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + + } + .pickr2 *{ + box-sizing:border-box + } + .pickr2 .pcr-button2{ + position:relative; + height:7vw; + width:7vw; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr2 .pcr-button2:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr2 .pcr-button2:after,.pickr2 .pcr-button2:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr2 .pcr-button2:after{ + transition:background .3s; + background:currentColor + } + .pickr2 .pcr-button2.clear{ + background-size:70% + } + .pickr2 .pcr-button2.clear:before{ + opacity:0 + } + .pickr2 .pcr-button2.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr2 .pcr-button2.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr2 button,.pickr2 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr2 button:focus,.pickr2 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + /*! Pickr3 1.0.1 MIT | https://github.com/Simonwep/pickr3 */ + .pickr3{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + } + .pickr3 *{ + box-sizing:border-box + } + .pickr3 .pcr-button3{ + position:relative; + height:7vw; + width:7vw; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr3 .pcr-button3:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr3 .pcr-button3:after,.pickr3 .pcr-button3:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr3 .pcr-button3:after{ + transition:background .3s; + background:currentColor + } + .pickr3 .pcr-button3.clear{ + background-size:70% + } + .pickr3 .pcr-button3.clear:before{ + opacity:0 + } + .pickr3 .pcr-button3.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr3 .pcr-button3.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr3 button,.pickr3 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr3 button:focus,.pickr3 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + + /*! Pickr4 1.0.1 MIT | https://github.com/Simonwep/pickr4 */ + .pickr4{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + } + .pickr4 *{ + box-sizing:border-box + } + .pickr4 .pcr-button4{ + position:relative; + height:7vw; + width:7vw; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr4 .pcr-button4:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr4 .pcr-button4:after,.pickr4 .pcr-button4:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr4 .pcr-button4:after{ + transition:background .3s; + background:currentColor + } + .pickr4 .pcr-button4.clear{ + background-size:70% + } + .pickr4 .pcr-button4.clear:before{ + opacity:0 + } + .pickr4 .pcr-button4.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr4 .pcr-button4.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr4 button,.pickr4 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr4 button:focus,.pickr4 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + + /*! Pickr5 1.0.1 MIT | https://github.com/Simonwep/pickr5 */ + .pickr5{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + } + .pickr5 *{ + box-sizing:border-box + } + .pickr5 .pcr-button5{ + position:relative; + height:2em; + width:2em; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr5 .pcr-button5:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr5 .pcr-button5:after,.pickr5 .pcr-button5:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr5 .pcr-button5:after{ + transition:background .3s; + background:currentColor + } + .pickr5 .pcr-button5.clear{ + background-size:70% + } + .pickr5 .pcr-button5.clear:before{ + opacity:0 + } + .pickr5 .pcr-button5.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr5 .pcr-button5.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr5 button,.pickr5 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr5 button:focus,.pickr5 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + .pcr-app[data-theme=classic] .pcr-swatches>button{ + position:relative; + width:1.75em; + height:1.75em; + border-radius:.15em; + cursor:pointer; + margin:2.5px; + flex-shrink:0; + justify-self:center; + transition:all .15s; + overflow:hidden; + background:transparent; + z-index:1 + } + .pcr-app[data-theme=classic] .pcr-swatches>button:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + background:url('data:image/svg+xml; utf8, '); + background-size:6px; + border-radius:.15em; + z-index:-1 + } + .pcr-app[data-theme=classic] .pcr-swatches>button:after{ + content:""; + position:absolute; + top:0; + left:0; + width:100%; + height:100%; + background:currentColor; + border:1px solid rgba(0,0,0,.05); + border-radius:.15em; + box-sizing:border-box + } + .pcr-app[data-theme=classic] .pcr-swatches>button:hover{ + filter:brightness(1.05) + } + .pcr-app[data-theme=classic] .pcr-interaction{ + display:flex; + flex-wrap:wrap; + align-items:center; + margin:0 -.2em + } + .pcr-app[data-theme=classic] .pcr-interaction>*{ + margin:0 .2em + } + .pcr-app[data-theme=classic] .pcr-interaction input{ + letter-spacing:.07em; + font-size:.75em; + text-align:center; + cursor:pointer; + color:#75797e; + background:#f1f3f4; + border-radius:.15em; + transition:all .15s; + padding:.45em .5em; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-interaction input:hover{ + filter:brightness(.975) + } + .pcr-app[data-theme=classic] .pcr-interaction input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px rgba(66,133,244,.75) + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-result{ + color:#75797e; + text-align:left; + flex:1 1 8em; + min-width:8em; + transition:all .2s; + border-radius:.15em; + background:#f1f3f4; + cursor:text + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-result::selection{ + background:#4285f4; + color:#fff + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-type.active{ + color:#fff; + background:#4285f4 + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-clear,.pcr-app[data-theme=classic] .pcr-interaction .pcr-save{ + width:auto; + color:#fff + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-clear:hover,.pcr-app[data-theme=classic] .pcr-interaction .pcr-save:hover{ + filter:brightness(.925) + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-save{ + background:#4285f4 + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-clear{ + background:#f44250 + } + .pcr-app[data-theme=classic] .pcr-interaction .pcr-clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px rgba(244,66,80,.75) + } + .pcr-app[data-theme=classic] .pcr-selection{ + display:flex; + justify-content:space-between; + flex-grow:1 + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-picker{ + position:absolute; + height:18px; + width:18px; + border:2px solid #fff; + border-radius:100%; + user-select:none + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-preview{ + position:relative; + z-index:1; + width:2em; + display:flex; + flex-direction:column; + justify-content:space-between; + margin-right:.75em + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-preview:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + border-radius:.15em; + z-index:-1 + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-preview .pcr-last-color{ + cursor:pointer; + transition:background-color .3s,box-shadow .3s; + border-radius:.15em .15em 0 0; + z-index:2 + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-preview .pcr-current-color{ + border-radius:0 0 .15em .15em + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-preview .pcr-current-color,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-preview .pcr-last-color{ + background:currentColor; + width:100%; + height:50% + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-chooser,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-opacity,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-palette{ + position:relative; + user-select:none; + display:flex; + flex-direction:column; + cursor:grab; + cursor:-moz-grab; + cursor:-webkit-grab + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-chooser:active,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-opacity:active,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-palette:active{ + cursor:grabbing; + cursor:-moz-grabbing; + cursor:-webkit-grabbing + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-palette{ + width:100%; + height:8em; + z-index:1 + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-palette .pcr-palette{ + flex-grow:1; + border-radius:.15em + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-palette .pcr-palette:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + border-radius:.15em; + z-index:-1 + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-chooser,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-opacity{ + margin-left:.75em + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-chooser .pcr-picker,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-opacity .pcr-picker{ + left:50%; + transform:translateX(-50%) + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-chooser .pcr-slider,.pcr-app[data-theme=classic] .pcr-selection .pcr-color-opacity .pcr-slider{ + width:8px; + flex-grow:1; + border-radius:50em + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-chooser .pcr-slider{ + background:linear-gradient(180deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red) + } + .pcr-app[data-theme=classic] .pcr-selection .pcr-color-opacity .pcr-slider{ + background:linear-gradient(180deg,transparent,#000),url('data:image/svg+xml; utf8, '); + background-size:100%,50% + } + + + /*! Pickr6 1.0.1 MIT | https://github.com/Simonwep/pickr6 */ + .pickr6{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + } + .pickr6 *{ + box-sizing:border-box + } + .pickr6 .pcr-button6{ + position:relative; + height:7vw; + width:7vw; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr6 .pcr-button6:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr6 .pcr-button6:after,.pickr6 .pcr-button6:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr6 .pcr-button6:after{ + transition:background .3s; + background:currentColor + } + .pickr6 .pcr-button6.clear{ + background-size:70% + } + .pickr6 .pcr-button6.clear:before{ + opacity:0 + } + .pickr6 .pcr-button6.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr6 .pcr-button6.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr6 button,.pickr6 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr6 button:focus,.pickr6 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + + /*! Pickr7 1.0.1 MIT | https://github.com/Simonwep/pickr7 */ + .pickr7{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + } + .pickr7 *{ + box-sizing:border-box + } + .pickr7 .pcr-button7{ + position:relative; + height:7vw; + width:7vw; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr7 .pcr-button7:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr7 .pcr-button7:after,.pickr7 .pcr-button7:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr7 .pcr-button7:after{ + transition:background .3s; + background:currentColor + } + .pickr7 .pcr-button7.clear{ + background-size:70% + } + .pickr7 .pcr-button7.clear:before{ + opacity:0 + } + .pickr7 .pcr-button7.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr7 .pcr-button7.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr7 button,.pickr7 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr7 button:focus,.pickr7 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } + + + /*! Pickr8 1.0.1 MIT | https://github.com/Simonwep/pickr8 */ + .pickr8{ + position:relative; + overflow:visible; + transform:translateY(0); + margin : 0vw 2vw 2vw 2vw; + } + .pickr8 *{ + box-sizing:border-box + } + .pickr8 .pcr-button8{ + position:relative; + height:7vw; + width:7vw; + padding:.5em; + cursor:pointer; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + border-radius:.15em; + background:url('data:image/svg+xml; utf8, ') no-repeat 50%; + background-size:0; + transition:all .3s + } + .pickr8 .pcr-button8:before{ + background:url('data:image/svg+xml; utf8, '); + background-size:.5em; + z-index:-1; + z-index:auto + } + .pickr8 .pcr-button8:after,.pickr8 .pcr-button8:before{ + position:absolute; + content:""; + top:0; + left:0; + width:100%; + height:100%; + border-radius:15em + } + .pickr8 .pcr-button8:after{ + transition:background .3s; + background:currentColor + } + .pickr8 .pcr-button8.clear{ + background-size:70% + } + .pickr8 .pcr-button8.clear:before{ + opacity:0 + } + .pickr8 .pcr-button8.clear:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pickr8 .pcr-button8.disabled{ + cursor:not-allowed + } + .pcr-app button,.pcr-app input,.pickr8 button,.pickr8 input{ + outline:none; + border:none; + -webkit-appearance:none + } + .pcr-app button:focus,.pcr-app input:focus,.pickr8 button:focus,.pickr8 input:focus{ + box-shadow:0 0 0 1px #f1f3f4,0 0 0 3px currentColor + } + .pcr-app[data-theme=classic]{ + position:absolute; + display:flex; + flex-direction:column; + z-index:10000; + font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; + box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03); + width:28.5em; + max-width:95vw; + padding:.8em; + border-radius:.1em; + background:#fff; + opacity:0; + visibility:hidden; + transition:opacity .3s; + left:0; + top:0 + } + .pcr-app[data-theme=classic].visible{ + visibility:visible; + opacity:1 + } + .pcr-app[data-theme=classic] .pcr-swatches{ + display:flex; + flex-wrap:wrap; + margin-top:.75em + } + .pcr-app[data-theme=classic] .pcr-swatches.pcr-last{ + margin:0 + } + @supports (display:grid){ + .pcr-app[data-theme=classic] .pcr-swatches{ + display:grid; + align-items:center; + justify-content:space-around; + grid-template-columns:repeat(auto-fit,1.75em) + } + + } +} \ No newline at end of file diff --git a/SwichGIT/src/css/tablet.css b/SwichGIT/src/css/tablet.css new file mode 100644 index 0000000..9b45d58 --- /dev/null +++ b/SwichGIT/src/css/tablet.css @@ -0,0 +1,622 @@ +/*DemTéléphone 1i Ecran*/ +@media screen and (min-width: 0px) and (max-width: 992px) { + + .containform3 { + position: relative; + height: calc(1.25*var(--x)); + width: calc(2*var(--x)); + display: table-cell; + vertical-align: middle; + left: -2vw; + } + + .containform3carte { + position: relative; + height: var(--l); + width: var(--l); + display: table-cell; + /*vertical-align: middle;*/ + } + + .containinte{ + /*PROBLEME SIZE*/ + top: calc(1.5*((var(--y) - var(--z)) / 2)); + left: calc(1.5*((var(--y) - var(--z)) / 2)); + height: calc(1.5*var(--z)); + width: calc(1.5*var(--z)); + z-index: 2; + position: absolute; + } + + .containinteCarte{ + top:calc((var(--l) - var(--n)) / 1.3); + left:calc((var(--l) - var(--n)) / 1.2); + height: var(--n); + width: var(--n); + z-index: 2; + position: absolute; + } + + .containexteCarte{ + top:calc((var(--l) - var(--m)) / 0.8); + left:calc((var(--l) - var(--m)) / 0.7); + height: var(--m); + width: var(--m); + z-index: 1; + position: absolute; + } + + .cache{ + top: calc(0.91*((var(--x) - var(--y)) / 2.8)); + left: calc(4.55*((var(--x) - var(--y)) / 2.2)); + height: calc(1.5*var(--y)*1.05); + width: calc(1.5*var(--y)*1.05); + z-index: 2; + position: absolute; + z-index: 15; + } + + #formSize{ + margin : 0 auto; + width: 100%; + height: 3vw; + position: relative; + top: 3vw; + } + + .slider-container .bar .fill { + display: block; + width: 50%; + height: 100%; + background-color: #6200ee; + } + + .slider-container .slider { + position: relative; + z-index: 2; + -webkit-appearance: none; + width: 100%; + height: 10px; + border-radius: 5px; + outline: none; + top: -0.25vw; + background-color: transparent; + } + .slider.container{ + position: relative; + } + .slider-container .bar { + position: absolute; + z-index: 1; + left: 0; + width: 100%; + height: 10px; + border-radius: 5px; + background-color: #c6aee7; + overflow: hidden; + } + /*Moz*/ + .slider-container .slider::-moz-range-thumb { + -webkit-appearance: none; + width: 2vw; + height: 2vw; + background-color: #6200ee; + border-radius: 1vw; + cursor: pointer; + outline: none; + box-shadow: 0 0 0 0 rgba(98, 0 ,238, .1); + transition: .3s ease-in-out; + } + + .slider-container .slider::-moz-range-thumb:hover { + box-shadow: 0 0 0 10px rgba(98,0,238,.1); + } + .slider-container .slider:active::-moz-range-thumb { + box-shadow: 0 0 0 20px rgba(98,0,238,.2); + } + + .logop2 img { + width: 20vh; + padding-top: 1vh; + position: relative; + } + + .txt { + position: absolute; + font-family: Arial Black; + color: var(--lightprima); + font-size: 5.5vw; + left: 2.25vw; + top: -1vh; + } + + .logo img { + position: absolute; + width: 30vw; + left: 35vw; + top: 2%; + z-index: 11; + } + + .mounts img { + position: absolute; + height: 100%; + width: 100%; + pointer-events: none; + margin-left: -1vw; + margin-top: -1vw; + object-fit: cover; + } + + #contourbuttonvalider { + position: absolute; + border-radius: 45px; + left: -10vw; + top: -10vh; + height: 15vw; + width: 50vw; + background-color: var(--lightsedonca); + z-index: 15; + } + + .bouttonvalider { + position: absolute; + height: 13vw; + width: 47vw; + top: 1.1vw; + left: 1.5vw; + border-radius: 30px; + background-color: #B130DE; + } + + .bouttonvalider2 { + position: absolute; + height: 6.8vw; + width: 22.8vw; + top: 1.1vw; + left: 1.1vw; + border-radius: 30px; + background-color: #00CC66; + } + + #textjouer { + font-family: Montserrat, impact, Arial Black; + position: absolute; + font-size: 10vw; + margin-top: 0.2vw; + width: inherit; + text-align: center; + color: var(--lightsedonca); + } + + #textjouerr { + font-family: Montserrat, impact, Arial Black; + position: absolute; + font-size: 10vw; + margin-top: 0.2vw; + width: inherit; + text-align: center; + color: var(--lightsedonca); + } + + #choosemode { + height: 7vw; + width: 50vw; + position: absolute; + left: 25vw; + top: 40vh; + z-index: 15; + } + + #choosedimension { + height: 7vw; + width: 50vw; + position: absolute; + left: 25vw; + top: 50vh; + z-index: 15; + } + + #conteneurmode{ + width: 80%; + height: 80%; + left : 10%; + position: absolute; + background-color: var(--lightsedonca); + border-radius: 5vw; + } + + #triangleprec{ + width: 0; + height: 0; + margin: 0.25vw auto 0 auto; + border-top: 2vw solid transparent; + border-right: 4vw solid grey; + border-bottom: 2vw solid transparent; + margin-top: 0.75vw; + } + + #trianglesuiv{ + width: 0; + height: 0; + margin: 0.25vw auto 0 auto; + border-top: 2vw solid transparent; + border-left: 4vw solid grey; + border-bottom: 2vw solid transparent; + margin-top: 0.75vw; + } + + #textmode { + font-family: Lucida Console, Arial Black, Arial; + font-size: 3vw; + color: #707070; + text-align:center; + margin: 5% auto 0 auto; + } + + #textdimension { + font-family: Lucida Console, Arial Black, Arial; + font-size: 3vw; + color: #707070; + text-align:center; + margin: 5% auto 0 auto; + } + + .logoboutton{ + font-size: 2vw; + color: var(--lightprima); + margin: 1vw; + } + + /*Externe*/ + .bouttonMenuHaut{ + height: 4vw; + width: 4vw; + background-color: var(--lightsedonca); + border-radius: 50%; + margin: 0 auto; + margin-top: 2.5vw; + position: relative; + display: block; + } + + + .divmenu { + width: 25vw; + height: inherit; + margin-right: 1vw; + } + + + #affPoints { + text-align: center; + font-family: Montserrat, impact, Arial Black; + font-size: 2vw; + margin-top: 3.5vw; + color: var(--lightsedonca); + } + + .containcards { + overflow-x: auto; + display: grid; + grid-template-columns: repeat(4,auto); + grid-template-rows: repeat(4,auto); + padding-top: 1vw; + justify-content: center; + } + + .flex-item { + flex-grow: 1; + background: var(--lightsedonca); + width: var(--tailleTablette); + border-radius: 0.75vw; + padding-right: 0.15vw; + padding-left: 0.15vw; + padding-bottom: 0.25vw; + list-style: none; + display: flex; + margin-right: 0.4vw; + margin-left: 0.4vw; + margin-bottom: 1vw; + -webkit-flex-flow: row wrap; + justify-content: space-around; + } + + .item-form { + width: 4vh; + padding-left: 0.1vw; + margin-top: 0.25vw; + height: 4vh; + border-radius: 10px; + display: table-cell; + position: relative; + vertical-align: middle; + background-color: var(--lighttercia); + } + + #containBottom{ + position: absolute; + bottom: -0%; + width: auto; + left: 50%; + z-index: 20; + height: auto; + } + + #containScore { + display: flex; + justify-content: center; + position: relative; + left: -50%; + flex-flow: row wrap; + width: 80vw; + + } + + .titreScore{ + font: 700 5vh "Poppins", sans-serif; + color: #2B2D2F; + position: relative; + left: -50%; + text-align: center; + } + + .case-score{ + padding: 4px; + position: relative; + z-index: 1; + width: 12vw; + height: 12vw; + margin: 1vw; + cursor: default; + transition: all 0.3s ease; + } + + .case-score .score-description { + background-color: var(--lightsedonca); + padding: 10px 15px; + width: calc(100% - 30px); + height: calc(100% - 20px); + transition: inherit; + } + + .case-score .score-position { + font: 700 3vw "Poppins", sans-serif; + margin-left: -1vw; + transition: 0.2s ease 150ms; + } + .case-score .score-pseudo, .score-points { + font: 500 12px "Poppins", sans-serif; + margin-top: -0.2em; + margin-left: -1vw; + } + + .case-score:after { + z-index: 10; + background: #f9f8f7; + color: #333; + width: 180px; + position: absolute; + top: 80%; + opacity: 0; + transition: opacity 0.3s ease 0.3s, top 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s; + height: auto; + font-size: 12px; + line-height: 1.4; + padding: 10px; + margin: 0 0 0 -50px; + border-radius: 6px; + text-align: center; + } + .case-score:hover { + transform: scale(1.12); + z-index: 10; + } + + .case-score:hover .score-description { + background: transparent; + } + .case-score:hover .score-position, + .case-score:hover .score-pseudo, + .case-score:hover .score-points { + -webkit-text-fill-color: #222; + } + .case-score:hover:after { + top: 105%; + opacity: 1; + } + + .first { + background: linear-gradient(to bottom right, #f3f9a6 0%, #cbc634 100%); + } + .first .score-position, + .first .score-pseudo, + .first .score-points { + background: -webkit-linear-gradient(#2B2D2F, #2B2D2F); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + + .second { + background: linear-gradient(to bottom right, #37cfdc 0%, #5a88e5 100%); + } + + .second .score-position, + .second .score-pseudo, + .second .score-points { + background: -webkit-linear-gradient(#2B2D2F, #2B2D2F); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + + .third { + background: linear-gradient(to bottom right, #ff616d 0%, #ffc171 100%); + } + + .third .score-position, + .third .score-pseudo, + .third .score-points { + background: -webkit-linear-gradient(#2B2D2F, #2B2D2F); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + + .nopodium { + background: linear-gradient(to bottom right, #2c3e50 0%, #B7B7B7 90%); + } + + .nopodium .score-position, + .nopodium .score-pseudo, + .nopodium .score-points { + background: -webkit-linear-gradient(#3A3B3C, #3A3B3C ); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + + .content{ + margin-top: -5vw; + } + + #infosec2{ + position: relative; + z-index:15; + width: 2vw; + left: 5vw; + } + + #cf2 { + position:relative; + margin-left: 14vh; + top: 2.5vh; + } + + .last{ + display: none; + } + + #multiParams{ + height: 15vw; + width: 55vw; + position: absolute; + margin: 0 auto; + top: 58vh; + left: 25%; + z-index: 15; + display: none; + } + #buttonMulti { + border-radius: 45px; + height: 5.5vw; + width: 22.4vw; + top: 1vw; + background-color: var(--lightsedonca); + z-index: 15; + } + + #buttonMulti2 { + border-radius: 45px; + height: 5.5vw; + width: 22.4vw; + top: 1vw; + background-color: var(--lightsedonca); + z-index: 15; + margin-top: 1vh; + } + + .bouttonvalider2 { + position: relative; + height: 4.5vw; + width: 20vw; + top: 0.5vw; + left: 1.3vw; + border-radius: 30px; + } + + #textmulti { + font-family: Montserrat, impact, Arial Black; + font-size: 3vw; + margin-top: 0.3vw; + color: var(--lightsedonca); + text-align: center; + width: inherit; + } + + #conteneurCreate{ + width: 40%; + height: 5.2vw; + left: 50%; + top: 3%; + position: absolute; + margin: 0 auto; + background-color: var(--lightsedonca); + border-radius: 5vw; + } + + + #conteneurJoin{ + width: 40%; + height: 5.2vw; + left: 50%; + top: 45%; + position: absolute; + margin: 0 auto; + background-color: var(--lightsedonca); + border-radius: 5vw; + } + + .form__field { + font-family: inherit; + width: 70%; + border: 0; + border-bottom: 2px solid #9b9b9b; + outline: 0; + font-size: 2.5vw; + color: black; + padding: 0.8vh 0; + background: transparent; + transition: border-color 0.2s; + margin-left: 3.5vw; + text-align: center; + } + .form__field::placeholder { + color: black; + } + .form__field:placeholder-shown ~ .form__label { + font-size: 1.3rem; + cursor: text; + top: 20px; + } + + .form__label { + position: absolute; + top: 0; + display: block; + transition: 0.2s; + font-size: 1rem; + color: black; + } + + .form__field:focus { + padding-bottom: 6px; + font-weight: 700; + border-width: 3px; + border-image: linear-gradient(to right, #11998e, #38ef7d); + border-image-slice: 1; + } + .form__field:focus ~ .form__label { + position: absolute; + top: 0; + display: block; + transition: 0.2s; + font-size: 1rem; + color: #11998e; + font-weight: 700; + } + + .violet { + background-color: #B130DE; + } + + + +} diff --git a/SwichGIT/src/envoipseudo.php b/SwichGIT/src/envoipseudo.php new file mode 100644 index 0000000..314c97f --- /dev/null +++ b/SwichGIT/src/envoipseudo.php @@ -0,0 +1,7 @@ +query('UPDATE partieCartes SET "colUn" = "'.$valcol1.'","colDeux"="'.$valcol2.'","colTrois"="'.$valcol3.'" where IdPartie="'.$idpartie.'" AND IdCarte="'.($i+1).'" '); +} + diff --git a/SwichGIT/src/envoyeridpartie.php b/SwichGIT/src/envoyeridpartie.php new file mode 100644 index 0000000..50cd2ab --- /dev/null +++ b/SwichGIT/src/envoyeridpartie.php @@ -0,0 +1,4 @@ + + + + + + + SwishGame + + + + + + + + + + + + + + + + + + + + +
+
+ +

Nom :


+ +
+ + + + +
+
+ + + +
+ + + + + + + + + +
+ +
+
+

JOUER

+
+
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+

Match à Point

+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+ +
+

4 * 3

+
+ +
+
+
+
+
+ +
+
+ +
+
+
+

Créer

+
+
+ +
+
+

Rejoindre

+
+
+ +
+ +
+
+ + + + +
+
+ + +
+
+

Classement - Timer

+
+ query($requete2); + $row = array(); + $i = 0; + + while ($ligne2 = $resultat2 -> fetchArray() ) { + $i++; + $pos = "nopodium"; + $isLast = ""; + if($i == 1){ + $pos = "first"; + }else if($i == 2){ + $pos = "second"; + }else if($i == 3){ + $pos = "third"; + } + + if($i > 5){ + $isLast = "last"; + } + ?> + +
" data-description="Score obtenu le ..."> +
+
+
+
+
+
+ + +
+
+
+ +
+
+

Classement - Match à Point

+
+ query($requete2); + $row = array(); + $i = 0; + + while ($ligne2 = $resultat2 -> fetchArray() ) { + $i++; + $pos = "nopodium"; + $isLast = ""; + if($i == 1){ + $pos = "first"; + }else if($i == 2){ + $pos = "second"; + }else if($i == 3){ + $pos = "third"; + } + + if($i > 5){ + $isLast = "last"; + } + ?> + +
" data-description="Score obtenu le ..."> +
+
+
+
+
+
+ + +
+
+
+ + + +
+ + + +
+
+ +
+ + +
+
+

Paramètres

+ × +
+
+
+
+
+
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+ + + +
+
+
+
+
+
+ + + + + +
+
+
+ +
+ +
+ +
+

+
+
+
+ + +
+

+
+ +
+ + + + + + + + + diff --git a/SwichGIT/src/js/jquery.js b/SwichGIT/src/js/jquery.js new file mode 100644 index 0000000..a1c07fd --- /dev/null +++ b/SwichGIT/src/js/jquery.js @@ -0,0 +1,2 @@ +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0 { + var lacarte = "card"+pos; + var numeroCarte = pos; + //console.log("lacarte: ",lacarte); + //console.log(deckPartie[numeroCarte].get); + document.getElementById(lacarte).style.boxShadow = "0 0 1vw red, 0 0 1vw red"; + }); + } + else { + for (var i=0; i 1) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[1]); + formeInte.classList.add(FormeSelect[1]); + //verification triangle ou penda + if(FormeSelect[1] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[1] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } else if (this.couleur == CouleurFigure.Couleur3) { + formeExte.style.backgroundColor = "var(--colorone)"; + if(FormeSelect.length > 2) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[2]); + formeInte.classList.add(FormeSelect[2]); + //verification triangle ou penda + if(FormeSelect[2] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[2] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } else if (this.couleur == CouleurFigure.Couleur4) { + formeExte.style.backgroundColor = "var(--colortwo)"; + if(FormeSelect.length > 3) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[3]); + formeInte.classList.add(FormeSelect[3]); + //verification triangle ou penda + if(FormeSelect[3] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[3] == "penta"){ + formeInte.classList.add("caspentac"); + } + } else if (FormeSelect.length > 1){ + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[1]); + formeInte.classList.add(FormeSelect[1]); + //verification triangle ou penda + if(FormeSelect[1] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[1] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + } else { + this.couleur = CouleurFigure.Couleur1; + if (selectionDiemension == 0) { + this.couleur = CouleurFigure.Couleur1; + if (this.pos == 0 || this.pos == 2 || this.pos == 9 || this.pos == 11) { + formeExte.style.backgroundColor = "var(--colorcarre)"; + this.couleur = CouleurFigure.Couleur2; + if(FormeSelect.length > 1) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[1]); + formeInte.classList.add(FormeSelect[1]); + //verification triangle ou penda + if(FormeSelect[1] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[1] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + if (this.pos == 1 || this.pos == 10) { + formeExte.style.backgroundColor = "var(--colorone)"; + this.couleur = CouleurFigure.Couleur3; + if(FormeSelect.length > 2) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[2]); + formeInte.classList.add(FormeSelect[2]); + //verification triangle ou penda + if(FormeSelect[2] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[2] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + if (this.pos == 4 || this.pos == 7) { + formeExte.style.backgroundColor = "var(--colortwo)"; + this.couleur = CouleurFigure.Couleur4; + if(FormeSelect.length > 3) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[3]); + formeInte.classList.add(FormeSelect[3]); + //verification triangle ou penda + if(FormeSelect[3] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[3] == "penta"){ + formeInte.classList.add("caspentac"); + } + } else if (FormeSelect.length > 1){ + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[1]); + formeInte.classList.add(FormeSelect[1]); + //verification triangle ou penda + if(FormeSelect[1] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[1] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + } else if (selectionDiemension == 1) { + this.couleur = CouleurFigure.Couleur1; + if (this.pos == 0 || this.pos == 2 || this.pos == 6 || this.pos == 8) { + formeExte.style.backgroundColor = "var(--colorcarre)"; + this.couleur = CouleurFigure.Couleur2; + if(FormeSelect.length > 1) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[1]); + formeInte.classList.add(FormeSelect[1]); + //verification triangle ou penda + if(FormeSelect[1] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[1] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + if (this.pos == 1 || this.pos == 7) { + formeExte.style.backgroundColor = "var(--colorone)"; + this.couleur = CouleurFigure.Couleur3; + if(FormeSelect.length > 2) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[2]); + formeInte.classList.add(FormeSelect[2]); + //verification triangle ou penda + if(FormeSelect[2] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[2] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + if (this.pos == 4) { + formeExte.style.backgroundColor = "var(--colortwo)"; + this.couleur = CouleurFigure.Couleur4; + if(FormeSelect.length > 3) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[3]); + formeInte.classList.add(FormeSelect[3]); + //verification triangle ou penda + if(FormeSelect[3] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[3] == "penta"){ + formeInte.classList.add("caspentac"); + } + } else if (FormeSelect.length > 1){ + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[1]); + formeInte.classList.add(FormeSelect[1]); + //verification triangle ou penda + if(FormeSelect[1] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[1] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + } + } + containInte.appendChild(formeInte); + containInte.className = "containinteCarte"; + containExte.appendChild(formeExte); + containExte.className = "containexteCarte"; + + vidcontainer.appendChild(containInte); + vidcontainer.appendChild(containExte); + + divcase.appendChild(vidcontainer); + this.CodeHTML = divcase; + break; + + case TypeFigure.Petit: + + var containInte = document.createElement('div'); + var formeInte = document.createElement('div'); + var containExte = document.createElement('div'); + var formeExte = document.createElement('div'); + + var vidcontainer = document.createElement('div'); + vidcontainer.className = "containform3carte"; + vidcontainer.className = "proute"; + + formeExte.className = "formeexte"; + formeExte.classList.add('rondv2'); + + formeInte.className = "formeinte"; + formeInte.classList.add('rondv2'); + + formeInte.style.backgroundColor = "var(--colorbase)"; + + if (this.couleur != null) { + if (this.couleur == CouleurFigure.Couleur1) { + formeInte.style.backgroundColor = "var(--colorbase)"; + } else if (this.couleur == CouleurFigure.Couleur2) { + formeInte.style.backgroundColor = "var(--colorcarre)"; + if(FormeSelect.length > 1) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[1]); + formeInte.classList.add(FormeSelect[1]); + //verification triangle ou penda + if(FormeSelect[1] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[1] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + + } else if (this.couleur == CouleurFigure.Couleur3) { + formeInte.style.backgroundColor = "var(--colorone)"; + if(FormeSelect.length > 2) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[2]); + formeInte.classList.add(FormeSelect[2]); + //verification triangle ou penda + if(FormeSelect[2] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[2] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } else if (this.couleur == CouleurFigure.Couleur4) { + formeInte.style.backgroundColor = "var(--colortwo)"; + if(FormeSelect.length > 3) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[3]); + formeInte.classList.add(FormeSelect[3]); + //verification triangle ou penda + if(FormeSelect[3] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[3] == "penta"){ + formeInte.classList.add("caspentac"); + } + } else if (FormeSelect.length > 1){ + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[1]); + formeInte.classList.add(FormeSelect[1]); + //verification triangle ou penda + if(FormeSelect[1] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[1] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + } else { + this.couleur = CouleurFigure.Couleur1; + if (selectionDiemension == 0) { + this.couleur = CouleurFigure.Couleur1; + if (this.pos == 0 || this.pos == 2 || this.pos == 9 || this.pos == 11) { + formeInte.style.backgroundColor = "var(--colorcarre)"; + this.couleur = CouleurFigure.Couleur2; + if(FormeSelect.length > 1) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[1]); + formeInte.classList.add(FormeSelect[1]); + //verification triangle ou penda + if(FormeSelect[1] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[1] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + if (this.pos == 1 || this.pos == 10) { + formeInte.style.backgroundColor = "var(--colorone)"; + this.couleur = CouleurFigure.Couleur3; + if(FormeSelect.length > 2) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[2]); + formeInte.classList.add(FormeSelect[2]); + //verification triangle ou penda + if(FormeSelect[2] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[2] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + if (this.pos == 4 || this.pos == 7) { + formeInte.style.backgroundColor = "var(--colortwo)"; + this.couleur = CouleurFigure.Couleur4; + if(FormeSelect.length > 3) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[3]); + formeInte.classList.add(FormeSelect[3]); + //verification triangle ou penda + if(FormeSelect[3] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[3] == "penta"){ + formeInte.classList.add("caspentac"); + } + } else if (FormeSelect.length > 1){ + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[1]); + formeInte.classList.add(FormeSelect[1]); + //verification triangle ou penda + if(FormeSelect[1] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[1] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + } else if (selectionDiemension == 1) { + this.couleur = CouleurFigure.Couleur1; + if (this.pos == 0 || this.pos == 2 || this.pos == 6 || this.pos == 8) { + formeInte.style.backgroundColor = "var(--colorcarre)"; + this.couleur = CouleurFigure.Couleur2; + if(FormeSelect.length > 1) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[1]); + formeInte.classList.add(FormeSelect[1]); + //verification triangle ou penda + if(FormeSelect[1] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[1] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + if (this.pos == 1 || this.pos == 7) { + formeInte.style.backgroundColor = "var(--colorone)"; + this.couleur = CouleurFigure.Couleur3; + if(FormeSelect.length > 2) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[2]); + formeInte.classList.add(FormeSelect[2]); + //verification triangle ou penda + if(FormeSelect[2] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[2] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + if (this.pos == 4) { + formeInte.style.backgroundColor = "var(--colortwo)"; + this.couleur = CouleurFigure.Couleur4; + if(FormeSelect.length > 3) + { + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[3]); + formeInte.classList.add(FormeSelect[3]); + //verification triangle ou penda + if(FormeSelect[3] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[3] == "penta"){ + formeInte.classList.add("caspentac"); + } + } else if (FormeSelect.length > 1){ + //suppression formeBase + formeExte.classList.remove('rondv2'); + formeInte.classList.remove('rondv2'); + //ajout forme + formeExte.classList.add(FormeSelect[1]); + formeInte.classList.add(FormeSelect[1]); + //verification triangle ou penda + if(FormeSelect[1] == "triangle"){ + formeInte.classList.add("castrianglec"); + } + if(FormeSelect[1] == "penta"){ + formeInte.classList.add("caspentac"); + } + } + } + } + } + + containInte.appendChild(formeInte); + containInte.className = "containinteCarte"; + containExte.appendChild(formeExte); + containExte.className = "containexteCarte"; + + vidcontainer.appendChild(containInte); + vidcontainer.appendChild(containExte); + + divcase.appendChild(vidcontainer); + this.CodeHTML = divcase; + break; + + } + } + } + get getHTML() { + return this.CodeHTML; + } + get getX() { + return this.X; + } + get getY() { + return this.Y; + } + get getType() { + return this.type; + } + get getForme() { + return this.forme; + } + + +} + +const CouleurFigure = { + Couleur1: 'c1', + Couleur2: 'c2', + Couleur3: 'c3', + Couleur4: 'c4' +} + +const FormeFigure = { + Rond: 'rond', + Carre: 'carre', + Triangle: 'triangle', + Pentagone: 'pentagone', + Losange: 'Losange' +}; + +const TypeFigure = { + Petit: 'p', + Moyen: 'm', + Grand: 'g' +}; + + +function journuit() { + //mode jour + mode = mode + 1; + if (mode % 2 == 0) { + //changer logo swish + document.getElementById("imglogo").src = "imgs/swishjour.png"; + document.getElementById("imglogo2").src = "imgs/swishjour.png"; + document.getElementById("contourbuttonvalider").style.backgroundColor = lightsedonca; + //changer montagnesfond + document.getElementById("mount1").src = "imgs/mount1.png"; + document.getElementById("mount2").src = "imgs/mount2.png"; + //nuages + document.getElementById("cloud").src = "imgs/lightcloud.png"; + //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"; + document.getElementById("contourbuttonvalider").style.backgroundColor = darkseconda; + //changer montagnesfond + document.getElementById("mount1").src = "imgs/darkmount1.png"; + document.getElementById("mount2").src = "imgs/darkmount2.png"; + //nuages + document.getElementById("cloud").src = "imgs/darkcloud.png"; + //maj couleur principales + document.documentElement.style.setProperty('--lightprima', darkprima); + document.documentElement.style.setProperty('--lightsedonca', darkseconda); + document.documentElement.style.setProperty('--lighttercia', darktercia); + } +} + +//=================================================================================== +//FONCTION GESTION DE GAME + +function lancerpartie() { + + lesPoints = 0; + + document.getElementById("progressbar").style.visibility = "hidden"; + document.getElementById('table_HS_Timer').style.visibility = "hidden"; + document.getElementById('table_HS_Match').style.visibility = "hidden"; + var ready = true; + + //fonction de creation de partie a changer en fonction du test voulu + if (selectionMode == 0) { + goAide(); + if (selectionDiemension == 0) { + creePartieClassique3_4(); + majSizeCard(3); + } else if (selectionDiemension == 1) { + creePartieClassique3_3(); + majSizeCard(3); + } else if (selectionDiemension == 2) { + creePartieClassique3_2(); + majSizeCard(2); + } else if (selectionDiemension == 3) { + + if(!modelangue){ + window.alert("Oups, il semblerait que ce mode ne soit pas encore disponible..."); + } + else{ + window.alert("Oops, it seems that this mode is not yet available..."); + } + + + ready = false; + } + + } else if (selectionMode == 1) { + goAide(); + document.getElementById("progressbar").style.visibility = "visible"; + decompte(); + if (selectionDiemension == 0) { + creePartieInfini(4, 3); + majSizeCard(3); + } else if (selectionDiemension == 1) { + creePartieInfini(3, 3); + majSizeCard(3); + } else if (selectionDiemension == 2) { + creePartieInfini3_2(3, 2); + majSizeCard(2); + } else if (selectionDiemension == 3) { + creePartieInfini3_2(2, 2); + majSizeCard(2); + } + } else if (selectionMode == 2) { + goAide(); + if (selectionDiemension == 0) { + creePartieInfini(4, 3); + majSizeCard(3); + } else if (selectionDiemension == 1) { + creePartieInfini(3, 3); + majSizeCard(3); + } else if (selectionDiemension == 2) { + creePartieInfini3_2(3, 2); + majSizeCard(2); + } else if (selectionDiemension == 3) { + creePartieInfini3_2(2, 2); + majSizeCard(2); + } + } else if (selectionMode == 3) { + bacASable(); + }else if(selectionMode == 4){ + document.getElementById("pageAccueil").style.visibility = "hidden"; + //document.getElementById("PageLobbyMulti").style.visibility = "visible"; + + } + if (ready) { + document.getElementById("pageAccueil").style.visibility = "hidden"; + document.getElementById("pageGame").style.visibility = "visible"; + } +} + +function retour() { + document.getElementById("pageAccueil").style.visibility = "visible"; + document.getElementById("pageGame").style.visibility = "hidden"; + window.location.reload(); +} + +function rechargerGAME() { + while (document.getElementById("containcards").firstElementChild != null) { + document.getElementById("containcards").firstElementChild.remove(); + } + for (var i = 0; i < deckPartie.length; i++) { + document.getElementById("containcards").appendChild(deckPartie[i].getHTML); + } +} + +function redistribuerPlateau() { + lesPoints -= 5; + document.getElementById("affPoints").textContent = 'Score : ' + lesPoints; + if (selectionMode == 0) { + redistribuer(); + } else if (selectionMode == 1 || selectionMode == 2) { + for (var i = 0; i < deckPartie.length; i++) { + if (selectionDiemension == 2) { + remplacerLaCarte3_2(deckPartie[i]); + } else if (selectionDiemension == 3) { + remplacerLaCarte2_2(deckPartie[i]); + } else { + remplacerLaCarte(deckPartie[i]); + } + } + } + if(selectionMode == 4){ + redistribuerMulti(); + } + afficherCartes(deckPartie); +} + +function redistribuerMulti() { + carteselect=[]; + carteselectPos=[]; + reselectCartes(); + + deckPartie = []; + for (var i = 0; i < 16; i++) { + var index = getRandom(0, TasDuJEU.length - 1) + var dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + for (var j = 0; j < deckPartie.length; j++) { + if (TasDuJEU[index].identifiant == deckPartie[j].identifiant) { + dejaPresente = true; + } + } + while (dejaPresente == true) { + index = getRandom(0, TasDuJEU.length - 1) + dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + for (var j = 0; j < deckPartie.length; j++) { + if (TasDuJEU[index].identifiant == deckPartie[j].identifiant) { + dejaPresente = true; + } + } + } + + deckPartie.push(copieCarte(TasDuJEU[index])); + } + //Envoyer les 16 cartes du plateau + listecartes=[]; + var uneMatrice; + var ajt; + /* + for (var i = 0; i < deckPartie.length; i++) { + var ajt = deckPartie[i].getMatrice[0] + deckPartie[i].getMatrice[1] + deckPartie[i].getMatrice[2]; + listecartes.push(ajt); + console.log(ajt); + }*/ + for (var j = 0; j < deckPartie.length; j++) { //Pour toutes les cartes de deckPartie + + uneMatrice = creaMatriceVierge(deckPartie[j].row, deckPartie[j].column); //Création d'une matrice vierge ( Tableau 2D avec que des 0) + + for (var i = 0; i < deckPartie[j].SesFigures.length; i++) { //Pour chaque figure présente dans la carte + + if (deckPartie[j].SesFigures[i].type == TypeFigure.Petit) { //Check de la taille de la figure et adaptation de la valeur dans la matrice + uneMatrice[deckPartie[j].SesFigures[i].X][deckPartie[j].SesFigures[i].Y] = 1; + } else if (deckPartie[j].SesFigures[i].type == TypeFigure.Moyen) { + uneMatrice[deckPartie[j].SesFigures[i].X][deckPartie[j].SesFigures[i].Y] = 2; + } + } + + ajt = uneMatrice[0]+uneMatrice[1]+uneMatrice[2];//une fois matrice vierge complétée on transforme ça en data + listecartes.push(ajt); + //console.log(ajt); + } + //console.log("LISTE BUG2 ",listecartes); + $(document).ready(function () { + var cartestables = listecartes; + + $.ajax({ + data: { + cartestables: cartestables + }, + type: "post", + url: "envoyercartes.php", + success: function (data) { + console.log("====Les cartes ont été envoyés (redistribuer)===") + } + }); + }); +} + +function redistribuer() { + deckPartie = []; + for (var i = 0; i < 16; i++) { + var index = getRandom(0, TasDuJEU.length - 1) + var dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + for (var j = 0; j < deckPartie.length; j++) { + if (TasDuJEU[index].identifiant == deckPartie[j].identifiant) { + dejaPresente = true; + } + } + while (dejaPresente == true) { + index = getRandom(0, TasDuJEU.length - 1) + dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + for (var j = 0; j < deckPartie.length; j++) { + if (TasDuJEU[index].identifiant == deckPartie[j].identifiant) { + dejaPresente = true; + } + } + } + + deckPartie.push(copieCarte(TasDuJEU[index])); + } + afficherCartes(deckPartie); +} + +//================================================================================================================================================================ +//Fonction creations de game + +function genererTouteslesCartes3_2Possibles() { + deckPartie = []; + carteselect = []; + + while (document.getElementById("containcards").firstElementChild != null) { + document.getElementById("containcards").firstElementChild.remove(); + } + for (var i = 0; i < 2; i++) { + for (var j = 0; j < 2; j++) { + for (var k = 0; k < 6; k++) { + + //Création de la grande figure + for (var h = 0; h < 2; h++) { + var AllFigure = []; + + //Création de la petite figure en fonction de sa place et de la boucle + if (i == 0) { + if (j == 0) { + var uneFigure = new Figure(TypeFigure.Petit, FormeFigure.Rond, 0, i, CouleurFigure.Couleur2); + } else { + var uneFigure = new Figure(TypeFigure.Petit, FormeFigure.Rond, 0, i, CouleurFigure.Couleur3); + } + } else { + if (j == 0) { + var uneFigure = new Figure(TypeFigure.Petit, FormeFigure.Rond, 0, i, CouleurFigure.Couleur1); + } else { + var uneFigure = new Figure(TypeFigure.Petit, FormeFigure.Rond, 0, i, CouleurFigure.Couleur4); + } + } + + AllFigure.push(uneFigure); + + //Verification de l'effet mirroir sur les cartes ayant un point central + var mirroir = true; + if (Math.floor(k / 2) == 2 && i == 1) { + mirroir = false; + } + + if (k != i * 2) { + + if (k == 2 || k == 3) { + + if (h == 0) { + + var uneMoyenFigure = new Figure(TypeFigure.Moyen, FormeFigure.Rond, k % 2, Math.floor(k / 2), CouleurFigure.Couleur1); + } else { + + var uneMoyenFigure = new Figure(TypeFigure.Moyen, FormeFigure.Rond, k % 2, Math.floor(k / 2), CouleurFigure.Couleur4); + } + + } else { + if (h == 0) { + + var uneMoyenFigure = new Figure(TypeFigure.Moyen, FormeFigure.Rond, k % 2, Math.floor(k / 2), CouleurFigure.Couleur2); + } else { + + var uneMoyenFigure = new Figure(TypeFigure.Moyen, FormeFigure.Rond, k % 2, Math.floor(k / 2), CouleurFigure.Couleur3); + } + + } + if (mirroir) { + AllFigure.push(uneMoyenFigure); + var uneCarte = new Carte(deckPartie.length + 1, AllFigure, 3, 2); + deckPartie.push(uneCarte); + } + } + + } + + } + } + } + return deckPartie; +} + + +function changerlesCartes3_2() { + while (carteselect.length != 0) { + remplacerLaCarte3_2(carteselect[0]); + carteselect.shift(); + } + rechargerGAME(); +} + +function changerlesCartes2_2() { + while (carteselect.length != 0) { + remplacerLaCarte2_2(carteselect[0]); + carteselect.shift(); + } + rechargerGAME(); +} + +function remplacerLaCarte2_2(uneCarte) { + pos = deckPartie.indexOf(uneCarte); + var AllFigure = []; + var Cox1, Coy1, Cox2, Coy2; + + var numCouleur = getRandom(0, 3); + var laCouleur; + + Cox1 = getRandom(0, uneCarte.column - 1); + Coy1 = getRandom(0, uneCarte.row - 1); + + if (numCouleur == 0) { + laCouleur = CouleurFigure.Couleur1; + } else if (numCouleur == 1) { + laCouleur = CouleurFigure.Couleur2; + } else if (numCouleur == 2) { + laCouleur = CouleurFigure.Couleur3; + } else if (numCouleur == 3) { + laCouleur = CouleurFigure.Couleur4; + } + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, Cox1, Coy1, laCouleur)); + + Cox2 = getRandom(0, uneCarte.column - 1); + Coy2 = getRandom(0, uneCarte.row - 1); + + while (Cox2 == Cox1 && Coy1 == Coy2) { + Cox2 = getRandom(0, uneCarte.column - 1); + Coy2 = getRandom(0, uneCarte.row - 1); + } + numCouleur = getRandom(0, 3); + + if (numCouleur == 0) { + laCouleur = CouleurFigure.Couleur1; + } else if (numCouleur == 1) { + laCouleur = CouleurFigure.Couleur2; + } else if (numCouleur == 2) { + laCouleur = CouleurFigure.Couleur3; + } else if (numCouleur == 3) { + laCouleur = CouleurFigure.Couleur4; + } + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, Cox2, Coy2, laCouleur)); + //Code de Generation de Figure + var newCarte = new Carte(pos + 1, AllFigure, uneCarte.row, uneCarte.column); + deckPartie[pos] = newCarte; +} + +function remplacerLaCarte3_2(uneCarte) { + pos = deckPartie.indexOf(uneCarte); + var AllFigure = []; + var Cox1, Coy1, Cox2, Coy2; + + var numCouleur = getRandom(0, 1); + var laCouleur; + + Cox1 = getRandom(0, uneCarte.column - 1); + Coy1 = getRandom(0, uneCarte.row - 1); + if (Cox1 + 2 * Coy1 == 2 || Cox1 + 2 * Coy1 == 3) { + if (numCouleur == 0) { + laCouleur = CouleurFigure.Couleur1; + } else { + laCouleur = CouleurFigure.Couleur4; + } + } else { + if (numCouleur == 0) { + laCouleur = CouleurFigure.Couleur2; + } else { + laCouleur = CouleurFigure.Couleur3; + } + } + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, Cox1, Coy1, laCouleur)); + + Cox2 = getRandom(0, uneCarte.column - 1); + Coy2 = getRandom(0, uneCarte.row - 1); + + while (Cox2 == Cox1 && Coy1 == Coy2) { + Cox2 = getRandom(0, uneCarte.column - 1); + Coy2 = getRandom(0, uneCarte.row - 1); + } + if (Cox2 + 2 * Coy2 == 2 || Cox2 + 2 * Coy2 == 3) { + if (numCouleur == 0) { + laCouleur = CouleurFigure.Couleur1; + } else { + laCouleur = CouleurFigure.Couleur4; + } + } else { + if (numCouleur == 0) { + laCouleur = CouleurFigure.Couleur2; + } else { + laCouleur = CouleurFigure.Couleur3; + } + } + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, Cox2, Coy2, laCouleur)); + //Code de Generation de Figure + var newCarte = new Carte(pos + 1, AllFigure, uneCarte.row, uneCarte.column); + deckPartie[pos] = newCarte; +} + +function creePartieInfini3_2(nbRow, nbColum) { + deckPartie = []; + carteselect = []; + while (document.getElementById("containcards").firstElementChild != null) { + document.getElementById("containcards").firstElementChild.remove(); + } + for (var j = 1; j <= 16; j++) { + + var numCouleur = getRandom(0, 1); + var laCouleur; + var AllFigure = []; + var Cox1, Coy1, Cox2, Coy2; + + Cox1 = getRandom(0, nbColum - 1); + Coy1 = getRandom(0, nbRow - 1); + if (Cox1 + 2 * Coy1 == 2 || Cox1 + 2 * Coy1 == 3) { + if (numCouleur == 0) { + laCouleur = CouleurFigure.Couleur1; + } else { + laCouleur = CouleurFigure.Couleur4; + } + } else { + if (numCouleur == 0) { + laCouleur = CouleurFigure.Couleur2; + } else { + laCouleur = CouleurFigure.Couleur3; + } + } + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, Cox1, Coy1, laCouleur)); + + Cox2 = getRandom(0, nbColum - 1); + Coy2 = getRandom(0, nbRow - 1); + + while (Cox2 == Cox1 && Coy1 == Coy2) { + Cox2 = getRandom(0, nbColum - 1); + Coy2 = getRandom(0, nbRow - 1); + } + + if (Cox2 + 2 * Coy2 == 2 || Cox2 + 2 * Coy2 == 3) { + if (numCouleur == 0) { + laCouleur = CouleurFigure.Couleur1; + } else { + laCouleur = CouleurFigure.Couleur4; + } + } else { + if (numCouleur == 0) { + laCouleur = CouleurFigure.Couleur2; + } else { + laCouleur = CouleurFigure.Couleur3; + } + } + + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, Cox2, Coy2, laCouleur)); + //Code de Generation de Figure + var uneCarte = new Carte(j, AllFigure, nbRow, nbColum); + + deckPartie.push(uneCarte); + + document.getElementById("containcards").appendChild(uneCarte.link); + } +} + +function MaFonction() { + var copyText = document.getElementById("Monidpartie"); + copyText.select(); + copyText.setSelectionRange(0, 99999); + document.execCommand("copy"); +} + +function testerCartesMulti() { + //try { + if (carteselect.length == 0) { + window.alert("Selection Vide test pour jeu classique"); + return; + } else if (carteselect.length < 2) { + window.alert("Selection Trop Petite"); + return; + } else { + var copie = []; + for (var i = 0; i < carteselect.length; i++) { + copie.push(copieCarte(carteselect[i])); + } + var tab = []; + tab = AssemblageARBRE(copie, copieCarte(carteselect[0])); + var solution = true; + var tabCode = []; + for (var i = 0; i < tab.length; i++) { + tabCode.push(tab[i].code); + } + + for (var i = 0; i < tab.length; i++) { + if (tab[i].code == carteselect.length) { + solution = false; + cpt = cpt + 20 * copie.length; + lesPoints += carteselect.length; + document.getElementById("affPoints").textContent = 'Score : ' + lesPoints; + var new2Cartes=changerlesCartesDeTasDeJeuMulti(); + } + } + if (solution) { + document.getElementById("affSolution").textContent = 'Aucune solution trouvée...'; + } + if (!solution) { + document.getElementById("affSolution").textContent = 'Assemblage de ' + copie.length + ' cartes trouvé ! Il reste encore ' + TasDuJEU.length + ' cartes !'; + carteselectPos=[]; + carteselect=[]; + reselectCartes(); + } + } + /*} catch (e) { + window.alert(e); + }*/ + + //Envoyer les 16 cartes du plateau + listecartes=[]; + var ajt; + /* + for (var i = 0; i < deckPartie.length; i++) { + var ajt = deckPartie[i].getMatrice[0] + deckPartie[i].getMatrice[1] + deckPartie[i].getMatrice[2]; + listecartes.push(ajt); + console.log(ajt); + }*/ + for (var j = 0; j < deckPartie.length; j++) { //Pour toutes les cartes de deckPartie + var uneMatrice = creaMatriceVierge(deckPartie[j].row, deckPartie[j].column); //Création d'une matrice vierge ( Tableau 2D avec que des 0) + + + //CODE A RISQUE + for (var i = 0; i < deckPartie[j].SesFigures.length; i++) { //Pour chaque figure présente dans la carte + + if (deckPartie[j].SesFigures[i].type[0] == TypeFigure.Petit) { //Check de la taille de la figure et adaptation de la valeur dans la matrice + uneMatrice[deckPartie[j].SesFigures[i].X][deckPartie[j].SesFigures[i].Y] = 1; + } else if (deckPartie[j].SesFigures[i].type[0] == TypeFigure.Moyen) { + uneMatrice[deckPartie[j].SesFigures[i].X][deckPartie[j].SesFigures[i].Y] = 2; + } + } + // + + + ajt = uneMatrice[0]+uneMatrice[1]+uneMatrice[2];//une fois matrice vierge complétée on transforme ça en data + listecartes.push(ajt); + //console.log(ajt); + } + //console.log("LISTE BUG1: ",listecartes); + + $(document).ready(function () { + var cartestables = listecartes; + + $.ajax({ + data: { + cartestables: cartestables + }, + type: "post", + url: "envoyercartes.php", + success: function (data) { + console.log("====Les cartes ont été envoyés (valider cartes)===") + } + }); + }); +} +function changerlesCartesDeTasDeJeuMulti() { + var new2cartes = []; + // Pour toutes les cartes selectionnées + while (carteselectPos.length != 0) { + + // //Enlever la carte dans le tas du jeu + // var unIndex = TasDuJEU.indexOf(carteselect[0]); + // TasDuJEU.splice(unIndex, 1); + + //si il reste plus de 16 cartes + if (TasDuJEU.length > 16) { + //On prend une autre carte aléatoire dans tas du jeu + var index2 = getRandom(0, TasDuJEU.length - 1) + //var dejaPresente = false; + //Permet de savoir si la carte est deja dans la liste + // for (var j = 0; j < deckPartie.length; j++) { + // if (TasDuJEU[index2].identifiant == deckPartie[j].identifiant) { + // dejaPresente = true; + // } + // } + + deckPartie[carteselectPos[0]]=TasDuJEU[index2]; + TasDuJEU.splice(index2,1); + + + //on recommmence jusqu'à obtenri une carte pas dans le tas de jeu + // while (dejaPresente == true) { + // index2 = getRandom(0, TasDuJEU.length - 1) + // dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + // for (var j = 0; j < deckPartie.length; j++) { + // if (TasDuJEU[index2].identifiant == deckPartie[j].identifiant) { + // dejaPresente = true; + // } + // } + // } + + // unIndex = deckPartie.indexOf(carteselect[0]); + // deckPartie[unIndex] = TasDuJEU[index2]; + // new2cartes.push(TasDuJEU[index2]); + } else { + // si il y a moins de 16 cartes on enlève juste + deckPartie.splice(carteselect[0],1); + // unIndex = deckPartie.indexOf(carteselect[0]); + // deckPartie.splice(unIndex, 1); + } + carteselectPos.shift(); + carteselect.shift(); + } + afficherCartes(deckPartie); + return new2cartes; +} +function creePartieClassique3_2() { + TasDuJEU = genererTouteslesCartes3_2Possibles(); + deckPartie = []; + for (var i = 0; i < TasDuJEU.length; i++) { + CodeRotation = getRandom(0, 3); + if (CodeRotation == 0) { + TasDuJEU[i] = TasDuJEU[i]; + } else if (CodeRotation == 1) { + TasDuJEU[i] = Horizontale(TasDuJEU[i]); + } else if (CodeRotation == 2) { + TasDuJEU[i] = Verticale(TasDuJEU[i]); + } else if (CodeRotation == 3) { + TasDuJEU[i] = Verticale(TasDuJEU[i]); + TasDuJEU[i] = Horizontale(TasDuJEU[i]); + } + } + for (var i = 0; i < 16; i++) { + var index = getRandom(0, TasDuJEU.length - 1) + var dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + for (var j = 0; j < deckPartie.length; j++) { + if (TasDuJEU[index].identifiant == deckPartie[j].identifiant) { + dejaPresente = true; + } + } + while (dejaPresente == true) { + index = getRandom(0, TasDuJEU.length - 1) + dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + for (var j = 0; j < deckPartie.length; j++) { + if (TasDuJEU[index].identifiant == deckPartie[j].identifiant) { + dejaPresente = true; + } + } + } + + deckPartie.push(copieCarte(TasDuJEU[index])); + } + afficherCartes(deckPartie); +} + + +function genererTouteslesCartes3_3Possibles() { + deckPartie = []; + carteselect = []; + + while (document.getElementById("containcards").firstElementChild != null) { + document.getElementById("containcards").firstElementChild.remove(); + } + for (var i = 1; i < 9; i++) { + var AllFigure = []; + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, 0, 0)); + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, i % 3, Math.floor(i / 3))); + var uneCarte = new Carte(deckPartie.length + 1, AllFigure, 3, 3); + deckPartie.push(uneCarte); + var AllFigure = []; + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, 0, 0)); + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, i % 3, Math.floor(i / 3))); + var uneCarte = new Carte(deckPartie.length + 1, AllFigure, 3, 3); + deckPartie.push(uneCarte); + } + for (var i = 0; i < 9; i++) { + if (i != 3 && Math.floor(i / 3) != 2) { + var AllFigure = []; + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, 0, 1)); + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, i % 3, Math.floor(i / 3))); + var uneCarte = new Carte(deckPartie.length + 1, AllFigure, 3, 3); + deckPartie.push(uneCarte); + var AllFigure = []; + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, 0, 1)); + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, i % 3, Math.floor(i / 3))); + var uneCarte = new Carte(deckPartie.length + 1, AllFigure, 3, 3); + deckPartie.push(uneCarte); + } + } + for (var i = 0; i < 9; i++) { + if (i != 1 && (i % 3) != 2) { + var AllFigure = []; + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, 1, 0)); + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, i % 3, Math.floor(i / 3))); + var uneCarte = new Carte(deckPartie.length + 1, AllFigure, 3, 3); + deckPartie.push(uneCarte); + var AllFigure = []; + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, 1, 0)); + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, i % 3, Math.floor(i / 3))); + var uneCarte = new Carte(deckPartie.length + 1, AllFigure, 3, 3); + deckPartie.push(uneCarte); + } + } + for (var i = 0; i < 4; i++) { + if (i != 2) { + var AllFigure = []; + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, 1, 1)); + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, i % 3, Math.floor(i / 3))); + var uneCarte = new Carte(deckPartie.length + 1, AllFigure, 3, 3); + deckPartie.push(uneCarte); + var AllFigure = []; + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, 1, 1)); + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, i % 3, Math.floor(i / 3))); + var uneCarte = new Carte(deckPartie.length + 1, AllFigure, 3, 3); + deckPartie.push(uneCarte); + } + } + return deckPartie; + +} + +function creePartieClassique3_3() { + TasDuJEU = genererTouteslesCartes3_3Possibles(); + deckPartie = []; + for (var i = 0; i < TasDuJEU.length; i++) { + CodeRotation = getRandom(0, 3); + if (CodeRotation == 0) { + TasDuJEU[i] = TasDuJEU[i]; + } else if (CodeRotation == 1) { + TasDuJEU[i] = Horizontale(TasDuJEU[i]); + } else if (CodeRotation == 2) { + TasDuJEU[i] = Verticale(TasDuJEU[i]); + } else if (CodeRotation == 3) { + TasDuJEU[i] = Verticale(TasDuJEU[i]); + TasDuJEU[i] = Horizontale(TasDuJEU[i]); + } + } + for (var i = 0; i < 16; i++) { + var index = getRandom(0, TasDuJEU.length - 1) + var dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + for (var j = 0; j < deckPartie.length; j++) { + if (TasDuJEU[index].identifiant == deckPartie[j].identifiant) { + dejaPresente = true; + } + } + while (dejaPresente == true) { + index = getRandom(0, TasDuJEU.length - 1) + dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + for (var j = 0; j < deckPartie.length; j++) { + if (TasDuJEU[index].identifiant == deckPartie[j].identifiant) { + dejaPresente = true; + } + } + } + + deckPartie.push(copieCarte(TasDuJEU[index])); + } + afficherCartes(deckPartie); +} + +function genererTouteslesCartes3_4Possibles() { + deckPartie = []; + carteselect = []; + while (document.getElementById("containcards").firstElementChild != null) { + document.getElementById("containcards").firstElementChild.remove(); + } + + for (var j = 0; j < 2; j++) { + for (var i = 0; i < 12; i++) { + var AllFigure = []; + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, 0, j)); + if (i != 3 * j) { + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, i % 3, Math.floor(i / 3))); + var uneCarte = new Carte(deckPartie.length + 1, AllFigure, 4, 3); + deckPartie.push(uneCarte); + if (!doublonInterdit(uneCarte)) { + AllFigure = []; + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, 0, j)); + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, i % 3, Math.floor(i / 3))); + var unDoublon = new Carte(deckPartie.length + 1, AllFigure, 4, 3); + deckPartie.push(unDoublon); + } + } + } + } + for (var j = 0; j < 2; j++) { + for (var i = 0; i < 12; i++) { + var AllFigure = []; + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, 1, j)); + if (i != 3 * j + 1) { + if (i != 2 && i != 5 && i != 8 && i != 11) { + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, i % 3, Math.floor(i / 3))); + var uneCarte = new Carte(deckPartie.length + 1, AllFigure, 4, 3); + deckPartie.push(uneCarte); + if (!doublonInterdit(uneCarte)) { + AllFigure = []; + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, 1, j)); + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, i % 3, Math.floor(i / 3))); + var unDoublon = new Carte(deckPartie.length + 1, AllFigure, 4, 3); + deckPartie.push(unDoublon); + } + } + } + } + } + return deckPartie; +} + +function afficherCartes(Liste) { + while (document.getElementById("containcards").firstElementChild != null) { + document.getElementById("containcards").firstElementChild.remove(); + } + for (var i = 0; i < Liste.length; i++) { + document.getElementById("containcards").appendChild(copieCarte(Liste[i]).link); + } +} + +function creePartieClassique3_4() { + TasDuJEU = genererTouteslesCartes3_4Possibles(); + deckPartie = []; + for (var i = 0; i < TasDuJEU.length; i++) { + CodeRotation = getRandom(0, 3); + if (CodeRotation == 0) { + TasDuJEU[i] = TasDuJEU[i]; + } else if (CodeRotation == 1) { + TasDuJEU[i] = Horizontale(TasDuJEU[i]); + } else if (CodeRotation == 2) { + TasDuJEU[i] = Verticale(TasDuJEU[i]); + } else if (CodeRotation == 3) { + TasDuJEU[i] = Verticale(TasDuJEU[i]); + TasDuJEU[i] = Horizontale(TasDuJEU[i]); + } + } + for (var i = 0; i < 16; i++) { + var index = getRandom(0, TasDuJEU.length - 1) + var dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + for (var j = 0; j < deckPartie.length; j++) { + if (TasDuJEU[index].identifiant == deckPartie[j].identifiant) { + dejaPresente = true; + } + } + while (dejaPresente == true) { + index = getRandom(0, TasDuJEU.length - 1) + dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + for (var j = 0; j < deckPartie.length; j++) { + if (TasDuJEU[index].identifiant == deckPartie[j].identifiant) { + dejaPresente = true; + } + } + } + + deckPartie.push(copieCarte(TasDuJEU[index])); + } + afficherCartes(deckPartie); +} + +function creePartieInfini(nbRow, nbColum) { + deckPartie = []; + carteselect = []; + while (document.getElementById("containcards").firstElementChild != null) { + document.getElementById("containcards").firstElementChild.remove(); + } + for (var j = 1; j <= 16; j++) { + + var AllFigure = []; + var Cox1, Coy1, Cox2, Coy2; + + Cox1 = getRandom(0, nbColum - 1); + Coy1 = getRandom(0, nbRow - 1); + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, Cox1, Coy1)); + + Cox2 = getRandom(0, nbColum - 1); + Coy2 = getRandom(0, nbRow - 1); + + while (Cox2 == Cox1 && Coy1 == Coy2) { + Cox2 = getRandom(0, nbColum - 1); + Coy2 = getRandom(0, nbRow - 1); + } + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, Cox2, Coy2)); + //Code de Generation de Figure + var uneCarte = new Carte(j, AllFigure, nbRow, nbColum); + + deckPartie.push(uneCarte); + + document.getElementById("containcards").appendChild(uneCarte.link); + } +} + +//======================================================================================================================================================== +//Changer les cartes et Changer les cartes de Tas de jeu + +function changerlesCartesDeTasDeJeu() { + while (carteselect.length != 0) { + var unIndex = TasDuJEU.indexOf(carteselect[0]); + TasDuJEU.splice(unIndex, 1); + if (TasDuJEU.length > 16) { + var index2 = getRandom(0, TasDuJEU.length - 1) + var dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + for (var j = 0; j < deckPartie.length; j++) { + if (TasDuJEU[index2].identifiant == deckPartie[j].identifiant) { + dejaPresente = true; + } + } + while (dejaPresente == true) { + index2 = getRandom(0, TasDuJEU.length - 1) + dejaPresente = false;//Permet de savoir si la carte est deja dans la liste + for (var j = 0; j < deckPartie.length; j++) { + if (TasDuJEU[index2].identifiant == deckPartie[j].identifiant) { + dejaPresente = true; + } + } + } + unIndex = deckPartie.indexOf(carteselect[0]); + deckPartie[unIndex] = TasDuJEU[index2]; + } else { + unIndex = deckPartie.indexOf(carteselect[0]); + deckPartie.splice(unIndex, 1); + } + carteselect.shift(); + } + afficherCartes(deckPartie); +} + + + +function changerlesCartes() { + while (carteselect.length != 0) { + remplacerLaCarte(carteselect[0]); + carteselect.shift(); + } + rechargerGAME(); +} + +function remplacerLaCarte(uneCarte) { + pos = deckPartie.indexOf(uneCarte); + var AllFigure = []; + var Cox1, Coy1, Cox2, Coy2; + + Cox1 = getRandom(0, uneCarte.column - 1); + Coy1 = getRandom(0, uneCarte.row - 1); + AllFigure.push(new Figure(new Array(TypeFigure.Petit), FormeFigure.Rond, Cox1, Coy1)); + + Cox2 = getRandom(0, uneCarte.column - 1); + Coy2 = getRandom(0, uneCarte.row - 1); + + while (Cox2 == Cox1 && Coy1 == Coy2) { + Cox2 = getRandom(0, uneCarte.column - 1); + Coy2 = getRandom(0, uneCarte.row - 1); + } + AllFigure.push(new Figure(new Array(TypeFigure.Moyen), FormeFigure.Rond, Cox2, Coy2)); + //Code de Generation de Figure + var newCarte = new Carte(pos + 1, AllFigure, uneCarte.row, uneCarte.column); + deckPartie[pos] = newCarte; +} + +//==================================================================================== +//GESTION DE MATRICE + +function somMatrice(matrice1, matrice2, row, column) { + var somMatrice = creaMatriceVierge(row, column); + for (var i = 0; i < column; i++) { + for (var j = 0; j < row; j++) { + somMatrice[i][j] = matrice1[i][j] + matrice2[i][j]; + } + } + return somMatrice; +} + +function copieMatrice(laMatrice, row, column) { + var myMatrice = new Array(); + for (var i = 0; i < column; i++) { + myMatrice[i] = new Array(); + for (var j = 0; j < row; j++) { + myMatrice[i][j] = laMatrice[i][j]; + } + } + return myMatrice; +} + +function getRandom(min, max) { + return Math.round(Math.random() * (max - min) + min) +} + +function creaMatriceVierge(row, column) { + var myMatrice = new Array(); + for (var i = 0; i < column; i++) { + myMatrice[i] = new Array(); + for (var j = 0; j < row; j++) { + myMatrice[i][j] = 0; + } + } + return myMatrice; +} + +function creaMatrice(row, column) { + + var myMatrice = creaMatriceVierge(row, column); + //window.alert(myMatrice) + + var Cox1, Coy1, Cox2, Coy2; + + Cox1 = getRandom(0, column - 1); + Coy1 = getRandom(0, row - 1); + + myMatrice[Cox1][Coy1] = 1; + + Cox2 = getRandom(0, column - 1); + Coy2 = getRandom(0, row - 1); + + while (Cox2 == Cox1 && Coy1 == Coy2) { + Cox2 = getRandom(0, column - 1); + Coy2 = getRandom(0, row - 1); + } + myMatrice[Cox2][Coy2] = 2; + + return myMatrice; + +} + +//================================================================================= +//chercheCombi => Compte les combinainsons de 2 à 5 cartes a l'ecran +//Pour changer le nombre de carte maximum dans une liste il faut changer la valeur max de N + +function chercherCombinaison() { + var Cptsolution = 0; + /* + Pour toutes les longueurs possible d’un tas de carte (N = 0, N<4 ; N++) + Pour toutes les échantillon de cartes ( i = 0 ; i<16 – N ; i ++) + Pour toutes les autres cartes (j=0 ;j<15-i-N ;j++) + DeckTest = vide ; + DeckTest.push(DeckPartie[i]) + Pour N + 2 cartes (k=1 ;k<2+N ;k++) + DeckTest.push(DeckPartie[i+k+j]) + Tab = AssemblageArbre(copie(Decktest) , Decktest[0]) + Pour toutes les valeurs de tab + Si tab[m] == N+2 + //Woula j’ai trouvé*/ + for (var N = 0; N < 4; N++) { + for (var i = 0; i < 16 - N; i++) { + for (var j = 0; j < 15 - i - N; j++) { + var DeckTeste = []; + var tabCode = []; + var tab = []; + var copie = []; + DeckTeste.push(deckPartie[i]); + for (var k = 1; k < N + 2; k++) { + DeckTeste.push(deckPartie[i + k + j]) + } + tab = AssemblageARBRE(copieListeDeCarte(DeckTeste), copieCarte(DeckTeste[0])); + + //Recupération de code + + var solution = true; + for (var h = 0; h < tab.length; h++) { + tabCode.push(tab[h].code); + } + //Reagarde si il y a une solution + for (var g = 0; g < tab.length; g++) { + if (tab[g].code == DeckTeste.length) { + solution = false; + } + } + //Reagarde si il y a une solution + if (!solution) { + Cptsolution++; + var recup = []; + for (var h = 0; h < DeckTeste.length; h++) { + recup.push(deckPartie.indexOf(DeckTeste[h]) + 1); + } + if(!modelangue){ + window.alert("Combinaison a " + (N + 2) + " cartes trouvée : " + recup); + } + else{ + window.alert("Combination with " + (N + 2) + " cards found : " + recup); + } + + } + } + } + } + if(!modelangue){ + window.alert("Nombre de combinaison: " + Cptsolution); + } + else{ + window.alert("Number of combination: " + Cptsolution); + } + +} + +function testPertinent() { + //test(); + offreSWISH = true; + lesPoints -= 5; + document.getElementById("affPoints").textContent = 'Score : ' + lesPoints; + var allComb = 0; + //window.alert("Voici ce que j'ai trouvé, mais voulez vous booster mes recherches ?") + console.log("===============!!!! BOOST !!!!=============") + for (var i = 2; i < 6; i++) { + var tabCheck = []; + for (var j = 0; j < deckPartie.length - i + 1; j++) { + var tab = recherchePertinente(i, j, j); + for (var m = 0; m < tab.length; m++) { + tabCheck.push(tab[m]); + } + + } + //console.log("J'ai tout les ensembles pour " + i + " cartes " + tabCheck.length) + var tabInte = comparaisonEmpilement(tabCheck, 0); + //console.log("nouveau tableau avec " + tabInte.length) + var comb = 0; + comb = testAllEnsemble(tabInte); + if (comb > 0 && i >= 3) { + return; + } + allComb += comb; + } + console.log("nb combi : " + allComb) + window.alert("Et voilà ! J'ai finis !") +} + +function comparaisonEmpilement(liste, debut) { + if (debut >= liste.length - 1) { + return liste; + } + var tabPropre = []; + for (var j = 0; j <= debut; j++) { + tabPropre.push(liste[j]); + } + var sommeCarreEle = sommeCarreElement(liste[debut].ensemble); + for (var i = debut + 1; i < liste.length; i++) { + if (sommeCarreEle != sommeCarreElement(liste[i].ensemble)) { + tabPropre.push(liste[i]); + } else { + //console.log("==========DOUBLON==========") + //console.log(sommeCarreEle + " ===== " + sommeCarreElement(liste[i].ensemble)) + } + } + //console.log(tabPropre.length + " ========== " + liste.length) + var tabRetour = comparaisonEmpilement(tabPropre, debut + 1); + return tabRetour; +} +function sommeCarreElement(element) { + var sommeCarre = 0; + for (var i = 0; i < element.length; i++) { + sommeCarre += Math.pow(2, element[i]); + } + return sommeCarre; +} + +function selectionAuto(liste) { + while (carteselect.length != 0) { + var id = "card" + carteselect[0].identifiant; + document.getElementById(id).style.boxShadow = ""; + carteselect.splice(0, 1); + } + for (var i = 0; i < liste.length; i++) { + var id = "card" + deckPartie[liste[i]].identifiant; + document.getElementById(id).style.boxShadow = "0 0 1vw red, 0 0 1vw red"; + carteselect.push(deckPartie[liste[i]]); + } +} + +function testAllEnsemble(liste) { + var tabCode = []; + var compteur = 0; + for (var i = 0; i < liste.length; i++) { + var lesCartes = []; + for (var j = 0; j < liste[i].ensemble.length; j++) { + lesCartes.push(deckPartie[liste[i].ensemble[j]]); + } + var tab = AssemblageARBRE(copieListeDeCarte(lesCartes), copieCarte(lesCartes[0])); + //Recupération de code + var solution = true; + for (var h = 0; h < tab.length; h++) { + tabCode.push(tab[h].code); + } + //Reagarde si il y a une solution + for (var g = 0; g < tab.length; g++) { + if (tab[g].code == lesCartes.length) { + solution = false; + } + } + //Reagarde si il y a une solution + if (!solution) { + selectionAuto(liste[i].ensemble); + //console.log("==========================") + if(!modelangue){ + console.log("Combinaison à " + (lesCartes.length) + " cartes trouvée : " + liste[i].ensemble); + } + else { + console.log("Combination with " + (lesCartes.length) + " cards found : " + liste[i].ensemble); + } + + compteur++; + //console.log(sommeCarreElement(liste[i].ensemble)) + } + } + return compteur; +} + +class Ensemble { + constructor(valeur, index) { + this.v = valeur; + this.ensemble = []; + this.ensemble.push(index); + } +} + +function recherchePertinente(nbCarte, debut, carte) { + tabRetour = []; + nbCarte = nbCarte - 1; + + //Si il n'y a plus de carte à ajouter dans l'ensemble on regarde si la boucle de peut se boucler + if (nbCarte == 0) { + var laPremiereCarte = deckPartie[debut]; + for (var i = 0; i < deckPartie[carte].SesFigures.length; i++) { + for (var j = 0; j < laPremiereCarte.SesFigures.length; j++) { + if (deckPartie[carte].SesFigures[i].type[0] == TypeFigure.Petit && laPremiereCarte.SesFigures[j].type[0] == TypeFigure.Moyen) { + if (deckPartie[carte].SesFigures[i].couleur == laPremiereCarte.SesFigures[j].couleur) { + tabRetour.push(new Ensemble(0, carte)); + return tabRetour; + } else { + tabRetour.push(new Ensemble(-1, carte)); + return tabRetour; + } + } + } + } + } + + //On recupère tout les index des cartes pouvant compléter le point de la carte à l'index "carte" + for (var i = 0; i < deckPartie[carte].SesFigures.length; i++) { + if (deckPartie[carte].SesFigures[i].type[0] == TypeFigure.Petit) { + var lePoint = deckPartie[carte].SesFigures[i]; + } + } + var listeCarteComp = carteComplementaire(lePoint, debut); + //Si la liste de carte complémentaire est vide alors on retourne un code d'erreur + if (listeCarteComp.length == 0) { + tabRetour.push(new Ensemble(-1, carte)); + return tabRetour; + } + + //Sinon pour chaque index de carte complémentaire on continue la recherche pertinente + var tabPropre = []; + for (var i = 0; i < listeCarteComp.length; i++) { + var tab = []; + var unTabEnsemble = []; + tab.push(recherchePertinente(nbCarte, debut, listeCarteComp[i])); + + for (var k = 0; k < tab[0].length; k++) { + unTabEnsemble.push(tab[0][k]); + } + + for (var j = 0; j < unTabEnsemble.length; j++) { + if (unTabEnsemble[j].v == 0) { + var present = false; + for (var m = 0; m < unTabEnsemble[j].ensemble.length; m++) { + if (unTabEnsemble[j].ensemble[m] == carte) { + present = true; + } + } + if (!present) { + unTabEnsemble[j].ensemble.push(carte); + tabPropre.push(unTabEnsemble[j]); + } + } + } + + } + + return tabPropre; + + + +} + +function carteComplementaire(figure, debut) { + var retour = []; + //Pour toutes les cartes de deckpartie après la carte de début, on regarde les ronds des cartes et on regarde leurs couleurs pour les faire remonter. + for (var i = debut + 1; i < deckPartie.length; i++) { + for (var j = 0; j < deckPartie[i].SesFigures.length; j++) { + if (deckPartie[i].SesFigures[j].type[0] == TypeFigure.Moyen) { + if (deckPartie[i].SesFigures[j].couleur == figure.couleur) { + retour.push(i); + } + } + } + } + return retour; +} + +function test() { + printCombinations([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], 12); +} + +function printCombinations(array, p) { + var combinations = []; + var Cptsolution = 0; + for (k = 2; k < p + 1; k++) { + + function run(level, start) { + for (var i = start; i < array.length - k + level + 1; i++) { + combinations[level] = array[i]; + //console.log(i); + if (level < k - 1) { + + run(level + 1, i + 1); + } else { + + var combTest = []; + for (var j = 0; j < combinations.length; j++) { + combTest.push(deckPartie[combinations[j]]); + //window.alert("Matrice ajouté num" + j + " :" + deckPartie[combinations[j]].getMatrice); + console.log("i" + j + " :" + combinations[j]); + } + console.log("matrice début ex: " + combTest[0].getMatrice); + console.log("Cartes selectionnées :(en partant de indice 0) :") + console.log(combinations.join(" ")); + console.log("----- taille :" + combTest.length + " -------"); + + var cpt = testCombinaison(combTest, combinations, Cptsolution); + Cptsolution = cpt; + } + } + } + run(0, 0); + + if(!modelangue){ + window.alert("fin test " + k + " cartes") + } + else{ + window.alert("end test " + k + " cards") + } + + + } + window.alert("nb combi :" + Cptsolution); +} + + +function testCombinaison(DeckTeste, combi, Cptsolution) { + var tabCode = []; + var tab = []; + //window.alert("---------------"); + tab = AssemblageARBRE(copieListeDeCarte(DeckTeste), copieCarte(DeckTeste[0])); + + //Recupération de code + var solution = true; + for (var h = 0; h < tab.length; h++) { + tabCode.push(tab[h].code); + } + //Reagarde si il y a une solution + for (var g = 0; g < tab.length; g++) { + if (tab[g].code == DeckTeste.length) { + solution = false; + } + } + //Reagarde si il y a une solution + if (!solution) { + Cptsolution++; + if(!modelangue){ + window.alert("Combinaison à " + (DeckTeste.length) + " cartes trouvée : " + combi); + } + else{ + window.alert("Combination with " + (DeckTeste.length) + " cards found : " + combi); + } + + } + return Cptsolution; +} + +function chercheCombi2() { + + var Cptsolution = 0; + for (var i = 0; i < 15; i++) { + + for (var j = 0; j < 15 - i; j++) { + + var DeckTeste = []; + var tabCode = []; + var tab = []; + var copie = []; + copie.splice(0, DeckTeste.length); + DeckTeste.splice(0, DeckTeste.length); + tab.splice(0, DeckTeste.length); + tabCode.splice(0, DeckTeste.length); + + DeckTeste.push(copieCarte(deckPartie[i])); + DeckTeste.push(copieCarte(deckPartie[j + i + 1])); + + + for (var h = 0; h < DeckTeste.length; h++) { + copie.push(DeckTeste[i]); + } + + tab = AssemblageARBRE(copieListeDeCarte(DeckTeste), copieCarte(DeckTeste[0])); + + var solution = true; + + + for (var h = 0; h < tab.length; h++) { + tabCode.push(tab[h].code); + } + + for (var g = 0; g < tab.length; g++) { + if (tab[g].code == DeckTeste.length) { + solution = false; + } + } + if (!solution) { + Cptsolution++; + if(!modelangue){ + window.alert("Combinaison a 2 trouve: " + (i + 1) + " " + (i + j + 2)); + } + else{ + window.alert("Combination with 2 found: " + (i + 1) + " " + (i + j + 2)); + } + + } + } + } + if(!modelangue){ + window.alert("Nombre de solution a 2 cartes : " + Cptsolution); + } + else{ + window.alert("Number of solutions with 2 cards : " + Cptsolution); + } + +} + +//================================================================================= +//chercheCombi => Compte les combinainsons de 3 cartes a l'ecran +function chercheCombi3() { + var Cptsolution = 0; + for (var i = 0; i < 15; i++) { //Partie fixe + + for (var j = 0; j < 15 - i; j++) { //Partie movible 1 + + for (var k = 0; k < 15 - j; k++) { //Partie movible 2 + + + var DeckTeste = []; + var tabCode = []; + var tab = []; + var copie = []; + copie.splice(0, DeckTeste.length); + DeckTeste.splice(0, DeckTeste.length); + tab.splice(0, DeckTeste.length); + tabCode.splice(0, DeckTeste.length); + + DeckTeste.push(deckPartie[i]); + DeckTeste.push(deckPartie[j + i + 1]); + DeckTeste.push(deckPartie[k + j + i + 2]); + + for (var h = 0; h < DeckTeste.length; h++) { + copie.push(DeckTeste[i]); + } + + for (var z = 0; z < DeckTeste; z++) { + if (DeckTeste[z] == null) { + window.alert("Pb carte null :" + i + j + k); + } + } + + tab = AssemblageARBRE(copieListeDeCarte(DeckTeste), copieCarte(DeckTeste[0])); + var solution = true; + + for (var h = 0; h < tab.length; h++) { + tabCode.push(tab[h].code); + } + + + + var DeckTeste = []; + var tabCode = []; + var tab = []; + var copie = []; + copie.splice(0, DeckTeste.length); + DeckTeste.splice(0, DeckTeste.length); + tab.splice(0, DeckTeste.length); + tabCode.splice(0, DeckTeste.length); + + DeckTeste.push(deckPartie[i]); + DeckTeste.push(deckPartie[j + i + 1]); + DeckTeste.push(deckPartie[k + j + i + 2]); + + for (var h = 0; h < DeckTeste.length; h++) { + copie.push(DeckTeste[i]); + } + + for (var z = 0; z < DeckTeste; z++) { + if (DeckTeste[z] == null) { + window.alert("Pb carte null :" + i + j + k); + } + } + + tab = AssemblageARBRE(copieListeDeCarte(DeckTeste), copieCarte(DeckTeste[0])); + var solution = true; + + for (var h = 0; h < tab.length; h++) { + tabCode.push(tab[h].code); + } + + + for (var g = 0; g < tab.length; g++) { + if (tab[g].code == DeckTeste.length) { + solution = false; + } + } + if (!solution) { + Cptsolution++; + if(!modelangue){ + window.alert("Combinaison a 3 trouve: " + (i + 1) + " " + (i + j + 2) + " " + (k + j + i + 3)); + } + else{ + window.alert("Combination with 3 found: " + (i + 1) + " " + (i + j + 2) + " " + (k + j + i + 3)); + } + + } + goRefresh(); + } + } + } + if (Cptsolution == 0) { + if(!modelangue){ + window.alert("Pas de solution"); + } + else{ + window.alert("No solution"); + } + + } + if(!modelangue){ + window.alert("Nombre de solution a 3 cartes : " + Cptsolution); + } + else{ + window.alert("Number of solutions with 3 cards : " + Cptsolution); + } + +} +//============================================================================================= +//Fonction pour refresh l'affichage + +var compteurRefresh = 50; +var refreshJ; + +function goRefresh() { + compteurRefresh = 50; + refresh(); +} + +function refresh() { + //console.log(compteurRefresh) + if (compteurRefresh > 0) { + compteurRefresh--; + refreshJ = setTimeout("refresh()", 100); + } + + else { + clearTimeout(refreshJ); + } + + if (compteurRefresh == 0) { + document.getElementById("affSolution").textContent = ""; + } +} + +//===================================================================== +//Fonctions permettant d'aider le joueur au bout d'un certain temps + + +var compteurAide = 300; + +function rechercheAide() { + var allComb = 0; + //window.alert("Voici ce que j'ai trouvé, mais voulez vous booster mes recherches ?") + console.log("===============!!!! BOOST !!!!=============") + for (var i = 2; i < 6; i++) { + var tabCheck = []; + for (var j = 0; j < deckPartie.length - i + 1; j++) { + var tab = recherchePertinente(i, j, j); + for (var m = 0; m < tab.length; m++) { + tabCheck.push(tab[m]); + } + + } + //console.log("J'ai tout les ensembles pour " + i + " cartes " + tabCheck.length) + var tabInte = comparaisonEmpilement(tabCheck, 0); + //console.log("nouveau tableau avec " + tabInte.length) + var comb = 0; + comb = testAllEnsemble(tabInte); + if (comb > 0) { + return; + } + allComb += comb; + } + if (deckPartie.length < 16 && comb == 0) { + if (!modelangue) { + window.alert("Fin de partie !"); + document.getElementById("HighscorePage").style.display = "block"; + } else { + window.alert("Game Over !"); + document.getElementById("HighscorePage").style.display = "block"; + + } + + clearInterval(itv); + } else if (deckPartie.length >= 16 && comb == 0) { + lesPoints += 5; + redistribuerPlateau(); + } + console.log("nb combi : " + allComb) +} + +var aideJ; + +function goAide() { + compteurAide = 300; + aide(); +} + +function aide() { + console.log(compteurAide) + if (compteurAide > 0) { + compteurAide--; + aideJ = setTimeout("aide()", 100); + } + + else { + clearTimeout(aideJ); + } + + if (compteurAide == 0) { + rechercheAide(); + } +} + + + +//================================================================================= +//FONCTION DE TEST => permet de tester des fonctionnalite via le bouton VALIDER + + +var cpt = 1100; +var x; +var itv = 0; + +function decompte() { + + //var progressnum = document.getElementById("progressnum"); + var indicateur = document.getElementById("indicateur"); + + if (cpt >= 0) { + + cpt--; + x = setTimeout("decompte()", 100); + } + + else { + clearTimeout(x); + } + + if (cpt == 0) { + if(!modelangue){ + window.alert("fin du jeu"); + document.getElementById("HighscorePage").style.display = "block"; + } + else{ + window.alert("Game Over"); + document.getElementById("HighscorePage").style.display = "block"; + } + clearInterval(itv); + } + + if (cpt < 550) { + document.getElementById("indicateur").style.backgroundColor = "orange"; + + } + + if (cpt < 366) { + document.getElementById("indicateur").style.backgroundColor = "red"; + } + + indicateur.style.width = cpt + "px"; + //progressnum.innerHTML = cpt; +} + +function testerLesCartes() { + + if (selectionMode == 0) { + goAide(); + testPourJeuClassique(); + } else if (selectionMode == 1 || selectionMode==2) { + goAide(); + testPourJeuInfini(); + } + if( selectionMode == 4){ + testerCartesMulti(); + } +} + + +function testPourJeuInfini() { + try { + if (carteselect.length == 0) { + if(!modelangue){ + window.alert("Selection Vide"); + } + else{ + window.alert("Empty selection"); + } + + return; + } else if (carteselect.length < 2) { + if(!modelangue){ + window.alert("Selection Trop Petite"); + } + else{ + window.alert("Selection Too Small"); + } + + return; + } else { + var copie = []; + for (var i = 0; i < carteselect.length; i++) { + copie.push(copieCarte(carteselect[i])); + } + var tab = []; + tab = AssemblageARBRE(copieListeDeCarte(copie), copieCarte(carteselect[0])); + var solution = true; + var tabCode = []; + for (var i = 0; i < tab.length; i++) { + tabCode.push(tab[i].code); + } + for (var i = 0; i < tab.length; i++) { + if (tab[i].code == carteselect.length) { + solution = false; + if (offreSWISH) { + offreSWISH = false; + } else { + lesPoints += carteselect.length; + } + document.getElementById("affPoints").textContent = 'Score : ' + lesPoints; + if (selectionDiemension == 2) { + changerlesCartes3_2(); + } else if (selectionDiemension == 3) { + changerlesCartes2_2(); + } else { + changerlesCartes(); + } + } + } + if (solution) { + if(!modelangue){ + document.getElementById("affSolution").textContent = 'Aucune solution trouvée...'; + } + else{ + document.getElementById("affSolution").textContent = 'No solutions found...'; + } + + } + if (!solution) { + if(!modelangue){ + document.getElementById("affSolution").textContent = 'Assemblage de ' + copie.length + ' cartes trouvé !'; + } + else{ + document.getElementById("affSolution").textContent = 'Assembly of ' + copie.length + ' cards found !'; + } + + } + goRefresh(); + } + } catch (e) { + window.alert(e); + } +} + +//Fonction de test mais pour le jeu classique + +function testPourJeuClassique() { + //try { + if (carteselect.length == 0) { + if(!modelangue){ + window.alert("Selection Vide test pour jeu classique"); + } + else{ + window.alert("Selection Empty test for classic game"); + } + + return; + } else if (carteselect.length < 2) { + if(!modelangue){ + window.alert("Selection Trop Petite"); + } + else{ + window.alert("Selection Too Small"); + } + + return; + } else { + var copie = []; + for (var i = 0; i < carteselect.length; i++) { + copie.push(copieCarte(carteselect[i])); + } + var tab = []; + tab = AssemblageARBRE(copie, copieCarte(carteselect[0])); + var solution = true; + var tabCode = []; + for (var i = 0; i < tab.length; i++) { + tabCode.push(tab[i].code); + } + for (var i = 0; i < tab.length; i++) { + if (tab[i].code == carteselect.length) { + solution = false; + cpt = cpt + 20 * copie.length; + if (offreSWISH) { + offreSWISH = false; + } else { + lesPoints += carteselect.length; + } + document.getElementById("affPoints").textContent = 'Score : ' + lesPoints; + changerlesCartesDeTasDeJeu(); + } + } + if (solution) { + if(!modelangue){ + document.getElementById("affSolution").textContent = 'Aucune solution trouvée...'; + } + else{ + document.getElementById("affSolution").textContent = 'No solutions found...'; + } + + } + if (!solution) { + if(!modelangue){ + document.getElementById("affSolution").textContent = 'Assemblage de ' + copie.length + ' cartes trouvé ! Il reste encore ' + TasDuJEU.length + ' cartes !'; + } + else{ + document.getElementById("affSolution").textContent = 'Assembly of ' + copie.length + ' cards found ! There are still ' + TasDuJEU.length + ' cards !'; + } + } + goRefresh(); + } + /*} catch (e) { + window.alert(e); + }*/ +} + +//=================================================================================== +//Function de copie diverse + +function copieListeDeCarte(Liste) { + var copie = []; + for (var i = 0; i < Liste.length; i++) { + copie.push(copieCarte(Liste[i])); + } + return copie; +} + +function copieCarte(uneCarte) { + if (uneCarte == null) { + return null; + } + var AllFigure = []; + for (var i = 0; i < uneCarte.SesFigures.length; i++) { + AllFigure.push(new Figure(uneCarte.SesFigures[i].type, uneCarte.SesFigures[i].forme, uneCarte.SesFigures[i].X, uneCarte.SesFigures[i].Y, uneCarte.SesFigures[i].couleur)); + } + var carte = new Carte(uneCarte.getIdentifiant, AllFigure, uneCarte.row, uneCarte.column); + carte.Matrice = copieMatrice(uneCarte.Matrice, uneCarte.row, uneCarte.column); + return carte; +} + +function copieLiseDeFigure(Liste) { + var copie = []; + for (var i = 0; i < Liste.length; i++) { + copie.push(copieFigure(Liste[i])); + window.alert("code " + copie[i].CodeHTML) + } + return copie; +} + +function copieFigure(uneFigure) { + if(!modelangue){ + window.alert("Avant copiage " + uneFigure.CodeHTML) + } + else{ + window.alert("Before copying " + uneFigure.CodeHTML) + } + + if (uneFigure == null) { + return null; + } + if(!modelangue){ + window.alert("je fais la copie"); + } + else{ + window.alert("I make the copy"); + } + + var copie = new Figure(uneFigure.type, uneFigure.forme, uneFigure.X, uneFigure.Y); + return copie; +} +//===================================================================================================== +//Function de manipulataion de Carte + +function Verticale(coCarte) { + var laCarte; + laCarte = copieCarte(coCarte); + laCarte = laCarte.carteVerticale; + return laCarte; +} + +function Horizontale(coCarte) { + var laCarte; + laCarte = copieCarte(coCarte); + laCarte = laCarte.carteHorizontale; + return laCarte; +} + +//============================================================================================================================== + +//FONCTION POUR TESTER L'ARBRE + +class CODE { + constructor(Carte) { + this.code = 0; + this.laCarte = Carte; + } +} + +function AssemblageARBRE(TasDeCarte, Carte) { + var uneTable = copieListeDeCarte(TasDeCarte); + var tab = new Array(); + var tabCode = new Array(); + uneTable.splice(0, 1); + if (uneTable.length == 0) { + var leCode = new CODE(Carte); + tab.push(leCode); + return tab; + } + tab.push(AssemblageARBRE(uneTable, copieCarte(uneTable[0]))); + tab.push(AssemblageARBRE(uneTable, Horizontale(copieCarte(uneTable[0])))); + tab.push(AssemblageARBRE(uneTable, Verticale(copieCarte(uneTable[0])))); + var derniereCarte = Horizontale(Verticale(copieCarte(uneTable[0]))); + tab.push(AssemblageARBRE(uneTable, derniereCarte)); + for (var i = 0; i < tab.length; i++) { + for (var j = 0; j < tab[i].length; j++) { + tabCode.push(tab[i][j]); + } + } + + for (var i = 0; i < tabCode.length; i++) { + if (tabCode[i].code != -1) { + var enregistrement = tabCode[i].code; + tabCode[i] = comparaisonARBRE(tabCode[i].laCarte, Carte); + tabCode[i].code += enregistrement; + } + } + return tabCode; +} + + +function comparaisonARBRE(CarteMereEntree, CarteFilleEntree) { + var retour = []; + var liaison = 0; + var CarteMere = copieCarte(CarteMereEntree); + var CarteFille = copieCarte(CarteFilleEntree); + for (var i = 0; i < CarteFille.SesFigures.length; i++) { + for (var j = 0; j < CarteMere.SesFigures.length; j++) { + if (CarteFille.SesFigures[i].X == CarteMere.SesFigures[j].X) { + if (CarteFille.SesFigures[i].Y == CarteMere.SesFigures[j].Y) { + //Coordonnees identiques + if (CarteFille.SesFigures[i].forme == CarteMere.SesFigures[j].forme) { + //Forme identiques + for (var k = 0; k < CarteMere.SesFigures[j].type.length; k++) { + if (CarteFille.SesFigures[i].couleur != CarteMere.SesFigures[j].couleur) {//Si les figures ne sont pas de la même couleur on stop la comparaison + var leCode = new CODE(CarteMere); + leCode.code = -1; + return leCode; + } + if (CarteFille.SesFigures[i].type[0] == TypeFigure.Petit) { + if (CarteMere.SesFigures[j].type[k] == TypeFigure.Petit) { + var leCode = new CODE(CarteMere); + leCode.code = -1; + return leCode; + } + } else if (CarteFille.SesFigures[i].type[0] == TypeFigure.Moyen) { + if (CarteMere.SesFigures[j].type[k] == TypeFigure.Moyen) { + var leCode = new CODE(CarteMere); + leCode.code = -1; + return leCode; + } + } else if (CarteFille.SesFigures[i].type[0] == TypeFigure.Grand) { + if (CarteMere.SesFigures[j].type[k] == TypeFigure.Grand) { + var leCode = new CODE(CarteMere); + leCode.code = -1; + return leCode; + } + } + } + //Si le type de la figure n'y est pas on l'ajoute a la liste de carte Mere; + liaison = liaison + 1; + CarteMere.SesFigures[j].type.push(CarteFille.SesFigures[i].type[0]); + } else { + var leCode = new CODE(CarteMere); + leCode.code = -1; + return leCode; + } + } + } + } + } + var CarteSomme = SommeDeCarte(CarteMere, copieCarte(CarteFille)); + var leCode = new CODE(CarteSomme); + leCode.code = liaison; + return leCode; +} + +function SommeDeCarte(CarteMere, CarteFille) { + CarteMere.Matrice = creaMatriceVierge(CarteMere.row, CarteMere.column); + for (var i = 0; i < CarteFille.SesFigures.length; i++) { + var manquant = true; + for (var j = 0; j < CarteMere.SesFigures.length; j++) { + if (CarteFille.SesFigures[i].X == CarteMere.SesFigures[j].X) { + if (CarteFille.SesFigures[i].Y == CarteMere.SesFigures[j].Y) { + manquant = false; + } + } + } + if (manquant) { + CarteMere.SesFigures.push(CarteFille.SesFigures[i]); + } + } + + for (var i = 0; i < CarteMere.SesFigures.length; i++) { + for (var j = 0; j < CarteMere.SesFigures[i].type.length; j++) { + if (CarteMere.SesFigures[i].type[j] == TypeFigure.Petit) { + CarteMere.Matrice[CarteMere.SesFigures[i].X][CarteMere.SesFigures[i].Y] += 1; + } else if (CarteMere.SesFigures[i].type[j] == TypeFigure.Moyen) { + CarteMere.Matrice[CarteMere.SesFigures[i].X][CarteMere.SesFigures[i].Y] += 2; + } else if (CarteMere.SesFigures[i].type[j] == TypeFigure.Grand) { + CarteMere.Matrice[CarteMere.SesFigures[i].X][CarteMere.SesFigures[i].Y] += 4; + } + } + } + return CarteMere; +} + +//================================================================================================================================ + +//================================================================================== + + + + +function doublonInterdit(uneCarte) { + var lesCoPetit = []; + lesCoPetit.push([1, 1], [1, 1], [1, 2], [1, 2], [1, 1], [2, 2], [1, 1], [2, 1], [1, 2], [2, 2], [1, 2], [2, 1]); + var lesCoMoyens = []; + lesCoMoyens.push([2, 1], [3, 3], [1, 1], [3, 4], [2, 3], [1, 4], [1, 2], [1, 1], [2, 3], [1, 3], [2, 4], [1, 3]); + for (var i = 0; i < lesCoPetit.length; i++) { + if (uneCarte.SesFigures[0].X == (lesCoPetit[i][0]) - 1) { + if (uneCarte.SesFigures[0].Y == (lesCoPetit[i][1]) - 1) { + if (uneCarte.SesFigures[1].X == (lesCoMoyens[i][0]) - 1) { + if (uneCarte.SesFigures[1].Y == (lesCoMoyens[i][1]) - 1) { + return true; + } + } + } + } + } + return false; +} + +function bacASable() { + majSizeCard(3); + var lesCartes = []; + + var LesFigure = []; + var uneFigure = new Figure(TypeFigure.Petit, FormeFigure.Rond, 0, 0, CouleurFigure.Couleur1); + LesFigure.push(uneFigure); + var uneFigure = new Figure(TypeFigure.Petit, FormeFigure.Rond, 1, 0, CouleurFigure.Couleur2); + LesFigure.push(uneFigure); + var uneCarte = new Carte(1, LesFigure, 3, 2); + + lesCartes.push(uneCarte); + + afficherCartes(lesCartes); +} + + + +function functionLange(){ + //window.alert(modelangue); + console.log(modelangue); + if(modelangue){ + modelangue = false; + //MODE FRANCAIS ======= + document.getElementById('flag_top').src = "imgs/flags/flag-france.png"; + document.getElementById('flag_top2').src = "imgs/flags/flag-france.png"; + + document.getElementById('textjouerr').innerHTML = 'JOUER'; + + //Traduction classement + document.getElementById('classementtxtTimer').textContent = 'Classement - Timer'; + document.getElementById('classementtxtMatch').textContent = 'Classement - Match à Point'; + + //Traduction paramètres + document.getElementById('SettingName').textContent = 'Paramètres'; + + //Tradcution des règles + document.getElementById('lesRegles').textContent = 'Les Règles'; + document.getElementById('textRules').textContent = 'Swish : Jeu de 60 cartes composé chacun de billes et de cerceaux, de 4 couleurs différentes possibles. 16 cartes sont posées sur une table et le joueur doit faire superposer des cartes de manière que chaque bille soit dans le cerceau de même couleur d’une autre carte.'; + + document.getElementById("textmode").textContent = "" + allModeFrench[selectionMode] + } + + else{ + modelangue = true; + //MODE ANGLAIS ======== + document.getElementById('flag_top').src = "imgs/flags/flag-uk.png"; + document.getElementById('flag_top2').src = "imgs/flags/flag-uk.png"; + + document.getElementById('textjouerr').innerHTML = 'PLAY'; + + //Traduction classement + document.getElementById('classementtxtTimer').textContent = 'Ranking - Timer'; + document.getElementById('classementtxtMatch').textContent = 'Ranking - Point Match'; + + //Traduction paramètres + document.getElementById('SettingName').textContent = 'Settings'; + + + + //Traduction des règles + document.getElementById('lesRegles').textContent = 'The Rules'; + document.getElementById('textRules').textContent = 'Swish : Set of 60 cards each composed of balls and hoops, 4 different colors possible. 16 cards are placed on a table and the player has to lay cards on top of each other in such a way that each ball is in the same color hoop as another card.' + + document.getElementById("textmode").textContent = "" + allModeEngl[selectionMode] + + } +} + +function recuphighscore(){ + var nom = document.getElementById('nom').value; + + var score = lesPoints; + $.ajax({ + type: "POST", + url: "ajouterScore.php", + data: { + score : score, + nom: nom, + modeJeu : selectionMode + }, + success: function(data){ + if(data == 1) + alert("requête effectuée "); + else + alert("retapez votre nom svp"); + } + }); + +} + +function reloadAfterHS(){ + retour(); + window.location.reload(); + +} + diff --git a/SwichGIT/src/js/menu.js b/SwichGIT/src/js/menu.js new file mode 100644 index 0000000..f81a993 --- /dev/null +++ b/SwichGIT/src/js/menu.js @@ -0,0 +1,114 @@ +var FormeSelect = ["rond"]; +var ListeCouleur = ["colorbase","colorcarre","colorone","colortwo"]; +var ListeCouleurModif = ["colorseven","coloreight","colornine","colorten","colorthree","colorfour","colorfive","colorsix"]; +var ListeClassForme = ["rond","carre","triangle","croix","losange","penta","hexa","hocto"]; + +//3 modes : 0 = couleurs // 1 = formes // 2 = personnaliser les cartes +var mode = 0; +var valRange; + +function ableCache(formName){ + cacheName = "cache"+formName; + const pos = FormeSelect.indexOf(formName); + if (pos > -1) { + FormeSelect.splice(pos, 1); + } + document.getElementById(cacheName).style.display = "block"; +} + +function disableCache(formName){ + if (FormeSelect.length < 4) + { + cacheName = "cache"+formName; + document.getElementById(cacheName).style.display = "none"; + FormeSelect.push(formName); + for(const form in ListeClassForme){ + //si la couleur est dans la liste selectionnée + if(formName == ListeClassForme[form]){ + //recuperer la position de la couleur dans laquel on va le mettre + var positionColor = FormeSelect.length - 1; + var recupCouleur = getComputedStyle(document.body).getPropertyValue('--'+ListeCouleurModif[form]); + var dansQuelCouleur = '--'+ListeCouleur[positionColor]; + + document.documentElement.style.setProperty(dansQuelCouleur, recupCouleur); + + console.log("Couleur "+ recupCouleur +" mettre dans : " + dansQuelCouleur); + } + } + } +} + +function changeContour(value){ + var newvalue = value * 0.055 + 1; + document.documentElement.style.setProperty('--z', newvalue+'vw'); + var valcard = value * 0.013 + 1; + document.documentElement.style.setProperty('--n', valcard+'vw'); + //document.documentElement.style.setProperty('--n', newvalue+'vw'); + //document.getElementById("SettingName").innerHTML = newvalue; +} + +function getVarColor(color){ + var getvar = color; + getvar = getvar.substring(6,getvar.length-1); + + return getvar; +} + +function varColorToHex(color){ + hex = getComputedStyle(document.documentElement).getPropertyValue(color); + hex = hex.substring(1,hex.length); + return hex; +} + +function settingOpen(){ + //document.getElementById("iddelapartie").style.visibility = "hidden"; + var elements = document.getElementsByClassName("pcr-button"); + for (var i = 0; i < elements.length; i++) { + elements[i].classList.add(ListeClassForme[i]); + } + recupCookies(); +} + +function SettingClose(){ + //save cookies + document.cookie = "forme1="+FormeSelect[1]+";secure"; + document.cookie = "forme2="+FormeSelect[2]+";secure"; + document.cookie = "forme3="+FormeSelect[3]+";secure"; + + afficherCartes(deckPartie); + +} + +function recupCookies(){ + var theCookies = document.cookie.split(';'); + theCookies[0] = ' '+theCookies[0]; + var FormeCookie = []; + + for(var i = 1; i <= theCookies.length; i++){ + var aString = theCookies[i-1].substring(8); + if(aString != "undefined"){ + FormeCookie.push(aString); + } + } + + for(const form in FormeCookie) + { + if(FormeSelect.indexOf(FormeCookie[form]) < 0){ + disableCache(FormeCookie[form]); + } + } + + console.log(FormeCookie); + console.log("Formes select : "+FormeSelect); + +} + +function affichageParamMulti(num){ + //si 1 affichage, si 0 on cachell + if(num == 1){ + document.getElementById("multiParams").style.display = "block"; + } else { + document.getElementById("multiParams").style.display = "none"; + } +} + diff --git a/SwichGIT/src/mysqlitedb.db b/SwichGIT/src/mysqlitedb.db new file mode 100644 index 0000000..b1cc78f Binary files /dev/null and b/SwichGIT/src/mysqlitedb.db differ diff --git a/SwichGIT/src/test.php b/SwichGIT/src/test.php new file mode 100644 index 0000000..e1ec199 --- /dev/null +++ b/SwichGIT/src/test.php @@ -0,0 +1,4 @@ +