diff --git a/HyperSet/.idea/vcs.xml b/HyperSet/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/HyperSet/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/HyperSet/.idea/workspace.xml b/HyperSet/.idea/workspace.xml index 4793573..7e8871b 100644 --- a/HyperSet/.idea/workspace.xml +++ b/HyperSet/.idea/workspace.xml @@ -44,19 +44,12 @@ - + - - - - - - - @@ -64,6 +57,13 @@ + + + + + + + @@ -101,6 +101,9 @@ + + + @@ -120,10 +123,10 @@ - + - + @@ -140,10 +143,10 @@ - + - + diff --git a/HyperSet/controllers/Controlleur.php b/HyperSet/controllers/Controlleur.php index 0fa729d..196999c 100644 --- a/HyperSet/controllers/Controlleur.php +++ b/HyperSet/controllers/Controlleur.php @@ -1,5 +1,5 @@ shuffle(); // remove 12 cards from the top and return them - $dealtCards = array_chop($this->cards, 12); + $dealtCards = array_chop($this->cards, $nbCartes); return $dealtCards; } diff --git a/HyperSet/metiers/game.php b/HyperSet/metiers/game.php index f865fc9..0112bd8 100644 --- a/HyperSet/metiers/game.php +++ b/HyperSet/metiers/game.php @@ -9,10 +9,10 @@ class Game { $this->deck = $deck; } - public function start() { + public function start($nbCarte) { // call the deck's deal function and return the cards dealt - return $this->deck->deal(); + return $this->deck->deal($nbCarte); } } \ No newline at end of file diff --git a/HyperSet/set.php b/HyperSet/set.php index f51825b..dd40a5c 100644 --- a/HyperSet/set.php +++ b/HyperSet/set.php @@ -13,33 +13,40 @@ if (isset($_GET['action']) && $_GET['action'] == 'deal') { $_SESSION['deck'] = new Deck($_GET['action']); $_SESSION['game'] = new Game($_SESSION['deck']); $game = $_SESSION['game']; - echo json_encode($game->start()); + echo json_encode($game->start(20)); } else if (isset($_GET['action']) && $_GET['action'] == 'deal1') { $_SESSION['deck1'] = new Deck($_GET['action']); $_SESSION['game1'] = new Game($_SESSION['deck1']); $game = $_SESSION['game1']; - echo json_encode($game->start()); + echo json_encode($game->start(45)); } else if (isset($_GET['action']) && $_GET['action'] == 'deal2') { $_SESSION['deck2'] = new Deck($_GET['action']); $_SESSION['game2'] = new Game($_SESSION['deck2']); $game = $_SESSION['game2']; - echo json_encode($game->start()); + echo json_encode($game->start(20)); } else if (isset($_GET['action']) && $_GET['action'] == 'deal3') { $_SESSION['deck3'] = new Deck($_GET['action']); $_SESSION['game3'] = new Game($_SESSION['deck3']); $game = $_SESSION['game3']; - echo json_encode($game->start()); + echo json_encode($game->start(20)); } else if (isset($_GET['action']) && $_GET['action'] == 'deal4') { $_SESSION['deck4'] = new Deck($_GET['action']); $_SESSION['game4'] = new Game($_SESSION['deck4']); $game = $_SESSION['game4']; - echo json_encode($game->start()); + echo json_encode($game->start(20)); -} else if (isset($_GET['action']) && $_GET['action'] == 'submit'){ +}else if (isset($_GET['action']) && $_GET['action'] == 'deal0') { + $_SESSION['deck0'] = new Deck($_GET['action']); + $_SESSION['game0'] = new Game($_SESSION['deck0']); + $game = $_SESSION['game0']; + echo json_encode($game->start(12)); +} + +else if (isset($_GET['action']) && $_GET['action'] == 'submit'){ $deck = $_SESSION['deck']; echo json_encode($deck->threeMore()); } @@ -58,4 +65,7 @@ else if (isset($_GET['action']) && $_GET['action'] == 'submit3'){ else if (isset($_GET['action']) && $_GET['action'] == 'submit4'){ $deck = $_SESSION['deck4']; echo json_encode($deck->threeMore()); +}else if (isset($_GET['action']) && $_GET['action'] == 'submit0'){ + $deck = $_SESSION['deck0']; + echo json_encode($deck->threeMore()); } \ No newline at end of file diff --git a/HyperSet/vues/css/style-page.css b/HyperSet/vues/css/style-page.css index bb5e78f..361892b 100644 --- a/HyperSet/vues/css/style-page.css +++ b/HyperSet/vues/css/style-page.css @@ -74,7 +74,7 @@ select::-ms-expand { .settings-btn { width: 70px; height: 70px; - position: absolute; + position: fixed; top: 6%; right: 1%; } @@ -200,7 +200,7 @@ select::-ms-expand { .explain-btn { width: 70px; height: 70px; - position: absolute; + position: fixed; top: 90%; right: 1%; @@ -403,4 +403,24 @@ input:checked + .slider .on { font-weight: bold; text-align: center; font-family: textFont, sans-serif; +} + +.back-btn{ + position: fixed; + top: 6%; + left: 1%; +} + +.back-btn img { + cursor: pointer; + -webkit-transform: rotate(0) scale(1.5); + transform: rotate(0) scale(1); + -webkit-transition: .3s ease-in-out; + transition: .3s ease-in-out; +} + + +.back-btn img:hover{ + -webkit-transform: rotate(0) scale(1.2); + transform: rotate(0) scale(1.2); } \ No newline at end of file diff --git a/HyperSet/vues/css/style.css b/HyperSet/vues/css/style.css index 4dfa022..37090a7 100644 --- a/HyperSet/vues/css/style.css +++ b/HyperSet/vues/css/style.css @@ -32,7 +32,7 @@ h1 { .card { display: table-cell; - width: 400px; + width: 290px; height: 200px; border: 2px solid #ccc; @@ -48,12 +48,25 @@ h1 { } .game-board { + margin-top: 5%; + height: auto; + width: auto; + transform: rotate(90deg); - height: 1000px; - margin-right: 22%; +} +.game-board0 { + margin-top: 22%; + height: auto; + width: auto; transform: rotate(90deg); } +.game-board1 { + margin-top: -27%; + height: auto; + width: auto; + transform: rotate(90deg); +} .shape { display: inline-block; @@ -76,7 +89,7 @@ h1 { .wave { border-radius: 15px 180px 15px 180px; transform: rotate(1deg) skewX(0.5deg) scaleX(0.8); - width: 45px; + width: 50px; } @@ -85,7 +98,8 @@ h1 { .oval { border-radius: 40px / 50px; transform: rotate(0.5deg) skewX(1deg) scaleX(0.8); - width: 55px; + width: 50px; + height: 100px; } @@ -93,12 +107,13 @@ h1 { .rectangle{ transform: rotate(0.5deg) skewX(1deg) scaleX(0.8); - width: 55px; + width: 50px; } .triangle{ clip-path: polygon(50% 0%, 0% 100%, 100% 100%); + width: 50px; } @@ -119,42 +134,48 @@ $borders = array('plein', 'point', 'rond', 'zigzag','hachure'); .green.pointille{ - background-image: radial-gradient(green 20%, white 20%), - radial-gradient(#fafafa 20%, transparent 20%); - background-position: 0 0, 5px 5px; - background-size: 20px 20px; - + background-image: radial-gradient(green 40%, #F5F5F5 40%), + radial-gradient(green 20%, #F5F5F5 20%), + radial-gradient(#fafafa 10%, transparent 10%); + background-position: 0 0, 1px 1px; + background-size: 15px 15px; + border: 2px solid green; } .red.pointille{ - background-image: radial-gradient(red 20%, white 20%), - radial-gradient(#fafafa 20%, transparent 20%); - background-position: 0 0, 5px 5px; - background-size: 20px 20px; - + background-image: radial-gradient(red 40%, #F5F5F5 40%), + radial-gradient(red 20%, #F5F5F5 20%), + radial-gradient(#fafafa 10%, transparent 10%); + background-position: 0 0, 1px 1px; + background-size: 15px 15px; + border: 2px solid red; } .yellow.pointille{ - background-image: radial-gradient(orangered 20%, white 20%), -radial-gradient(#fafafa 20%, transparent 20%); - background-position: 0 0, 5px 5px; - background-size: 20px 20px; - - + background-image: radial-gradient(orangered 40%, #F5F5F5 40%), + radial-gradient(orangered 20%, #F5F5F5 20%), +radial-gradient(#fafafa 10%, transparent 10%); + background-position: 0 0, 1px 1px; + background-size: 15px 15px; + border: 2px solid saddlebrown; } .lightblue.pointille{ - background-image: radial-gradient(lightblue 20%, white 20%), - radial-gradient(#fafafa 20%, transparent 20%); - background-position: 0 0, 5px 5px; - background-size: 20px 20px; + background-image: radial-gradient(lightblue 40%, #F5F5F5 40%), + radial-gradient(lightblue 20%, #F5F5F5 20%), + radial-gradient(#fafafa 10%, transparent 10%); + background-position: 0 0, 1px 1px; + background-size: 15px 15px; + border: 2px solid lightblue; } .purple.pointille{ - background-image: radial-gradient(purple 20%, white 20%), - radial-gradient(#fafafa 20%, transparent 20%); - background-position: 0 0, 5px 5px; - background-size: 20px 20px; + background-image: radial-gradient(purple 40%, #F5F5F5 40%), + radial-gradient(purple 20%, #F5F5F5 20%), + radial-gradient(#fafafa 10%, transparent 10%); + background-position: 0 0, 1px 1px; + background-size: 15px 15px; + border: 2px solid purple; } @@ -174,6 +195,7 @@ radial-gradient(#fafafa 20%, transparent 20%); linear-gradient(90deg, rgba(255,255,255,.28) 2px, transparent 2px); background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px; background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px; + border: 2px solid green; } .red.quadrillage{ background-color: red; @@ -184,6 +206,7 @@ radial-gradient(#fafafa 20%, transparent 20%); linear-gradient(90deg, rgba(255,255,255,.28) 2px, transparent 2px); background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px; background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px; + border: 2px solid red; } .yellow.quadrillage{ background-color: orangered; @@ -194,6 +217,7 @@ radial-gradient(#fafafa 20%, transparent 20%); linear-gradient(90deg, rgba(255,255,255,.28) 2px, transparent 2px); background-size: 80px 80px, 80px 80px, 15px 15px, 15px 15px; background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px; + border: 2px solid brown; } .lightblue.quadrillage{ @@ -205,6 +229,7 @@ radial-gradient(#fafafa 20%, transparent 20%); linear-gradient(90deg, rgba(255,255,255,.28) 2px, transparent 2px); background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px; background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px; + border: 2px solid lightblue; } .purple.quadrillage{ background-color: purple; @@ -215,6 +240,7 @@ radial-gradient(#fafafa 20%, transparent 20%); linear-gradient(90deg, rgba(255,255,255,.28) 2px, transparent 2px); background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px; background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px; + border: 2px solid purple; } diff --git a/HyperSet/vues/homePage.html b/HyperSet/vues/homePage.html index f5f8a06..dfaca04 100644 --- a/HyperSet/vues/homePage.html +++ b/HyperSet/vues/homePage.html @@ -16,15 +16,31 @@
- +
+ + + + +