Update game-datcards-improved.user.js
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Game Datacards - Improved
|
// @name Game Datacards - Improved
|
||||||
// @namespace local
|
// @namespace local
|
||||||
// @version 1.2
|
// @version 1.3
|
||||||
// @description Adds card image export/import (ZIP) to the header, a button to rotate card backs for printing and a toggle for the official 10th edition card font
|
// @description Adds card image export/import (ZIP) to the header, a button to rotate card backs for printing and a toggle for the official 10th edition card font
|
||||||
// @match *://game-datacards.eu/*
|
// @match *://game-datacards.eu/*
|
||||||
// @grant none
|
// @grant none
|
||||||
@@ -200,10 +200,12 @@
|
|||||||
// nothing about how large the app happens to draw that card. So instead of
|
// nothing about how large the app happens to draw that card. So instead of
|
||||||
// using pt directly, measure each card and derive how many layout pixels one
|
// using pt directly, measure each card and derive how many layout pixels one
|
||||||
// point of the printed card is worth; --gdc-pt below carries that value.
|
// point of the printed card is worth; --gdc-pt below carries that value.
|
||||||
// Printed datacard width, 7in. Raising it shrinks all card text and lowering
|
// Printed datacard width, 8in. Measured back from an official card: its body
|
||||||
// it grows it, so it doubles as the tuning knob for the overall type size:
|
// text sits at ~1.3% of the card width, which puts 7.5pt at this reference.
|
||||||
|
// Raising it shrinks all card text and lowering it grows it, so it doubles as
|
||||||
|
// the tuning knob for the overall type size:
|
||||||
// localStorage.setItem('gdc-card-width-pt', 560)
|
// localStorage.setItem('gdc-card-width-pt', 560)
|
||||||
const CARD_WIDTH_PT = 504;
|
const CARD_WIDTH_PT = 576;
|
||||||
|
|
||||||
function cardWidthPt() {
|
function cardWidthPt() {
|
||||||
return Number(localStorage.getItem('gdc-card-width-pt')) || CARD_WIDTH_PT;
|
return Number(localStorage.getItem('gdc-card-width-pt')) || CARD_WIDTH_PT;
|
||||||
@@ -231,10 +233,11 @@
|
|||||||
return `
|
return `
|
||||||
.unit, .unit * { font-family: ${CARD_FONT}, sans-serif !important; }
|
.unit, .unit * { font-family: ${CARD_FONT}, sans-serif !important; }
|
||||||
|
|
||||||
/* Unit name: extra bold 15pt */
|
/* Unit name: extra bold 15pt, slightly tracked out as on the printed card */
|
||||||
.unit .name_container .name {
|
.unit .name_container .name {
|
||||||
font-weight: 800 !important;
|
font-weight: 800 !important;
|
||||||
font-size: ${pt(15)} !important;
|
font-size: ${pt(15)} !important;
|
||||||
|
letter-spacing: 0.02em !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unit description: light italic 8pt */
|
/* Unit description: light italic 8pt */
|
||||||
@@ -252,26 +255,39 @@
|
|||||||
font-size: ${pt(14)} !important;
|
font-size: ${pt(14)} !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Section banners ("RANGED WEAPONS", "ABILITIES", "KEYWORDS:") are set a
|
||||||
|
step larger than body text on the printed card, and tracked out. */
|
||||||
|
.unit .heading .title:not(.center),
|
||||||
|
.unit .invul .title,
|
||||||
|
.unit .footer .title {
|
||||||
|
font-weight: 700 !important;
|
||||||
|
font-size: ${pt(9)} !important;
|
||||||
|
letter-spacing: 0.04em !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* General weapon and abilities text: regular or bold 7.5pt */
|
/* General weapon and abilities text: regular or bold 7.5pt */
|
||||||
.unit .stats_container .caption,
|
.unit .stats_container .caption,
|
||||||
.unit .invul .title,
|
.unit .heading .title.center,
|
||||||
.unit .heading .title,
|
|
||||||
.unit .ability .name,
|
.unit .ability .name,
|
||||||
.unit .ability .title,
|
.unit .ability .value,
|
||||||
.unit .footer .title,
|
|
||||||
.unit .footer .value {
|
.unit .footer .value {
|
||||||
font-weight: 700 !important;
|
font-weight: 700 !important;
|
||||||
font-size: ${pt(7.5)} !important;
|
font-size: ${pt(7.5)} !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.unit .weapon .value,
|
.unit .weapon .value,
|
||||||
.unit .ability .value,
|
.unit .ability .title,
|
||||||
.unit .ability .description,
|
.unit .ability .description,
|
||||||
.unit .description-container .description {
|
.unit .description-container .description {
|
||||||
font-weight: 400 !important;
|
font-weight: 400 !important;
|
||||||
font-size: ${pt(7.5)} !important;
|
font-size: ${pt(7.5)} !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Keyword lists are small caps, not the plain title case the app uses. */
|
||||||
|
.unit .footer .value {
|
||||||
|
font-variant-caps: small-caps !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* Weapon abilities (the keyword/rule chips): bold 5.5pt */
|
/* Weapon abilities (the keyword/rule chips): bold 5.5pt */
|
||||||
.unit .keyword-button,
|
.unit .keyword-button,
|
||||||
.unit .keyword-button span,
|
.unit .keyword-button span,
|
||||||
|
|||||||
Reference in New Issue
Block a user