removed explicit indexing, since changing to an array of objects fixed the ordering problem already
This commit is contained in:
parent
2572c95028
commit
c0d32b6dc3
@ -27,9 +27,6 @@ function updateEvent() {
|
||||
|
||||
function generateDeck(DDF) {
|
||||
var cards = [""];
|
||||
DDF.sort(function (a,b) {
|
||||
return a.dataIndex - b.dataIndex;
|
||||
});
|
||||
DDF.forEach( function (dataBlock) {
|
||||
var tempcards = [];
|
||||
cards.forEach( function (current) {
|
||||
|
@ -1,22 +1,14 @@
|
||||
[
|
||||
[{
|
||||
"dataIndex":0,
|
||||
"name":"value",
|
||||
"data":[ "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"]
|
||||
},
|
||||
{
|
||||
"dataIndex":1,
|
||||
"name":"suit",
|
||||
"data":[ "♥", "♣", "♠", "♦" ]
|
||||
}],
|
||||
[{
|
||||
"dataIndex":0,
|
||||
"name":"color",
|
||||
"data":["red ", "black "]
|
||||
},
|
||||
{
|
||||
"dataIndex":1,
|
||||
"name":"joker",
|
||||
"data":["joker"]
|
||||
}]
|
||||
]
|
||||
|
@ -1,12 +1,8 @@
|
||||
[
|
||||
{
|
||||
"dataIndex":0,
|
||||
"name":"value",
|
||||
"data":[ "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"]
|
||||
},
|
||||
{
|
||||
"dataIndex":1,
|
||||
"name":"suit",
|
||||
"data":[ "♥", "♣", "♠", "♦" ]
|
||||
}
|
||||
]
|
||||
|
12
uno.ddf
12
uno.ddf
@ -1,32 +1,20 @@
|
||||
[
|
||||
[{
|
||||
"dataIndex":0,
|
||||
"name":"color",
|
||||
"data":[ "<div style=\"background:#f00;", "<div style=\"background:#0f0;", "<div style=\"background:#00f;", "<div style=\"background:#ff0;"]
|
||||
},
|
||||
{
|
||||
"dataIndex":1,
|
||||
"name":"style",
|
||||
"data":[" color:#fff; text-shadow:1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; border:5px #fff solid; display:flex; justify-content:center; align-items:center; height:100%; width:100%; font-size:3em; box-sizing:border-box;\"><div style=\"display:flex; flex-direction:column; align-items:center; justify-content:center; overflow:hidden; text-align:center; border:5px #fff solid; box-sizing:border-box; border-radius:50%; height:90%; width:90%;\">"]
|
||||
},
|
||||
{
|
||||
"dataIndex":2,
|
||||
"name":"value",
|
||||
"data":[ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "⮌<p>Reverse", "⊘<p>skip", "+2<p>Draw 2"]
|
||||
},
|
||||
{
|
||||
"dataIndex":3,
|
||||
"name":"end",
|
||||
"data":["</div></div>"]
|
||||
}],
|
||||
[{
|
||||
"dataIndex":0,
|
||||
"name":"draw4",
|
||||
"data":["<div style=\"background:#000; color:#fff; border:5px #fff solid; display:flex; justify-content:center; align-items:center; height:100%; width:100%; font-size:3em; box-sizing:border-box;\"><div style=\"text-align:center; display:flex; flex-direction:column;\">"]
|
||||
},
|
||||
{
|
||||
"dataIndex":1,
|
||||
"name":"cards",
|
||||
"data":[ "+4<p>Draw 4</div></div>", "+4<p>Draw 4</div></div>", "+4<p>Draw 4</div></div>", "+4<p>Draw 4</div></div>"]
|
||||
}]
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user