|
|
@ -20,13 +20,13 @@ class CardToHtml {
|
|
|
|
// Loop to add svg card.number times
|
|
|
|
// Loop to add svg card.number times
|
|
|
|
for(let i = 0; i < card.number; i++) {
|
|
|
|
for(let i = 0; i < card.number; i++) {
|
|
|
|
div.appendChild(svg.cloneNode(true))
|
|
|
|
div.appendChild(svg.cloneNode(true))
|
|
|
|
console.log("+SVG: ",svg);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gameWindow.appendChild(div);
|
|
|
|
gameWindow.appendChild(div);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static createPath(shape,color,filling,outline,step) {
|
|
|
|
static createPath(shape,color,filling,outline,step) {
|
|
|
|
|
|
|
|
// The way to create svg element (differs from html element)
|
|
|
|
const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
|
|
const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
|
|
|
|
|
|
|
|
|
|
if(shape === null) shape = 'oval';
|
|
|
|
if(shape === null) shape = 'oval';
|
|
|
@ -39,6 +39,11 @@ class CardToHtml {
|
|
|
|
path.setAttribute('fill',`#${color}`);
|
|
|
|
path.setAttribute('fill',`#${color}`);
|
|
|
|
path.setAttribute('stroke-width','18');
|
|
|
|
path.setAttribute('stroke-width','18');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Case shape do not have color
|
|
|
|
|
|
|
|
if(filling === 'none') {
|
|
|
|
|
|
|
|
path.setAttribute('fill','none');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Add svg attributes for shape outline
|
|
|
|
// Add svg attributes for shape outline
|
|
|
|
if(outline !== null){
|
|
|
|
if(outline !== null){
|
|
|
|
Object.keys(OUTLINE_SPEC[outline]).forEach(function(k){
|
|
|
|
Object.keys(OUTLINE_SPEC[outline]).forEach(function(k){
|
|
|
|