diff --git a/Apps/HeroSkillsCardV1/content.hbs b/Apps/HeroSkillsCardV1/content.hbs new file mode 100644 index 0000000..0d9fc80 --- /dev/null +++ b/Apps/HeroSkillsCardV1/content.hbs @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/Apps/HeroSkillsCardV1/style.css b/Apps/HeroSkillsCardV1/style.css new file mode 100644 index 0000000..fd2b8f7 --- /dev/null +++ b/Apps/HeroSkillsCardV1/style.css @@ -0,0 +1,32 @@ +.ripcrypt .HeroSummaryCardV1 { + + /* Foundry Variable Tweaks */ + --input-height: 1rem; + + display: grid; + grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1.25fr) minmax(0, 2.5fr); + grid-template-rows: repeat(15, minmax(0, 1fr)); + column-gap: var(--col-gap); + + background: var(--base-background); + color: var(--base-text); + + .col-header { + background: var(--section-header-background); + color: var(--section-header-text); + } + .row-alt { + background: var(--alt-row-background); + color: var(--alt-row-text); + } + + label, .label { + box-sizing: border-box; + padding: 2px 4px; + text-transform: uppercase; + font-size: var(--font-size-14); + overflow: hidden; + text-overflow: ellipsis; + font-weight: bold; + } +} diff --git a/Apps/HeroSummaryCardV1/content.hbs b/Apps/HeroSummaryCardV1/content.hbs index 4ec428e..9fa9812 100644 --- a/Apps/HeroSummaryCardV1/content.hbs +++ b/Apps/HeroSummaryCardV1/content.hbs @@ -182,13 +182,14 @@ {{#if @root.meta.editable}} diff --git a/Apps/HeroSummaryCardV1/style.css b/Apps/HeroSummaryCardV1/style.css index 4888b4f..8d23752 100644 --- a/Apps/HeroSummaryCardV1/style.css +++ b/Apps/HeroSummaryCardV1/style.css @@ -8,15 +8,16 @@ grid-template-rows: repeat(15, minmax(0, 1fr)); column-gap: var(--col-gap); - background: white; - color: black; + background: var(--base-background); + color: var(--base-text); .col-header { - background: black; - color: white; + background: var(--section-header-background); + color: var(--section-header-text); } .row-alt { - background: rgba(0,0,0, 0.3); + background: var(--alt-row-background); + color: var(--alt-row-text); } label, .label { @@ -132,7 +133,7 @@ flex-direction: column; justify-content: center; align-items: center; - border: 2px solid black; + border: 2px solid var(--accent-1); border-radius: 50%; font-size: 1.5rem; position: relative; @@ -161,7 +162,7 @@ content: ""; width: 69%; height: 2px; - background: black; + background: var(--accent-1); transform: rotate(-45deg); } diff --git a/Apps/apps.css b/Apps/apps.css new file mode 100644 index 0000000..5fee16a --- /dev/null +++ b/Apps/apps.css @@ -0,0 +1,2 @@ +@import url("./HeroSummaryCardV1/style.css"); +@import url("./HeroSkillsCardV1/style.css"); diff --git a/Apps/common.css b/Apps/common.css index 5faac68..dcd2621 100644 --- a/Apps/common.css +++ b/Apps/common.css @@ -1,3 +1,5 @@ +@import url("./vars.css"); + @import url("./elements/button.css"); @import url("./elements/input.css"); @import url("./elements/select.css"); diff --git a/Apps/elements/button.css b/Apps/elements/button.css index 63474d4..bcd0375 100644 --- a/Apps/elements/button.css +++ b/Apps/elements/button.css @@ -1,8 +1,10 @@ .ripcrypt > .window-content button { all: revert; padding: 2px 4px; + background: var(--button-background); + color: var(--button-text); - &.roll { + &.icon { padding: 0; border-radius: 50%; outline: none; diff --git a/Apps/elements/input.css b/Apps/elements/input.css index 09276bc..0ab1fa0 100644 --- a/Apps/elements/input.css +++ b/Apps/elements/input.css @@ -7,12 +7,13 @@ font-family: inherit; font-size: inherit; position: relative; - background: none; + background: var(--input-background); + color: var(--input-text); padding: 0px 4px; &[type="text"], &[type="number"] { - border-bottom: 2px dashed purple; + border-bottom: var(--input-underline); } } } diff --git a/Apps/themes/dark.css b/Apps/themes/dark.css new file mode 100644 index 0000000..8a9feff --- /dev/null +++ b/Apps/themes/dark.css @@ -0,0 +1,22 @@ +.theme-rc-dark, +.theme-dark { + --accent-1: #056162; + --accent-2: #04262a; + --accent-3: #4fb258; + + --section-header-text: white; + --section-header-background: var(--accent-1); + + --base-text: white; + --base-background: black; + + --alt-row-text: white; + --alt-row-background: var(--accent-2); + + --input-underline: 2px dashed var(--accent-3); + --input-background: inherit; + --input-text: white; + + --button-background: black; + --button-text: var(--accent-3); +} diff --git a/Apps/themes/light.css b/Apps/themes/light.css new file mode 100644 index 0000000..ecb01c7 --- /dev/null +++ b/Apps/themes/light.css @@ -0,0 +1,14 @@ +.theme-rc-light, +.theme-light { + --header-text: white; + --header-background: black; + + --section-header-text: white; + --section-header-background: black; + + --alt-row-text: black; + --alt-row-background: rgba(0,0,0, 0.3); + + --base-text: black; + --base-background: white; +} \ No newline at end of file diff --git a/Apps/vars.css b/Apps/vars.css new file mode 100644 index 0000000..1717592 --- /dev/null +++ b/Apps/vars.css @@ -0,0 +1,2 @@ +@import url("./themes/dark.css"); +/* @import url("./themes/light.css"); */ diff --git a/assets/icons/roll.svg b/assets/icons/roll.svg index 8abfb3a..4d2a61b 100644 --- a/assets/icons/roll.svg +++ b/assets/icons/roll.svg @@ -1,6 +1,5 @@ - Layer 1 \ No newline at end of file diff --git a/langs/en-ca.json b/langs/en-ca.json index 05d89e9..2074fa0 100644 --- a/langs/en-ca.json +++ b/langs/en-ca.json @@ -9,7 +9,8 @@ }, "RipCrypt": { "sheet-names": { - "HeroSummaryCardV1": "Hero Stat Card" + "HeroSummaryCardV1": "Hero Stat Card", + "HeroSkillsCardV1": "Hero Skill Card" }, "common": { "empty": "---", diff --git a/module/Apps/ActorSheets/HeroSkillsCardV1.mjs b/module/Apps/ActorSheets/HeroSkillsCardV1.mjs new file mode 100644 index 0000000..799e604 --- /dev/null +++ b/module/Apps/ActorSheets/HeroSkillsCardV1.mjs @@ -0,0 +1,52 @@ +import { filePath } from "../../consts.mjs"; +import { gameTerms } from "../../gameTerms.mjs"; +import { GenericAppMixin } from "../GenericApp.mjs"; +import { localizer } from "../../utils/Localizer.mjs"; +import { Logger } from "../../utils/Logger.mjs"; + +const { HandlebarsApplicationMixin } = foundry.applications.api; +const { ActorSheetV2 } = foundry.applications.sheets; + +export class HeroSkillsCardV1 extends GenericAppMixin(HandlebarsApplicationMixin(ActorSheetV2)) { + + // #region Options + static DEFAULT_OPTIONS = { + classes: [ + `ripcrypt--actor`, + `ripcrypt--HeroSkillsCardV1`, + ], + position: { + width: `auto`, + height: `auto`, + }, + window: { + resizable: false, + }, + actions: { + }, + form: { + submitOnChange: true, + closeOnSubmit: false, + }, + }; + + static PARTS = { + content: { + template: filePath(`Apps/HeroSkillsCardV1/content.hbs`), + }, + }; + // #endregion + + // #region Lifecycle + async _preparePartContext(partId, ctx, opts) { + ctx = await super._preparePartContext(partId, ctx, opts); + ctx.actor = this.document; + + Logger.debug(`Context:`, ctx); + return ctx; + }; + // #endregion + + // #region Actions + // #endregion +}; diff --git a/module/Apps/GenericApp.mjs b/module/Apps/GenericApp.mjs index 7832956..8ebd20f 100644 --- a/module/Apps/GenericApp.mjs +++ b/module/Apps/GenericApp.mjs @@ -18,6 +18,10 @@ export function GenericAppMixin(HandlebarsApp) { roll: this.rollDice, }, }; + + static themes = { + dark: `SETTINGS.UI.FIELDS.colorScheme.dark`, + }; // #endregion // #region Lifecycle diff --git a/module/hooks/init.mjs b/module/hooks/init.mjs index e8ebf03..c5ad784 100644 --- a/module/hooks/init.mjs +++ b/module/hooks/init.mjs @@ -1,4 +1,5 @@ // Applications +import { HeroSkillsCardV1 } from "../Apps/ActorSheets/HeroSkillsCardV1.mjs"; import { HeroSummaryCardV1 } from "../Apps/ActorSheets/HeroSummaryCardV1.mjs"; // Data Models @@ -38,6 +39,12 @@ Hooks.once(`init`, () => { makeDefault: true, types: [`hero`], label: `RipCrypt.sheet-names.HeroSummaryCardV1`, + themes: HeroSummaryCardV1.themes, + }); + Actors.registerSheet(game.system.id, HeroSkillsCardV1, { + types: [`hero`], + label: `RipCrypt.sheet-names.HeroSkillsCardV1`, + themes: HeroSkillsCardV1.themes, }); // #endregion // #endregion diff --git a/system.json b/system.json index c6ff7c6..30a907e 100644 --- a/system.json +++ b/system.json @@ -19,7 +19,7 @@ ], "styles": [ "Apps/common.css", - "Apps/HeroSummaryCardV1/style.css" + "Apps/apps.css" ], "languages": [ {