From 2902266a616b2f6c5fd91e1cf1efbb0703e95f10 Mon Sep 17 00:00:00 2001 From: "remi.arnal" Date: Tue, 31 Jan 2023 21:32:40 +0100 Subject: [PATCH 01/40] start home page --- index.html | 42 ++++++++++++++++++++++++ styles/style.css | 83 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 index.html create mode 100644 styles/style.css diff --git a/index.html b/index.html new file mode 100644 index 0000000..6fb82de --- /dev/null +++ b/index.html @@ -0,0 +1,42 @@ + + + + + + HyperSet + + + + +
+ +
+ +
+
+

HyperSet

+ Find all the Sets ! + +
+ +
+ +
+ Connected players: 1345 + Total Played Games: 1,455,896 +
+ +
+ +
+ + + + \ No newline at end of file diff --git a/styles/style.css b/styles/style.css new file mode 100644 index 0000000..46b036a --- /dev/null +++ b/styles/style.css @@ -0,0 +1,83 @@ +:root { + --font : Helvetica; +} + +* { + padding: 0; + margin: 0; + border: 0; + font-family: var(--font); +} + +/* Nav Bar */ + +#nav-bar { + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + height: 7vh; + list-style-type: none; + background-color: black; +} + +#nav-bar li a { + font-size: 2rem; + font-weight: bold; + font-family: var(--font); + text-decoration: none; + color: white; + border: none; + padding: 0.7rem; + padding-left: 1.5rem; + padding-right: 1.5rem; +} + +/* Main */ + +#master { + display: flex; + flex-direction: row; +} + +.column { + display: flex; + flex-direction: column; + height: calc(100vh - 7vh - 6em); +} + +#left { + background-color: red; + width: 60%; + padding: 3em; +} + +#right { + background-color: blue; + width: 40%; + padding: 3em; +} + +h1 { + color: black; + font-size: 5em; + font-weight: bold; +} + +#slogan { + margin-top: 1em; + margin-bottom: 1.5em; + color: black; + font-size: 2em; +} + +#random-set { + height: 40vh; + background-color: green; +} + +#info { + display: flex; + flex-direction: column; + margin-top: 4em; +} \ No newline at end of file From 0558cef4956bd20ffda39730fe73315625638f91 Mon Sep 17 00:00:00 2001 From: "remi.arnal" Date: Tue, 31 Jan 2023 21:36:04 +0100 Subject: [PATCH 02/40] create index.css + add to index.html --- index.html | 1 + styles/index.css | 71 ++++++++++++++++++++++++++++++++++++++++++++++ styles/style.css | 73 ------------------------------------------------ 3 files changed, 72 insertions(+), 73 deletions(-) create mode 100644 styles/index.css diff --git a/index.html b/index.html index 6fb82de..3c62045 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ HyperSet + diff --git a/styles/index.css b/styles/index.css new file mode 100644 index 0000000..766a32d --- /dev/null +++ b/styles/index.css @@ -0,0 +1,71 @@ +/* Nav Bar */ +#nav-bar { + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + height: 7vh; + list-style-type: none; + background-color: black; +} + +#nav-bar li a { + font-size: 2rem; + font-weight: bold; + font-family: var(--font); + text-decoration: none; + color: white; + border: none; + padding: 0.7rem; + padding-left: 1.5rem; + padding-right: 1.5rem; +} + +/* Main */ + +#master { + display: flex; + flex-direction: row; +} + +.column { + display: flex; + flex-direction: column; + height: calc(100vh - 7vh - 6em); +} + +#left { + background-color: red; + width: 60%; + padding: 3em; +} + +#right { + background-color: blue; + width: 40%; + padding: 3em; +} + +h1 { + color: black; + font-size: 5em; + font-weight: bold; +} + +#slogan { + margin-top: 1em; + margin-bottom: 1.5em; + color: black; + font-size: 2em; +} + +#random-set { + height: 40vh; + background-color: green; +} + +#info { + display: flex; + flex-direction: column; + margin-top: 4em; +} \ No newline at end of file diff --git a/styles/style.css b/styles/style.css index 46b036a..7ed93d8 100644 --- a/styles/style.css +++ b/styles/style.css @@ -7,77 +7,4 @@ margin: 0; border: 0; font-family: var(--font); -} - -/* Nav Bar */ - -#nav-bar { - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - height: 7vh; - list-style-type: none; - background-color: black; -} - -#nav-bar li a { - font-size: 2rem; - font-weight: bold; - font-family: var(--font); - text-decoration: none; - color: white; - border: none; - padding: 0.7rem; - padding-left: 1.5rem; - padding-right: 1.5rem; -} - -/* Main */ - -#master { - display: flex; - flex-direction: row; -} - -.column { - display: flex; - flex-direction: column; - height: calc(100vh - 7vh - 6em); -} - -#left { - background-color: red; - width: 60%; - padding: 3em; -} - -#right { - background-color: blue; - width: 40%; - padding: 3em; -} - -h1 { - color: black; - font-size: 5em; - font-weight: bold; -} - -#slogan { - margin-top: 1em; - margin-bottom: 1.5em; - color: black; - font-size: 2em; -} - -#random-set { - height: 40vh; - background-color: green; -} - -#info { - display: flex; - flex-direction: column; - margin-top: 4em; } \ No newline at end of file From 79c7831840c686149bbe92b55650e8201f35c546 Mon Sep 17 00:00:00 2001 From: RemRem Date: Thu, 2 Feb 2023 07:57:48 +0100 Subject: [PATCH 03/40] add action button on home page --- index.html | 4 +++- styles/index.css | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 3c62045..80560f5 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,9 @@ diff --git a/styles/index.css b/styles/index.css index 766a32d..544ac8e 100644 --- a/styles/index.css +++ b/styles/index.css @@ -35,15 +35,29 @@ } #left { - background-color: red; + display: flex; + flex-direction: column; width: 60%; padding: 3em; + background-color: red; } #right { - background-color: blue; + display: flex; + flex-direction: column; + justify-content: space-evenly; + align-items: center; width: 40%; padding: 3em; + background-color: blue; +} + +.home-room { + width: 50%; + padding: 1.5em; + background-color: yellow; + font-family: var(--font); + font-size: 1.4em; } h1 { From 86680bec9ab2188ef87d84f7f82803c3bdd5141e Mon Sep 17 00:00:00 2001 From: RemRem Date: Thu, 2 Feb 2023 11:18:32 +0100 Subject: [PATCH 04/40] better color, button animation --- index.html | 6 +++--- styles/index.css | 40 +++++++++++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index 80560f5..2cf1392 100644 --- a/index.html +++ b/index.html @@ -34,9 +34,9 @@ diff --git a/styles/index.css b/styles/index.css index 544ac8e..62dca06 100644 --- a/styles/index.css +++ b/styles/index.css @@ -4,7 +4,6 @@ flex-direction: row; align-items: center; justify-content: space-between; - height: 7vh; list-style-type: none; background-color: black; } @@ -15,10 +14,14 @@ font-family: var(--font); text-decoration: none; color: white; - border: none; - padding: 0.7rem; + padding: 2rem; padding-left: 1.5rem; padding-right: 1.5rem; + transition: 0.2s; +} + +#nav-bar li a:hover { + background-color: red; } /* Main */ @@ -39,7 +42,7 @@ flex-direction: column; width: 60%; padding: 3em; - background-color: red; + background-color: white; } #right { @@ -49,15 +52,29 @@ align-items: center; width: 40%; padding: 3em; - background-color: blue; + background-color: white; } -.home-room { +.action-button { + display: flex; + justify-content: center; + align-items: center; width: 50%; - padding: 1.5em; - background-color: yellow; + padding: 1.2em; + padding-top: 2.1rem; + background-color: white; + border: 0.2rem solid black; + border-radius: 0.5em; font-family: var(--font); - font-size: 1.4em; + font-size: 1.5em; + transition: 0.3s; +} + +.action-button:hover { + background-color: black; + color: white; + transform: scale(1.2); + cursor: pointer; } h1 { @@ -75,11 +92,12 @@ h1 { #random-set { height: 40vh; - background-color: green; + background-color: white; + border: 0.5rem solid black; } #info { display: flex; flex-direction: column; - margin-top: 4em; + margin-top: auto; } \ No newline at end of file From c64df8e75f71522fef7359e652547368d915c552 Mon Sep 17 00:00:00 2001 From: RemRem Date: Thu, 2 Feb 2023 11:35:04 +0100 Subject: [PATCH 05/40] nav bar size fixed --- styles/index.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/styles/index.css b/styles/index.css index 62dca06..96026e8 100644 --- a/styles/index.css +++ b/styles/index.css @@ -9,12 +9,14 @@ } #nav-bar li a { + display: flex; + justify-content: center; font-size: 2rem; font-weight: bold; font-family: var(--font); text-decoration: none; color: white; - padding: 2rem; + padding: 1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; transition: 0.2s; From 093c08407476b14efc61288fe1dd826891bc0453 Mon Sep 17 00:00:00 2001 From: RemRem Date: Thu, 2 Feb 2023 11:40:42 +0100 Subject: [PATCH 06/40] fix scrolling (full random) --- styles/index.css | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/styles/index.css b/styles/index.css index 96026e8..460abfe 100644 --- a/styles/index.css +++ b/styles/index.css @@ -36,14 +36,14 @@ .column { display: flex; flex-direction: column; - height: calc(100vh - 7vh - 6em); + padding: 3em; + height: calc(100vh - 5rem - 7em); } #left { display: flex; flex-direction: column; width: 60%; - padding: 3em; background-color: white; } @@ -53,7 +53,6 @@ justify-content: space-evenly; align-items: center; width: 40%; - padding: 3em; background-color: white; } From 7fbc50596a71e5b137c60b1ad7562dcd3240777f Mon Sep 17 00:00:00 2001 From: RemRem Date: Thu, 2 Feb 2023 11:46:57 +0100 Subject: [PATCH 07/40] nav-bar item take all available space --- styles/index.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/styles/index.css b/styles/index.css index 460abfe..6e5be25 100644 --- a/styles/index.css +++ b/styles/index.css @@ -8,8 +8,14 @@ background-color: black; } +#nav-bar li { + display: flex; + flex-grow: 1; +} + #nav-bar li a { display: flex; + flex-grow: 1; justify-content: center; font-size: 2rem; font-weight: bold; From 2b6dcc5666d3331873897d2587ec10d90ff5e457 Mon Sep 17 00:00:00 2001 From: Bastien Jacquelin Date: Fri, 3 Feb 2023 14:37:04 +0100 Subject: [PATCH 08/40] edit to make possible the choice of the attributes --- src/Console/Console.html | 1 + src/Console/main.js | 24 +++++---------- src/Model/Card.js | 18 +++++++----- src/Model/Const.js | 6 ++++ src/Model/Deck.js | 63 +++++++++++++++++++++++++++------------- 5 files changed, 69 insertions(+), 43 deletions(-) create mode 100644 src/Model/Const.js diff --git a/src/Console/Console.html b/src/Console/Console.html index 1f6b5c3..f639d2a 100644 --- a/src/Console/Console.html +++ b/src/Console/Console.html @@ -17,6 +17,7 @@ + diff --git a/src/Console/main.js b/src/Console/main.js index a349a7b..b0652e6 100644 --- a/src/Console/main.js +++ b/src/Console/main.js @@ -27,11 +27,11 @@ try { } console.groupEnd(); console.group('Deck'); -let deck = new Deck(4); +let deck = new Deck([0,1,2,3],4); console.log(`All cards with 4 attributes size ${deck.allCards.length}`); -console.log(`size ${deck.outputCards.length}`); - +console.log(`size output ${deck.outputCards.length}`); +// Display all cards // deck.allCards.forEach(e => { // console.log(e.color,e.number,e.shape,e.filling); // }); @@ -41,30 +41,22 @@ deck.outputCards.forEach(e => { }); console.log(`set already made ${deck.setMade}`); -deck.allCards.forEach(e => { - console.log(e.color,e.number,e.shape,e.filling); - }); + let customCard=[new Card('red',1,'diamond','stripped')]; -deck.checkSet(customCard); +//deck.checkSet(customCard); console.log(`deck size :${deck.allCards.length}`); -deck.allCards.forEach(e => { - console.log(e.color,e.number,e.shape,e.filling); -}); + console.log(`remaining cars:`); deck.setMade.forEach(e => { console.log(e.color,e.number,e.shape,e.filling); }); -let deck5 = new Deck(5) -console.log(`All cards with 5 attributes size ${deck5.allCards.length}`); +//let deck5 = new Deck([0,1,2,3,4]); +//console.log(`All cards with 5 attributes size ${deck5.allCards.length}`); // deck5.allCards.forEach(e => { // console.log(e.color,e.number,e.shape,e.filling,e.outline); // }); //console.log(`Remaining cards ${deck.remainingCards}`); //console.log(`random : ${deck.getRandCard()}`); - - - - console.groupEnd(); diff --git a/src/Model/Card.js b/src/Model/Card.js index 0b8997b..3ee1a44 100644 --- a/src/Model/Card.js +++ b/src/Model/Card.js @@ -1,21 +1,25 @@ class Card{ - constructor(color, number, shape, filling){ - if(!color){ + constructor(color, number, shape, filling, outline){ + if(color=''){ throw new EmptyParamaterException('Color'); } - if(!number){ + if(number=''){ throw new EmptyParamaterException('Number'); } - if(!shape){ + if(shape==''){ throw new EmptyParamaterException('Shape'); } - if(!filling){ + if(filling==''){ throw new EmptyParamaterException('Filling'); } + if(outline==''){ + throw new EmptyParamaterException('Outline'); + } this.color=color; this.number=number; this.shape=shape; this.filling=filling; + this.outline=outline; } /** * @returns array of all attributes : @@ -27,10 +31,10 @@ class Card{ * @author Bastien Jacquelin */ getAttributes(){ - return [this.color,this.number,this.shape,this.filling]; + return [this.color,this.number,this.shape,this.filling,this.outline]; } equals(card){ - return this.color===card.color && this.number===card.number && this.shape===card.shape && this.filling===card.filling; + return this.color===card.color && this.number===card.number && this.shape===card.shape && this.filling===card.filling && this.outline===card.outline ; } }//export {Card} \ No newline at end of file diff --git a/src/Model/Const.js b/src/Model/Const.js new file mode 100644 index 0000000..201e43e --- /dev/null +++ b/src/Model/Const.js @@ -0,0 +1,6 @@ +const tabColor = ['red','purple','green','blue','orange']; +const tabNumber = [1,2,3,4,5]; +const tabShape = ['diamond','oval','wave','star','triangle']; +const tabFilling = ['empty','stripped','full','pointed','squared']; +const tabOutline = ['full','dotted ','hyphen','cloudy','sharpy']; +const ATTRIBUTES=[tabColor,tabNumber,tabShape,tabFilling,tabOutline] \ No newline at end of file diff --git a/src/Model/Deck.js b/src/Model/Deck.js index 5be6949..40c365c 100644 --- a/src/Model/Deck.js +++ b/src/Model/Deck.js @@ -1,11 +1,40 @@ class Deck{ - constructor(nbAttributes=4){ - this.allCards=this.createCards(nbAttributes);// All the cards in the game + /** + * + * @param {*} attributes : array with the attributes index for the cards + */ + constructor(attributes,nbAttributes){ + let attributesRequired=this.attributesRequiredFun(attributes); + attributesRequired.forEach(e=>{ + for(let i=0;i { From 8edccc4db6f276e55e19c476de7739e99ba787fa Mon Sep 17 00:00:00 2001 From: RemRem Date: Fri, 3 Feb 2023 18:25:11 +0100 Subject: [PATCH 09/40] add svgs path (squiggle,oval,diamond,star), card.css + card.html (for tests) --- index.html | 1 + styles/card.css | 18 +++++++ views/cards.html | 122 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100644 styles/card.css create mode 100644 views/cards.html diff --git a/index.html b/index.html index 2cf1392..86ca4de 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,7 @@