diff --git a/TableturfBattleClient/index.html b/TableturfBattleClient/index.html index f8377db..9a8ff76 100644 --- a/TableturfBattleClient/index.html +++ b/TableturfBattleClient/index.html @@ -32,6 +32,9 @@
This application requires JavaScript.
+ + + diff --git a/TableturfBattleClient/src/CardDisplay.ts b/TableturfBattleClient/src/CardDisplay.ts index 5e6c785..adecff7 100644 --- a/TableturfBattleClient/src/CardDisplay.ts +++ b/TableturfBattleClient/src/CardDisplay.ts @@ -39,7 +39,7 @@ class CardDisplay implements ICardElement { this.element = element; const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - svg.setAttribute('viewBox', '0 0 635 885'); + svg.setAttribute('viewBox', '0 0 442 616'); svg.setAttribute('alt', card.name); this.svg = svg; element.appendChild(svg); @@ -57,14 +57,13 @@ class CardDisplay implements ICardElement { image.setAttribute('height', '100%'); svg.appendChild(image); - if (level == 0) { - svg.insertAdjacentHTML('beforeend', ``); - } else { + if (level > 0) { svg.insertAdjacentHTML('beforeend', ` - + - + + `); } @@ -81,7 +80,7 @@ class CardDisplay implements ICardElement { // Grid const g = document.createElementNS('http://www.w3.org/2000/svg', 'g'); g.setAttribute('class', 'cardGrid'); - g.setAttribute('transform', 'translate(380 604) rotate(6.5) scale(0.283)'); + g.setAttribute('transform', 'translate(264 420) rotate(6.5) scale(0.197)'); svg.appendChild(g); CardDisplay.CreateSvgCardGrid(card, g); @@ -90,12 +89,12 @@ class CardDisplay implements ICardElement { const text1 = document.createElementNS('http://www.w3.org/2000/svg', 'text'); text1.setAttribute('class', 'cardDisplayName'); text1.setAttribute('x', '50%'); - text1.setAttribute('y', '168'); + text1.setAttribute('y', '19%'); text1.setAttribute('text-anchor', 'middle'); - text1.setAttribute('font-size', '76'); + text1.setAttribute('font-size', '53'); text1.setAttribute('font-weight', 'bold'); text1.setAttribute('stroke', 'black'); - text1.setAttribute('stroke-width', '15'); + text1.setAttribute('stroke-width', '10.5'); text1.setAttribute('stroke-linejoin', 'round'); text1.setAttribute('paint-order', 'stroke'); text1.setAttribute('word-spacing', '-10'); @@ -114,7 +113,7 @@ class CardDisplay implements ICardElement { } if (card.line1 != null && card.line2 != null) { const tspan1 = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); - tspan1.setAttribute('y', '122'); + tspan1.setAttribute('y', '13.8%'); tspan1.appendChild(document.createTextNode(card.line1)); text1.appendChild(tspan1); @@ -122,14 +121,14 @@ class CardDisplay implements ICardElement { // Add a space in the middle, to be included when copying the card name. const tspanBr = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); tspanBr.setAttribute('x', '50%'); - tspanBr.setAttribute('y', '169'); + tspanBr.setAttribute('y', '19%'); tspanBr.appendChild(document.createTextNode(' ')); text1.appendChild(tspanBr); } const tspan2 = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); tspan2.setAttribute('x', '50%'); - tspan2.setAttribute('y', '216'); + tspan2.setAttribute('y', '24.4%'); tspan2.appendChild(document.createTextNode(card.line2)); text1.appendChild(tspan2); } else @@ -138,15 +137,15 @@ class CardDisplay implements ICardElement { svg.appendChild(text1); // Size - svg.insertAdjacentHTML('beforeend', ``); - svg.insertAdjacentHTML('beforeend', `${card.size}`); + svg.insertAdjacentHTML('beforeend', ``); + svg.insertAdjacentHTML('beforeend', `${card.size}`); this.sizeElement = svg.lastElementChild as SVGTextElement; // Special cost const g2 = document.createElementNS('http://www.w3.org/2000/svg', 'g'); this.specialCostGroup = g2; g2.setAttribute('class', 'specialCost'); - g2.setAttribute('transform', 'translate(170 806) scale(0.32)'); + g2.setAttribute('transform', 'translate(118 561) scale(0.222)'); svg.appendChild(g2); this.setSpecialCost(card.specialCost);