ソースを参照

Title font size, modal print info dialog

crobi 10年前
コミット
4e940c5ea2

+ 23
- 12
generator/css/cards.css ファイルの表示

@@ -99,23 +99,34 @@
99 99
     background-color: inherit;
100 100
     color: white;
101 101
 }
102
-.card-title-big {
103
-    font-size: 6mm;
104
-    line-height: 6mm;
102
+.card-title-16 {
103
+    font-size: 16pt;
104
+    line-height: 6.5mm;
105 105
 }
106
-.card-title-normal {
107
-    font-size: 5mm;
108
-    line-height: 6mm;
106
+.card-title-15 {
107
+    font-size: 15pt;
108
+    line-height: 6.5mm;
109 109
 }
110
-.card-title-small {
111
-    font-size: 4mm;
110
+.card-title-14 {
111
+    font-size: 14pt;
112 112
     line-height: 6.5mm;
113 113
 }
114
-.card-title-tiny {
115
-    font-size: 3.5mm;
116
-    line-height: 6.75mm;
114
+.card-title-13 {
115
+    font-size: 13pt;
116
+    line-height: 7mm;
117
+}
118
+.card-title-12 {
119
+    font-size: 12pt;
120
+    line-height: 7mm;
121
+}
122
+.card-title-11 {
123
+    font-size: 11pt;
124
+    line-height: 7.5mm;
125
+}
126
+.card-title-10 {
127
+    font-size: 10pt;
128
+    line-height: 7.5mm;
117 129
 }
118
-
119 130
 .card-subtitle {
120 131
     height: 18px;
121 132
     line-height: 18px;

+ 7
- 1
generator/css/output.css ファイルの表示

@@ -2,6 +2,12 @@
2 2
   background: rgb(204,204,204); 
3 3
 }
4 4
 
5
+body {
6
+    display: flex;
7
+    justify-content:center;
8
+    align-content:center;
9
+}
10
+
5 11
 .page-preview {
6 12
     background: white;
7 13
     margin: 0 auto;
@@ -21,4 +27,4 @@
21 27
     /* Set the background to gray to visualize the page size in the print preview */
22 28
     background-color: gray;
23 29
   }
24
-}
30
+}

+ 1
- 1
generator/data/card_data_example.js ファイルの表示

@@ -77,7 +77,7 @@ var card_data_example = [
77 77
         "count": 1,
78 78
         "color": "dimgray",
79 79
         "title": "Shortsword of Very Long Names",
80
-        "title_size": "tiny",
80
+        "title_size": "10",
81 81
         "icon": "crossed-swords",
82 82
         "contents": [
83 83
             "subtitle | Simple melee weapon (10gp)",

+ 52
- 8
generator/generate.html ファイルの表示

@@ -153,10 +153,13 @@
153 153
                         <label for="default-title-size" class="col-sm-2 control-label">Title</label>
154 154
                         <div class="col-sm-10">
155 155
                             <select class="form-control" id="default-title-size">
156
-                                <option value="big">big font</option>
157
-                                <option value="normal" selected>normal font</option>
158
-                                <option value="small">small font</option>
159
-                                <option value="tiny">tiny font</option>
156
+                                <option value="16">16pt font</option>
157
+                                <option value="15">15pt font</option>
158
+                                <option value="14">14pt font</option>
159
+                                <option value="13" selected>13pt font</option>
160
+                                <option value="12">12pt font</option>
161
+                                <option value="11">11pt font</option>
162
+                                <option value="10">10pt font</option>
160 163
                             </select>
161 164
                         </div>
162 165
                     </div>
@@ -211,10 +214,25 @@
211 214
                             <input type="text" id="card-title" class="form-control" placeholder="Title">
212 215
                         </div>
213 216
                     </div>
217
+                    <div class="form-group">
218
+                        <label for="card-title-size" class="col-sm-2 control-label">Title</label>
219
+                        <div class="col-sm-10">
220
+                            <select class="form-control" id="card-title-size" data-property="title_size">
221
+                                <option value="" selected>default font</option>
222
+                                <option value="16">16pt font</option>
223
+                                <option value="15">15pt font</option>
224
+                                <option value="14">14pt font</option>
225
+                                <option value="13">13pt font</option>
226
+                                <option value="12">12pt font</option>
227
+                                <option value="11">11pt font</option>
228
+                                <option value="10">10pt font</option>
229
+                            </select>
230
+                        </div>
231
+                    </div>
214 232
                     <div class="form-group">
215 233
                         <label for="card-count" class="col-sm-2 control-label">Count</label>
216 234
                         <div class="col-sm-10">
217
-                            <input type="number" id="card-count" class="form-control" placeholder="Count" data-property="count">
235
+                            <input type="number" id="card-count" class="form-control" placeholder="Count" data-property="count" value="1">
218 236
                         </div>
219 237
                     </div>
220 238
                     <div class="form-group">
@@ -224,7 +242,7 @@
224 242
                                 <span class="input-group-btn">
225 243
                                     <button class="btn btn-default icon-select-button" type="button">Search</button>
226 244
                                 </span>
227
-                                <input type="text" id="card-icon" class="form-control icon-list" placeholder="Icon name (default icon if empty)" data-property="icon">
245
+                                <input type="text" id="card-icon" class="form-control icon-list" placeholder="Default icon" data-property="icon">
228 246
                             </div>
229 247
                         </div>
230 248
                     </div>
@@ -235,7 +253,7 @@
235 253
                                 <span class="input-group-btn">
236 254
                                     <button class="btn btn-default icon-select-button" type="button">Search</button>
237 255
                                 </span>
238
-                                <input type="text" id="card-icon-back" class="form-control icon-list" placeholder="Icon name (same as front if empty)" data-property="icon_back">
256
+                                <input type="text" id="card-icon-back" class="form-control icon-list" placeholder="Same as front" data-property="icon_back">
239 257
                             </div>
240 258
                         </div>
241 259
                     </div>
@@ -244,7 +262,7 @@
244 262
                         <div class="col-sm-10">
245 263
                             <div class="input-group">
246 264
                                 <select id="card_color_selector" class="colorselector-data"></select>
247
-                                <input type="text" id="card-color" class="form-control" placeholder="Card color (default color if empty)" data-property="color">
265
+                                <input type="text" id="card-color" class="form-control" placeholder="Default color" data-property="color">
248 266
                             </div>
249 267
                         </div>
250 268
                     </div>
@@ -263,5 +281,31 @@
263 281
             </div>
264 282
         </div>
265 283
     </div>
284
+    <!-- Modal -->
285
+    <div class="modal" id="print-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
286
+        <div class="modal-dialog">
287
+            <div class="modal-content">
288
+                <div class="modal-header">
289
+                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
290
+                    <h4 class="modal-title" id="myModalLabel">Printing generated cards</h4>
291
+                </div>
292
+                <div class="modal-body">
293
+                    <ul>
294
+                        <li>The generated cards open in a new tab or window. If you don't see any new tab or window, check your popup blocker.</li>
295
+                        <li>Make sure to use the correct paper size (same as in the editor).</li>
296
+                        <li>Enable double sided printing (flip on long edge).</li>
297
+                        <li>Do not scale the document to fit the page.</li>
298
+                        <li>
299
+                            Some printers are not very precise (pages print slightly shifted or rotated) and the cards will not line up with the card backs.
300
+                            If this is the case, there's nothing you can do. Try a different printer or print single-sided.
301
+                        </li>
302
+                    </ul>
303
+                </div>
304
+                <div class="modal-footer">
305
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Ok, got it</button>
306
+                </div>
307
+            </div>
308
+        </div>
309
+    </div>
266 310
 </body>
267 311
 </html>

+ 1
- 1
generator/js/cards.js ファイルの表示

@@ -5,7 +5,7 @@ function card_default_options() {
5 5
     return {
6 6
         default_color: "black",
7 7
         default_icon: "ace",
8
-        default_title_size: "normal",
8
+        default_title_size: "13",
9 9
         page_size: "A4",
10 10
         page_rows: 3,
11 11
         page_columns: 3,

+ 8
- 0
generator/js/ui.js ファイルの表示

@@ -33,6 +33,7 @@ function merge(left, right, compare) {
33 33
     return result;
34 34
 }
35 35
 
36
+var ui_generate_modal_shown = false;
36 37
 function ui_generate() {
37 38
     // Generate output HTML
38 39
     var card_html = card_pages_generate_html(card_data, card_options);
@@ -41,6 +42,11 @@ function ui_generate() {
41 42
     // Use a separate window to avoid CSS conflicts
42 43
     var tab = window.open("output.html", 'rpg-cards-output');
43 44
 
45
+    if (ui_generate_modal_shown == false) {
46
+        $("#print-modal").modal('show');
47
+        ui_generate_modal_shown = true;
48
+    }
49
+
44 50
     // Send the generated HTML to the new window
45 51
     // Use a delay to give the new window time to set up a message listener
46 52
     setTimeout(function () { tab.postMessage(card_html, '*') }, 100);
@@ -148,6 +154,7 @@ function ui_update_selected_card() {
148 154
     var card = ui_selected_card();
149 155
     if (card) {
150 156
         $("#card-title").val(card.title);
157
+        $("#card-title-size").val(card.title_size);
151 158
         $("#card-count").val(card.count);
152 159
         $("#card-icon").val(card.icon);
153 160
         $("#card-icon-back").val(card.icon_back);
@@ -368,6 +375,7 @@ $(document).ready(function () {
368 375
     $("#selected-card").change(ui_update_selected_card);
369 376
 
370 377
     $("#card-title").change(ui_change_card_title);
378
+    $("#card-title-size").change(ui_change_card_property);
371 379
     $("#card-icon").change(ui_change_card_property);
372 380
     $("#card-count").change(ui_change_card_property);
373 381
     $("#card-icon-back").change(ui_change_card_property);

読み込み中…
キャンセル
保存