From acbcb6c9b297d50e721f4f626af374a2746c4fae Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sun, 24 Mar 2024 16:54:50 -0600 Subject: [PATCH] Genericizing some of the styling and adding the Aspect item details (closes #128) --- module/handlebars.mjs | 1 + .../actor/char-sheet/v2/pages/inventory.scss | 37 +++---- .../partials/inventory/items/aspect.v2.pc.hbs | 99 +++++++++++++++++++ .../inventory/items/untyped.v2.pc.hbs | 6 +- 4 files changed, 117 insertions(+), 26 deletions(-) create mode 100644 templates/actors/char-sheet/v2/partials/inventory/items/aspect.v2.pc.hbs diff --git a/module/handlebars.mjs b/module/handlebars.mjs index d2ccd2a..ad671fe 100644 --- a/module/handlebars.mjs +++ b/module/handlebars.mjs @@ -28,6 +28,7 @@ export const partials = [ `actors/char-sheet/v2/partials/inventory/storage.v2.pc.hbs`, `actors/char-sheet/v2/partials/inventory/items/material.v2.pc.hbs`, `actors/char-sheet/v2/partials/inventory/items/untyped.v2.pc.hbs`, + `actors/char-sheet/v2/partials/inventory/items/aspect.v2.pc.hbs`, ]; export const preAliasedPartials = { diff --git a/styles/sheets/actor/char-sheet/v2/pages/inventory.scss b/styles/sheets/actor/char-sheet/v2/pages/inventory.scss index ae65e1b..7e4ac16 100644 --- a/styles/sheets/actor/char-sheet/v2/pages/inventory.scss +++ b/styles/sheets/actor/char-sheet/v2/pages/inventory.scss @@ -53,7 +53,7 @@ gap: 8px; } - &--untyped { + &--untyped, &--aspect { display: flex; gap: 8px; flex-direction: column; @@ -186,7 +186,7 @@ } } - .untyped { + .untyped, .aspect { @include material.elevate(1); padding: 8px; border-radius: 4px; @@ -252,7 +252,7 @@ } } - &__usage, &__tier { + &__field { @include material.elevate(1); color: var(--inventory-untyped-card-color); padding: 8px; @@ -260,17 +260,6 @@ align-items: center; justify-content: space-between; border-radius: 4px; - } - - &__quantity--edit { - @include material.elevate(1); - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - padding: 0px 8px; - gap: 4px; - border-radius: 4px; > :first-child { text-overflow: ellipsis; @@ -278,15 +267,17 @@ white-space: nowrap; } - input { - @include material.elevate(2); - font-family: var(--input-font); - font-size: var(--inventory-untyped-quantity-font-size); - width: 50px; - text-align: center; - border-radius: 4px; - padding: 5px 7px; - color: inherit; + &.editable { + input[type="text"], input[type="number"] { + @include material.elevate(1); + font-family: var(--input-font); + font-size: var(--inventory-untyped-quantity-font-size); + width: 50px; + text-align: center; + border-radius: 4px; + padding: 5px 7px; + color: inherit; + } } } diff --git a/templates/actors/char-sheet/v2/partials/inventory/items/aspect.v2.pc.hbs b/templates/actors/char-sheet/v2/partials/inventory/items/aspect.v2.pc.hbs new file mode 100644 index 0000000..210e31b --- /dev/null +++ b/templates/actors/char-sheet/v2/partials/inventory/items/aspect.v2.pc.hbs @@ -0,0 +1,99 @@ +
+
+ +

+ {{item.name}} +

+
+ {{#if (dd-set-has meta.expanded item.uuid)}} +
+
+
+ + +
+
+ Duration: + + {{dd-empty-state item.friendlyDuration}} + +
+
+ Tier: + {{dd-i18n (concat "dotdungeon.rarity." item.system.tier)}} +
+ +

+ {{#if item.system.description}} + {{item.system.description}} + {{else}} + + This item hasn't been described yet... + + {{/if}} +

+ + +
+ {{/if}} +
diff --git a/templates/actors/char-sheet/v2/partials/inventory/items/untyped.v2.pc.hbs b/templates/actors/char-sheet/v2/partials/inventory/items/untyped.v2.pc.hbs index 25712e5..4a62455 100644 --- a/templates/actors/char-sheet/v2/partials/inventory/items/untyped.v2.pc.hbs +++ b/templates/actors/char-sheet/v2/partials/inventory/items/untyped.v2.pc.hbs @@ -28,7 +28,7 @@ {{#if (dd-set-has meta.expanded item.uuid)}}
-
+
@@ -42,13 +42,13 @@ data-embedded-update-on="blur" >
-
+
Usage Cost: {{dd-empty-state item.system.usage}}
-
+
Tier: {{dd-i18n (concat "dotdungeon.rarity." item.system.tier)}}