From 5b74fd6bebe4ba067314e14706973afa3d00ee79 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sat, 12 Apr 2025 00:09:45 -0600 Subject: [PATCH] Finish the Skills Card redesign (closes #11) --- module/Apps/ActorSheets/HeroSkillsCardV1.mjs | 3 + templates/Apps/HeroSkillsCardV1/content.hbs | 101 +++++++++++-------- templates/Apps/HeroSkillsCardV1/style.css | 55 ++++++++-- 3 files changed, 112 insertions(+), 47 deletions(-) diff --git a/module/Apps/ActorSheets/HeroSkillsCardV1.mjs b/module/Apps/ActorSheets/HeroSkillsCardV1.mjs index 7ba22e7..2b9b336 100644 --- a/module/Apps/ActorSheets/HeroSkillsCardV1.mjs +++ b/module/Apps/ActorSheets/HeroSkillsCardV1.mjs @@ -11,6 +11,7 @@ import { PopoverEventManager } from "../../utils/PopoverEventManager.mjs"; const { HandlebarsApplicationMixin } = foundry.applications.api; const { ActorSheetV2 } = foundry.applications.sheets; const { ContextMenu } = foundry.applications.ui; +const { deepClone } = foundry.utils; export class HeroSkillsCardV1 extends GenericAppMixin(HandlebarsApplicationMixin(ActorSheetV2)) { @@ -99,6 +100,8 @@ export class HeroSkillsCardV1 extends GenericAppMixin(HandlebarsApplicationMixin ctx = await HeroSkillsCardV1.prepareAmmo(ctx); ctx = await HeroSkillsCardV1.prepareSkills(ctx); + ctx.aura = deepClone(ctx.actor.system.aura); + Logger.debug(`Context:`, ctx); return ctx; }; diff --git a/templates/Apps/HeroSkillsCardV1/content.hbs b/templates/Apps/HeroSkillsCardV1/content.hbs index a4a7a56..a56a331 100644 --- a/templates/Apps/HeroSkillsCardV1/content.hbs +++ b/templates/Apps/HeroSkillsCardV1/content.hbs @@ -104,46 +104,6 @@ {{/each}} -
- -
- {{ rc-i18n "RipCrypt.common.ammo"}} -
-
- {{ ammo }} -
-
- {{#each favouriteAmmo as | data |}} - {{#if data}} -
-
- {{data.name}} -
- -
- {{else}} -
- {{ rc-i18n "RipCrypt.Apps.starred-ammo-placeholder" }} -
- {{/if}} - {{/each}} - {{!-- * Currencies --}}
@@ -180,4 +140,63 @@ >
- \ No newline at end of file + + {{!-- * Ammo Summary & Stars --}} + + + {{!-- * Aura Size --}} + {{#if aura}} +
+ +
+ {{aura.normal}} + + {{aura.heavy}} +
+
+ {{/if}} + diff --git a/templates/Apps/HeroSkillsCardV1/style.css b/templates/Apps/HeroSkillsCardV1/style.css index 8c654b0..a1bda69 100644 --- a/templates/Apps/HeroSkillsCardV1/style.css +++ b/templates/Apps/HeroSkillsCardV1/style.css @@ -6,7 +6,7 @@ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); - grid-template-rows: repeat(13, minmax(0, 1fr)); + grid-template-rows: repeat(14, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: var(--row-gap); @@ -68,20 +68,20 @@ .grip-skills-header { grid-column: 1 / span 1; - grid-row: 6 / span 1; + grid-row: 7 / span 1; } .grip-skills { grid-column: 1 / span 1; - grid-row: 7 / span 4; + grid-row: 8 / span 4; } .glim-skills-header { grid-column: 2 / span 1; - grid-row: 6 / span 1; + grid-row: 7 / span 1; } .glim-skills { grid-column: 2 / span 1; - grid-row: 7 / span 4; + grid-row: 8 / span 4; } .gear-list { @@ -100,14 +100,29 @@ } } + .ammo-list { + grid-column: 1 / span 2; + grid-row: 13 / span 2; + display: grid; + grid-template-columns: subgrid; + grid-template-rows: subgrid; + list-style-type: none; + padding: 0; + } + .currencies { grid-column: 1 / span 2; - grid-row: 13 / span 1; + grid-row: 12 / span 1; display: grid; column-gap: var(--col-gap); grid-template-columns: repeat(3, minmax(0, 1fr)); } + .aura-size { + grid-column: 3; + grid-row: 14; + } + .pill { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); @@ -136,4 +151,32 @@ text-align: center; } } + + .dual-pill { + border-radius: 999px; + background: var(--accent-1); + display: grid; + grid-template-columns: 2fr 1fr; + gap: 0.25rem; + align-items: center; + padding-left: 8px; + + .values { + border-radius: 999px; + margin: 2px; + background: var(--base-background); + color: var(--base-text); + padding: 0.125rem 0.5rem; + display: flex; + flex-direction: row; + justify-content: space-evenly; + gap: 0.5rem; + --slash-color: var(--accent-1); + } + + .value { + flex-grow: 1; + text-align: center; + } + } }