Set fonctionnel manque option changement couleur, timer, compteur, score à modifier

master
readhame 5 years ago
parent b1798554aa
commit 9e3bc0ba48

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

@ -44,7 +44,7 @@
<property name="DefaultHtmlFileTemplate" value="HTML File" /> <property name="DefaultHtmlFileTemplate" value="HTML File" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/DAL" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/../set-game-js-master" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
@ -81,6 +81,10 @@
<workItem from="1591709804993" duration="7295000" /> <workItem from="1591709804993" duration="7295000" />
<workItem from="1591720789570" duration="102000" /> <workItem from="1591720789570" duration="102000" />
<workItem from="1591720974550" duration="73000" /> <workItem from="1591720974550" duration="73000" />
<workItem from="1591779338524" duration="10044000" />
<workItem from="1591955810403" duration="597000" />
<workItem from="1592041915661" duration="662000" />
<workItem from="1592130212695" duration="10276000" />
</task> </task>
<servers /> <servers />
</component> </component>
@ -96,10 +100,10 @@
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state x="1097" y="0" key="#com.intellij.refactoring.rename.AutomaticRenamingDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591698752215" /> <state x="1097" y="0" key="#com.intellij.refactoring.rename.AutomaticRenamingDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591698752215" />
<state x="267" y="278" key="FileChooserDialogImpl" timestamp="1591697414388"> <state x="267" y="278" key="FileChooserDialogImpl" timestamp="1592135500932">
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state x="267" y="278" key="FileChooserDialogImpl/0.0.1920.1040@0.0.1920.1040" timestamp="1591697414388" /> <state x="267" y="278" key="FileChooserDialogImpl/0.0.1920.1040@0.0.1920.1040" timestamp="1592135500932" />
<state width="196" height="457" key="HiddenNamespacesPopup" timestamp="1591707100032"> <state width="196" height="457" key="HiddenNamespacesPopup" timestamp="1591707100032">
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
@ -112,9 +116,13 @@
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state x="1274" y="447" key="NewPhpFileDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591697406133" /> <state x="1274" y="447" key="NewPhpFileDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591697406133" />
<state x="1136" y="344" key="com.intellij.ide.util.TipDialog" timestamp="1591720974902"> <state width="498" height="446" key="SwitcherDM" timestamp="1592141850590">
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state x="1136" y="344" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591720974902" /> <state width="498" height="446" key="SwitcherDM/0.0.1920.1040@0.0.1920.1040" timestamp="1592141850590" />
<state x="1136" y="344" key="com.intellij.ide.util.TipDialog" timestamp="1592132049032">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="1136" y="344" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1592132049032" />
</component> </component>
</project> </project>

@ -1,11 +1,6 @@
<?php <?php
class Card { class Card {
public $shape;
public $color;
public $fill;
public $number;
public $id;
public function __construct(CardAttributes $attributes, Deck $deck) { public function __construct(CardAttributes $attributes, Deck $deck) {

@ -25,7 +25,7 @@ class Deck {
$shapes = array('oval', 'diamond', 'wave'); $shapes = array('oval', 'diamond', 'wave');
$fills = array('filled', 'shaded', 'empty'); $fills = array('solid', 'stripped', 'open');
$numbers = array(1, 2, 3); $numbers = array(1, 2, 3);
$index = 1; $index = 1;

@ -1,3 +1,4 @@
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
@ -31,9 +32,9 @@ h1 {
.card { .card {
display: inline-block; display: inline-block;
width: 245px; width: 200px;
margin-right: 5px; margin-right: 5px;
height: 200px; height: 245px;
border: 2px solid #ccc; border: 2px solid #ccc;
} }
.card:hover { .card:hover {
@ -45,26 +46,36 @@ h1 {
} }
.game-board { .game-board {
width: 1000px;
width: 850px;
height: 1000px;
margin: 0 auto; margin: 0 auto;
transform: rotate(90deg);
} }
.shape { .shape {
display: inline-block; display: inline-block;
width: 70px; border: 2px solid white;
height: 200px; height: 45%;
-webkit-mask-repeat: no-repeat; width: 25%;
-webkit-mask-position: 15px; margin-top: 30%;
} }
.diamond { .diamond {
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); width: 33%;
height: 75%; height: 27%;
width: 25%; margin-top: 45%;
margin-top: 10%;
transform: rotate(67deg) skewX(45deg) scaleY( 0.70710678118);
} }
.wave { .wave {
/*clip-path: polygon(5% 34%, 5% 20%, 79% 21%, 66% 61%, 98% 60%, 97% 73%, 19% 74%, 37% 34%);/ /*clip-path: polygon(5% 34%, 5% 20%, 79% 21%, 66% 61%, 98% 60%, 97% 73%, 19% 74%, 37% 34%);/
/*-moz-transform: scale(0.8) rotate(10deg) translate(15px, -1px) skew(-10deg, 8deg); /*-moz-transform: scale(0.8) rotate(10deg) translate(15px, -1px) skew(-10deg, 8deg);
@ -73,26 +84,14 @@ h1 {
-ms-transform: scale(0.8) rotate(10deg) translate(15px, -1px) skew(-10deg, 8deg); -ms-transform: scale(0.8) rotate(10deg) translate(15px, -1px) skew(-10deg, 8deg);
transform: scale(0.8) rotate(10deg) translate(15px, -1px) skew(-10deg, 8deg);*/ transform: scale(0.8) rotate(10deg) translate(15px, -1px) skew(-10deg, 8deg);*/
-webkit-border-radius: 20px 100px 20px 100px; /*-webkit-border-radius: 20px 100px 20px 100px;
-moz-border-radius: 20px 100px 20px 100px; -moz-border-radius: 20px 100px 20px 100px;*/
border-radius: 20px 100px 20px 100px; border-radius: 20px 100px 20px 100px;
height: 75%;
width: 25%;
margin-top: 10%;
border: 2px solid white;
} }
.oval { .oval {
border-radius: 40px / 50px; border-radius: 40px / 50px;
height: 75%;
width: 25%;
margin-top: 10%;
border: 2px solid white;
} }
@ -112,50 +111,51 @@ h1 {
.green.filled { .green.solid {
background: green; background: green;
} }
.red.filled { .red.solid {
background: red; background: red;
} }
.purple.filled { .purple.solid {
background: purple; background: purple;
} }
.red.empty{ .red.open{
border: 22px solid red; border: 4px solid red;
} }
.green.empty {
border: 22px solid green; .green.open {
border: 4px solid green;
} }
.purple.empty { .purple.open {
border: 22px solid purple; border: 4px solid purple;
} }
.red.shaded{ .red.stripped{
background: repeating-linear-gradient(-45deg, red, red 5px, white 5px, white 10px); background: repeating-linear-gradient(-45deg, red, red 5px, white 5px, white 10px);
border: 4px solid red; border: 2px solid red;
} }
.green.shaded { .green.stripped {
background: repeating-linear-gradient(-45deg, green, green 5px, white 5px, white 10px); background: repeating-linear-gradient(-45deg, green, green 5px, white 5px, white 10px);
border: 4px solid green; border: 2px solid green;
} }
.purple.shaded { .purple.stripped {
background: repeating-linear-gradient(-45deg, purple, purple 5px, white 5px, white 10px); background: repeating-linear-gradient(-45deg, purple, purple 5px, white 5px, white 10px);
border: 4px solid purple; border: 2px solid purple;
} }

@ -53,6 +53,7 @@ var Game = {
$(cardNode).data({ $(cardNode).data({
'id': card.id, 'id': card.id,
'shape': card.shape, 'shape': card.shape,
'fill': card.fill,
'color': card.color, 'color': card.color,
'number': card.number 'number': card.number
}); });
@ -67,7 +68,7 @@ var Game = {
self.$board.append(cardNode); self.$board.append(cardNode);
// display 4 cards per row // display 4 cards per row
if ((index+1) % 4 === 0) { if ((index+1) % 3 === 0) {
self.$board.append($('<div>')); self.$board.append($('<div>'));
} }
}); });
@ -104,17 +105,20 @@ var Game = {
}); });
}, },
selectCard: function(card) { selectCard: function(card) {
$(card).addClass('selected'); $(card).addClass('selected');
this.selected.push(card); this.selected.push(card);
if (this.selected.length > 3) { if (this.selected.length > 3) {
var removed = this.selected.shift(); this.clearSelections.call(this);
$(removed).removeClass('selected');
} }
}, },
deselectCard: function(card) { deselectCard: function(card) {
var self = this; var self = this;
var index = self.selected.indexOf(card); var index = self.selected.indexOf(card);
@ -136,17 +140,18 @@ var Game = {
var colors = $.map(self.selected, function(el) { return $(el).data("color");}); var colors = $.map(self.selected, function(el) { return $(el).data("color");});
var shapes = $.map(self.selected, function(el) { return $(el).data("shape"); }); var shapes = $.map(self.selected, function(el) { return $(el).data("shape"); });
var fills= $.map(self.selected, function(el) { return $(el).data("fill"); });
var numbers = $.map(self.selected, function(el) { return $(el).data("number"); }); var numbers = $.map(self.selected, function(el) { return $(el).data("number"); });
return (self.isSet(colors) && self.isSet(shapes) && self.isSet(fills) && self.isSet(numbers));
return (self.isSet(colors) && self.isSet(shapes) && self.isSet(numbers));
}, },
isSet: function(arr) { isSet: function(arr) {
// a set means the attributes are either all the same or all different
var reduced = $.unique(arr); var reduced = $.unique(arr);
return (reduced.length === 1 || reduced.length === 3); console.log(arr);
return reduced.length === 1 || reduced.length === 3;
}, },
silentSubmission: function() { silentSubmission: function() {
@ -154,6 +159,8 @@ var Game = {
if (valid) { if (valid) {
this.submitSet(); this.submitSet();
} }
}, },
submitSet: function() { submitSet: function() {

Loading…
Cancel
Save