diff --git a/site/css/style.css b/site/css/style.css index 8384f2d..78d33c6 100644 --- a/site/css/style.css +++ b/site/css/style.css @@ -24,7 +24,7 @@ margin-top:1%; } -#play-container { +#play-container { -webkit-box-shadow: 6px 9px 78px -2px rgba(0,0,0,0.75); -moz-box-shadow: 6px 9px 78px -2px rgba(0,0,0,0.75); box-shadow: 6px 9px 78px -2px rgba(0,0,0,0.75); diff --git a/site/img/nand.png b/site/img/nand.png new file mode 100644 index 0000000..93fb28c Binary files /dev/null and b/site/img/nand.png differ diff --git a/site/img/nand_test.png b/site/img/nand_test.png new file mode 100644 index 0000000..89153d9 Binary files /dev/null and b/site/img/nand_test.png differ diff --git a/site/img/nor_test.png b/site/img/nor_test.png new file mode 100644 index 0000000..8c969d6 Binary files /dev/null and b/site/img/nor_test.png differ diff --git a/site/img/not_test.png b/site/img/not_test.png new file mode 100644 index 0000000..1d76058 Binary files /dev/null and b/site/img/not_test.png differ diff --git a/site/js/const.js b/site/js/const.js index a9abfd6..69cf6b9 100644 --- a/site/js/const.js +++ b/site/js/const.js @@ -1,21 +1,21 @@ //Portes Logiques -var imageHeight = 50; +var imageHeight = 70; var imageWidth = 75; var imageRotation = 0; //Image const pathImg = "../img/"; -const imageLogiqueEt = "and_test.png"; -const imageLogiqueOu = "or_test.png"; -const imageLogiqueEtNon = "logiqueetnon.png"; -const imageLogiqueInv = "non.png"; +const imageLogiqueEt = "eee.png"; +const imageLogiqueOu = "zzz.png"; +const imageLogiqueEtNon = "nand.png"; +const imageLogiqueInv = "not_test.png"; const imageLogiqueNonOu = "aaa.png"; const imageEnd = "idea_white.png"; //line const colorLineInnactive = "black"; -const colorLineActive = "#FFF033"; -const lineStroke = 5; +const colorLineActive = "#4CFEFE";//FFF033 +const lineStroke = 4; const pourcentageBreak = 15; //switch diff --git a/site/js/createElement.js b/site/js/createElement.js index 53f7250..c2deb3d 100644 --- a/site/js/createElement.js +++ b/site/js/createElement.js @@ -60,6 +60,7 @@ function createLine(points, id) { let newPoints = [startX, startY,startX + distance20, startY,endX - distance20,endY,endX,endY]; let line = new Konva.Line({ points: newPoints, + fill : 'blue', stroke: colorLineInnactive, strokeWidth: lineStroke, id: id, diff --git a/site/js/creator.js b/site/js/creator.js index a783000..8abc79c 100644 --- a/site/js/creator.js +++ b/site/js/creator.js @@ -90,6 +90,67 @@ function tuto(){ initEnd(); } +function creatorRandomPyramid(){ + timeEnd = getRandomArbitrary(15, 50); + + initTimer(); + + var premiereColonne = 2; + + let still = premiereColonne; + let nmbColonne = 1; + + while(still != 1){ + still = still / 2; + nmbColonne++; + } + + var logiqueCount = 0; + + colonneTot = nmbColonne; + + for (let i = 0; i < colonneTot; i++) { + liveColonneNumber.push([]); + } + premiereColonne = premiereColonne * 2; + for (let i = 0; i < colonneTot; i++) { + numberPerColonne[i] = premiereColonne - premiereColonne / 2; + premiereColonne = premiereColonne / 2; + for (let j = 0; j < numberPerColonne[i]; j++) { + logiqueCount++; + let type = null; + switch (getRandomArbitrary(0, 4)) { + case 0: + type = "et"; + break; + case 1: + type = "ou"; + break; + case 2: + type = "etnon"; + break; + case 3: + type = "nonou"; + break; + } + insertLogiqueColonne("logique" + logiqueCount, type, i); + } + } + + logiques.forEach(function (element) { + createLinkAuto(element.name); + }); + + calculNombreSwitch(); + switchCreator(numberOfSwitch); + + createAllLinkSwitch(); + + initAllSwitch(); + createEnd(); + initEnd(); +} + function generatorGame() { timeEnd = getRandomArbitrary(15, 50); diff --git a/site/vues/jeu.html b/site/vues/jeu.html index 1920164..2798536 100644 --- a/site/vues/jeu.html +++ b/site/vues/jeu.html @@ -93,7 +93,7 @@ initLayer(); - generatorGame(); + creatorRandomPyramid(); checkAllSortieLogique();