diff --git a/Apps/HeroSummaryCardV1/content.hbs b/Apps/HeroSummaryCardV1/content.hbs new file mode 100644 index 0000000..7c63780 --- /dev/null +++ b/Apps/HeroSummaryCardV1/content.hbs @@ -0,0 +1,24 @@ +
+ {{!-- * Header --}} +
+
Logo Image
+ +
+ Player +
+
+ + + {{!-- * Armour --}} +
+ + {{!-- * Fate & Advancement --}} + + {{!-- * Weapons --}} + + {{!-- * Skills --}} + + {{!-- * Equipment --}} +
diff --git a/Apps/HeroSummaryCardV1/style.css b/Apps/HeroSummaryCardV1/style.css new file mode 100644 index 0000000..163f195 --- /dev/null +++ b/Apps/HeroSummaryCardV1/style.css @@ -0,0 +1,50 @@ +.ripcrypt .HeroSummaryCardV1 { + display: grid; + grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2.5fr); + grid-template-rows: repeat(15, minmax(0, 1fr)); + column-gap: var(--col-gap); + + background: white; + color: black; + + .row-alt { + background: rgba(0,0,0, 0.3); + } + + label { + box-sizing: border-box; + padding: 2px 4px; + } + + input { + box-sizing: border-box; + border: none; + + &[type="text"], + &[type="number"] { + padding: 2px 4px; + border-bottom: 2px dashed blueviolet; + } + } + + .hero_name { + grid-column: span 3; + margin-left: calc(var(--col-gap) * -1); + padding-left: var(--col-gap); + } + + .header { + grid-row: span 2; + grid-column: span 1; + display: grid; + grid-template-rows: subgrid; + grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); + + .image { + grid-row: span 2; + display: flex; + justify-content: center; + align-items: center; + } + } +} diff --git a/Apps/common.css b/Apps/common.css new file mode 100644 index 0000000..bfd8397 --- /dev/null +++ b/Apps/common.css @@ -0,0 +1,12 @@ +.ripcrypt { + .window-content { + padding: 0; + margin: 0; + } + + .HeroSummaryCardV1 { + height: 270px; + width: 680px; + --col-gap: 2px; + } +} diff --git a/langs/en-ca.json b/langs/en-ca.json index 6297e90..af3b8f9 100644 --- a/langs/en-ca.json +++ b/langs/en-ca.json @@ -3,5 +3,10 @@ "Actor": { "hero": "Hero" } + }, + "RipCrypt": { + "sheet-names": { + "HeroSummaryCardV1": "Hero Stat Card" + } } } diff --git a/module/Apps/ActorSheets/HeroSummaryCardV1.mjs b/module/Apps/ActorSheets/HeroSummaryCardV1.mjs new file mode 100644 index 0000000..8bf9cfc --- /dev/null +++ b/module/Apps/ActorSheets/HeroSummaryCardV1.mjs @@ -0,0 +1,53 @@ +import { filePath } from "../../consts.mjs"; + +const { DocumentSheetV2, HandlebarsApplicationMixin } = foundry.applications.api; + +export class HeroSummaryCardV1 extends HandlebarsApplicationMixin(DocumentSheetV2) { + + // #region Options + static DEFAULT_OPTIONS = { + classes: [ + `ripcrypt`, + `ripcrypt--actor`, + `ripcrypt--HeroSummaryCardV1`, + `ripcrypt-theme--dark`, + ], + position: { + width: `auto`, + height: `auto`, + }, + window: { + resizable: false, + }, + actions: {}, + form: { + submitOnChange: true, + closeOnSubmit: false, + }, + }; + + static PARTS = { + content: { + template: filePath(`Apps/HeroSummaryCardV1/content.hbs`), + }, + }; + // #endregion + + // #region Lifecycle + async _preparePartContext(partId, ctx, opts) { + ctx = await super._preparePartContext(partId, ctx, opts); + + ctx.meta ??= {}; + ctx.meta.idp = this.document.uuid; + + partId = partId.slice(0,1).toUpperCase() + partId.slice(1); + if (this[`_prepare${partId}Context`] != null) { + ctx = await this[`_prepare${partId}Context`](ctx, opts); + }; + return ctx; + }; + // #endregion + + // #region Actions + // #endregion +}; diff --git a/module/consts.mjs b/module/consts.mjs new file mode 100644 index 0000000..dc5d000 --- /dev/null +++ b/module/consts.mjs @@ -0,0 +1,7 @@ +// MARK: filePath +export function filePath(path) { + if (path.startsWith(`/`)) { + path = path.slice(1); + }; + return `systems/ripcrypt/${path}`; +}; diff --git a/system.json b/system.json index ae53692..b5d96f2 100644 --- a/system.json +++ b/system.json @@ -17,7 +17,10 @@ "esmodules": [ "module/main.mjs" ], - "styles": [], + "styles": [ + "Apps/common.css", + "Apps/HeroSummaryCardV1/style.css" + ], "languages": [ { "lang": "en",