diff --git a/src/10th/Roster.jsx b/src/10th/Roster.jsx index d2b622f..7c8ac88 100644 --- a/src/10th/Roster.jsx +++ b/src/10th/Roster.jsx @@ -302,6 +302,9 @@ const Unit = ({ unit, index, catalog, onePerPage, forceRules }) => { className="print-display-none" accept=".jpg,.png,.jpeg,.gif,.bmp,.tif,.tiff,.webp,.svg,.jfif,.pjpeg,.pjp,.avif,.apng,.ico,.cur,.ani" onChange={(e) => { + posthog?.capture?.("user_uploaded_image", { + unit_name: name, + }); if (e.target.files && e.target.files[0]) { let reader = new FileReader(); reader.onload = function (ev) { @@ -535,7 +538,7 @@ const Keywords = ({ keywords }) => { KEYWORDS: 80 ? ".8em" : "1em", + fontSize: joinedKeywords.length > 70 ? ".8em" : "1em", fontWeight: 800, }} > diff --git a/src/10th/Weapons.jsx b/src/10th/Weapons.jsx index 32e1743..775ef92 100644 --- a/src/10th/Weapons.jsx +++ b/src/10th/Weapons.jsx @@ -132,6 +132,7 @@ const Weapon = ({ weapon, previousWeapon, nextWeapon, isMelee, className }) => { fontWeight: 700, color: "var(--primary-color)", textTransform: "uppercase", + lineHeight: 1, }} > [{type}] diff --git a/src/App.jsx b/src/App.jsx index 74efd5c..32f6bd4 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -53,12 +53,14 @@ function App() { break; } // load example - + posthog?.capture?.("user_loaded_example", { + roster_faction: event, + }); const arrayBuffer = await example.arrayBuffer(); // Create a new Blob object from the zip file contents const zipBlob = new Blob([arrayBuffer], { type: "application/zip" }); const xmldata = await unzip(zipBlob); - parseXML(xmldata, false); + parseXML(xmldata, false, true); } } const loadFromLocalStorage = (roster) => { @@ -71,6 +73,10 @@ function App() { setEdition(10); setError(""); } + posthog?.capture?.("user_loaded_roster_from_localstorage", { + roster_faction: roster.forces[0].catalog, + roster_type: roster.gameType, + }); }; const unzip = async (file) => { @@ -83,7 +89,7 @@ function App() { } }; - function parseXML(xmldata, addToLocalStorage) { + function parseXML(xmldata, addToLocalStorage, isExample = false) { const parser = new DOMParser(); const doc = parser.parseFromString(xmldata, "text/xml"); if (!doc) return; @@ -111,7 +117,6 @@ function App() { } } else if (gameType == "Warhammer 40,000 10th Edition") { roster = Create40kRoster10th(doc, gameType); - if (roster && roster.forces.length > 0) { setRoster(roster); setEdition(10); @@ -120,8 +125,15 @@ function App() { } else { setError("No support for game type '" + gameType + "'."); } - if (roster && addToLocalStorage) { + if (!roster) { + return; + } + if (addToLocalStorage) { console.log(roster); + posthog?.capture?.("user_uploaded_roster", { + roster_faction: roster.forces[0].catalog, + roster_type: gameType, + }); setRosters(stringifyJSON([roster, ...rostersJSON])); } } @@ -283,7 +295,13 @@ function App() { @@ -395,9 +413,10 @@ function App() { BattleScribe {" "} - roster files in an opinionated format inspired by the new 10th - edition datacards. Additional inspiration and large parts of the - parsing logic come from the{" "} + or New Recruit roster files + in an opinionated format inspired by the new 10th edition datacards. + Additional inspiration and large parts of the parsing logic come + from the{" "} PrettyScribe {" "} @@ -420,7 +439,7 @@ function App() {
Output Examples
- + diff --git a/src/assets/Demo0.png b/src/assets/Demo0.png index 8c84bfb..f0aff0a 100644 Binary files a/src/assets/Demo0.png and b/src/assets/Demo0.png differ diff --git a/src/assets/Demo1.png b/src/assets/Demo1.png index 3f8516f..917cba3 100644 Binary files a/src/assets/Demo1.png and b/src/assets/Demo1.png differ diff --git a/src/index.css b/src/index.css index 9a516e6..76bda34 100644 --- a/src/index.css +++ b/src/index.css @@ -152,7 +152,7 @@ .rosterUploaded, .rosterUploaded:hover { height: auto; - border: 2px solid #999; + border-width: 2px; font-size: 1rem; border-radius: 8px; }