diff --git a/index.html b/index.html index d9b8b76..4f62b14 100644 --- a/index.html +++ b/index.html @@ -15,6 +15,8 @@

Help

+

What fonts can I use?

+

The fonts from Google Fonts are supported. Put in the name of the font into the corresponding property and you're all set!

How do I add an icon to my asset?

If you want a unicode character, just set the value of the 'icon' attribute to that character in quotes:

"icon": "▿"
@@ -45,7 +47,7 @@

How do I add an icon to my asset?

-

Ironsworn Asset Workbench v0.4.1

+

Ironsworn Asset Workbench v0.5.0

diff --git a/src/asset.js b/src/asset.js index d3adeaf..892240c 100644 --- a/src/asset.js +++ b/src/asset.js @@ -71,19 +71,51 @@ const populateIfExists = (text, value) => { return value ? text.replace("REPLACE", value) : "" } +const createGoogleFontString = (...fonts) => { + let urlifiedFonts = Array.from(new Set(fonts)) + .filter(font => font) + .map(font => font.replace(/ /g, "+")) + .join("|") + return urlifiedFonts ? `https://fonts.googleapis.com/css?family=${urlifiedFonts}&display=swap` : "" +} + +const defaultFontConfig = { + assetTypeFontSize: "1.03em", + assetTypeFont: "Simonetta", + assetNameFontSize: "1.26em", + assetNameFont: "Simonetta", + detailsFontSize: "0.97em", + detailsFont: "PT Serif", + trackFontSize: "1.42em", + trackFont: "Simonetta" +} + +const makeMergedConfig = (config) => { + return Object.assign({}, defaultFontConfig, config) +} + const createStyles = (fonts = {}) => { - return `` } diff --git a/src/exampleAssetLoader.js b/src/exampleAssetLoader.js index 6e78a0d..26ee000 100644 --- a/src/exampleAssetLoader.js +++ b/src/exampleAssetLoader.js @@ -8,7 +8,7 @@ const showSingleAssetExample = (asset) => { showAsset(asset, assetScale) } -export const loadDefaultExampleAsset = () => showSingleAssetExample(ironclad) +export const loadDefaultExampleAsset = () => showSingleAssetExample(caveLion) const showLightbearerAssetButton = document.querySelector("#lightbearer-example") showLightbearerAssetButton.onclick = () => showSingleAssetExample(lightbearer) diff --git a/src/exampleAssets.js b/src/exampleAssets.js index 3245ef7..36aeecf 100644 --- a/src/exampleAssets.js +++ b/src/exampleAssets.js @@ -1,15 +1,19 @@ export const ironclad = { fonts: { assetTypeFontSize: "1.03em", - assetNameFontSize: "1.26em", + assetTypeFont: "Noto Sans JP", + assetNameFontSize: "1.76em", + assetNameFont: "Russo One", detailsFontSize: "0.97em", - trackFontSize: "1.42em" + detailsFont: "Quicksand", + trackFontSize: "1.12em", + trackFont: "Krona One" }, type: "combat talent", name: "Ironclad", writeIn: "", track: ["LIGHTLY ARMORED", "GEARED FOR WAR"], - description: "If you wear armor...", + description: "If you wear high-tech armor...", abilities: [ { filled: true, @@ -28,11 +32,17 @@ export const ironclad = { type: "svg", author: "Delapouite", name: "Light Helm icon", - svg: '' + svg: '' } } export const lightbearer = { + fonts: { + assetTypeFontSize: "1.03em", + assetNameFontSize: "1.26em", + detailsFontSize: "0.97em", + trackFontSize: "1.42em", + }, type: "ritual", name: "Lightbearer", track: 6,