From 4f5e6a5ebcf20d3a4a23bee6fa56f72bb517192a Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 22:01:40 +0100 Subject: [PATCH] centering of num item values in char sheet Changes: - number values of items in the items overview of a char sheet are now horizontally centered - description content is now vertically correctly aligned --- src/scss/components/_items.scss | 9 ++++ src/templates/actor/partials/items.hbs | 69 ++++++++++++++------------ 2 files changed, 46 insertions(+), 32 deletions(-) diff --git a/src/scss/components/_items.scss b/src/scss/components/_items.scss index edbd0bbe..9c725e83 100644 --- a/src/scss/components/_items.scss +++ b/src/scss/components/_items.scss @@ -33,6 +33,10 @@ text-align: right; } + .item-num-val { + text-align: center; + } + .item-description { font-size: 75%; white-space: nowrap; @@ -42,6 +46,11 @@ text-overflow: ellipsis; overflow: hidden; } + p:first-child { + margin-top: 0px; + padding-top: 0px; + } + } } diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs index ffa4ef14..602c9a0e 100644 --- a/src/templates/actor/partials/items.hbs +++ b/src/templates/actor/partials/items.hbs @@ -4,25 +4,26 @@
{{!-- WEAPONS --}} -

{{localize "DS4.ItemTypeWeapon"}}

{{!-- SPECIFIC --}} +

{{localize "DS4.ItemTypeWeapon"}}

{{!-- SPECIFIC --}}
  1. {{!-- equipped --}} {{!-- SPECIFIC --}}
    -
    #
    {{!-- amount --}} +
    #
    {{!-- amount --}}
    -
    {{localize "DS4.ItemName"}}
    +
    {{localize "DS4.ItemName"}}
    {{localize "DS4.AttackTypeAbbr"}}
    {{!-- SPECIFIC --}}
    -
    {{localize "DS4.WeaponBonusAbbr"}}
    {{!-- SPECIFIC --}} -
    {{localize "DS4.OpponentDefenseAbbr"}}
    {{!-- SPECIFIC --}} +
    {{localize "DS4.WeaponBonusAbbr"}}
    {{!-- SPECIFIC --}} +
    {{localize "DS4.OpponentDefenseAbbr"}}
    {{!-- SPECIFIC --}}
    {{localize "DS4.Description"}}
    {{!-- add button --}}
  2. {{#each itemsByType.weapon as |item id|}} {{!-- SPECIFIC --}} @@ -38,15 +39,15 @@
{{!-- amount --}} -
{{itemData.quantity}}
+
{{itemData.quantity}}
{{!-- name --}} -

{{item.name}}

+

{{item.name}}

{{!-- item specifics --}}
{{lookup ../../config.attackTypes itemData.attackType}}
{{!-- SPECIFIC --}}
-
{{itemData.weaponBonus}}
{{!-- SPECIFIC --}} -
{{itemData.opponentDefense}}
{{!-- SPECIFIC --}} +
{{itemData.weaponBonus}}
{{!-- SPECIFIC --}} +
{{itemData.opponentDefense}}
{{!-- SPECIFIC --}}
{{!-- description --}}
{{{itemData.description}}}
@@ -61,23 +62,24 @@ {{!-- ARMOR --}} -

{{localize "DS4.ItemTypeArmor"}}

{{!-- SPECIFIC --}} +

{{localize "DS4.ItemTypeArmor"}}

{{!-- SPECIFIC --}}
  1. {{!-- equipped --}} {{!-- SPECIFIC --}}
    -
    #
    {{!-- amount --}} +
    #
    {{!-- amount --}}
    -
    {{localize "DS4.ItemName"}}
    +
    {{localize "DS4.ItemName"}}
    {{localize "DS4.ArmorMaterialTypeAbbr"}}
    {{!-- SPECIFIC --}}
    {{localize "DS4.ArmorTypeAbbr"}}
    {{!-- SPECIFIC --}} -
    {{localize "DS4.ArmorValueAbbr"}}
    {{!-- SPECIFIC --}} +
    {{localize "DS4.ArmorValueAbbr"}}
    {{!-- SPECIFIC --}}
    {{localize "DS4.Description"}}
    {{!-- add button --}}
  2. {{#each itemsByType.armor as |item id|}} {{!-- SPECIFIC --}} @@ -96,11 +98,11 @@
    {{itemData.quantity}}
    {{!-- name --}} -

    {{item.name}}

    +

    {{item.name}}

    {{!-- item specifics --}}
    {{lookup ../../config.armorMaterialTypes itemData.armorMaterialType}}
    {{!-- SPECIFIC --}}
    {{lookup ../../config.armorTypes itemData.armorType}}
    {{!-- SPECIFIC --}} -
    {{itemData.armorValue}}
    {{!-- SPECIFIC --}} +
    {{itemData.armorValue}}
    {{!-- SPECIFIC --}} {{!-- description --}}
    {{{itemData.description}}}
    {{!-- edit & delete buttons --}} @@ -115,21 +117,22 @@ {{!-- SHIELD --}} -

    {{localize "DS4.ItemTypeShield"}}

    {{!-- SPECIFIC --}} +

    {{localize "DS4.ItemTypeShield"}}

    {{!-- SPECIFIC --}}
    1. {{!-- equipped --}} {{!-- SPECIFIC --}}
      -
      #
      {{!-- amount --}} +
      #
      {{!-- amount --}}
      -
      {{localize "DS4.ItemName"}}
      -
      {{localize "DS4.ArmorValueAbbr"}}
      {{!-- SPECIFIC --}} +
      {{localize "DS4.ItemName"}}
      +
      {{localize "DS4.ArmorValueAbbr"}}
      {{!-- SPECIFIC --}}
      {{localize "DS4.Description"}}
      {{!-- add button --}}
    2. {{#each itemsByType.shield as |item id|}} {{!-- SPECIFIC --}} @@ -148,9 +151,9 @@
      {{itemData.quantity}}
      {{!-- name --}} -

      {{item.name}}

      +

      {{item.name}}

      {{!-- item specifics --}} -
      {{itemData.armorValue}}
      {{!-- SPECIFIC --}} +
      {{itemData.armorValue}}
      {{!-- SPECIFIC --}} {{!-- description --}}
      {{{itemData.description}}}
      {{!-- edit & delete buttons --}} @@ -164,20 +167,22 @@
    {{!-- TRINKET --}} -

    {{localize "DS4.ItemTypeTrinket"}}

    {{!-- SPECIFIC --}} +

    {{localize "DS4.ItemTypeTrinket"}}

    {{!-- SPECIFIC --}}
    1. {{!-- equipped --}} {{!-- SPECIFIC --}}
      -
      #
      {{!-- amount --}} +
      #
      {{!-- amount --}}
      -
      {{localize "DS4.ItemName"}}
      +
      {{localize "DS4.ItemName"}}
      +
      {{localize "DS4.StorageLocation"}}
      {{!-- SPECIFIC --}}
      {{localize "DS4.Description"}}
      {{!-- add button --}}
    2. {{#each itemsByType.trinket as |item id|}} {{!-- SPECIFIC --}}