3 Commits

Author SHA1 Message Date
  Okos 8df774e11a make icons work again 5 years ago
  Okos 08ab4cae31 bugbear ability fix 5 years ago
  Okos 86984ca943 bigger dnd stats 5 years ago
3 changed files with 16 additions and 8 deletions
  1. 2
    1
      generator/css/cards.css
  2. 1
    1
      generator/data/card_data_example.js
  3. 13
    6
      generator/js/cards.js

+ 2
- 1
generator/css/cards.css View File

@@ -238,7 +238,8 @@
238 238
 }
239 239
 
240 240
 .card-stats {
241
-    width: 100%
241
+    width: 100%;
242
+    font-size: 10pt;
242 243
 }
243 244
 
244 245
 .card-stats-header {

+ 1
- 1
generator/data/card_data_example.js View File

@@ -17,7 +17,7 @@ var card_data_example = [
17 17
       "fill",
18 18
       "section | Abilities",
19 19
       "description | Brute| A melee weapon deals one extra die of its damage when the bugbear hits with it (included in the attack).",
20
-      "description | Surprise Attack | If the bugbear surprises a creature and hitsection | Actionss it with an attack during the first round of combat, the target takes an extra 7 (2d6) damage from the attack.",
20
+      "description | Surprise Attack | If the bugbear surprises a creature and hits it with an attack during the first round of combat, the target takes an extra 7 (2d6) damage from the attack.",
21 21
       "fill",
22 22
       "section | Actions",
23 23
       "description | Morningstar | Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 11 (2d8 + 2) piercing damage.",

+ 13
- 6
generator/js/cards.js View File

@@ -97,13 +97,20 @@ function card_element_icon(card_data, options) {
97 97
         classname = "inlineicon";
98 98
     }
99 99
 
100
-    var stats = card_data.stats?card_data_split_params(card_data.stats):[];
101 100
     var result = "";
102
-    result += '<div class="card-title-' + classname + '-container">';
103
-    result += '<img class="inline-logo" src="img/footprint.png">' + (stats[0]||"?");
104
-    result += '<img class="inline-logo" src="img/hearts.png">' + (stats[1]||"?");
105
-    result += '<img class="inline-logo" src="img/shield.png">' + (stats[2]||"?");
106
-    result += '</div>';
101
+    if(card_data.icon) {
102
+        result += '<div class="card-title-' + classname + '-container">';
103
+        result += '    <div class="card-title-' + classname + ' icon-' + icon + '">';
104
+        result += '    </div>';
105
+        result += '</div>';
106
+    } else {
107
+        var stats = card_data.stats?card_data_split_params(card_data.stats):[];
108
+        result += '<div class="card-title-' + classname + '-container">';
109
+        result += '<img class="inline-logo" src="img/footprint.png">' + (stats[0]||"?");
110
+        result += '<img class="inline-logo" src="img/hearts.png">' + (stats[1]||"?");
111
+        result += '<img class="inline-logo" src="img/shield.png">' + (stats[2]||"?");
112
+        result += '</div>';
113
+    }
107 114
     return result;
108 115
 }
109 116
 

Loading…
Cancel
Save