Genericizing some of the styling and adding the Aspect item details (closes #128)

This commit is contained in:
Oliver-Akins 2024-03-24 16:54:50 -06:00
parent 649381cfdd
commit acbcb6c9b2
4 changed files with 117 additions and 26 deletions

View file

@ -0,0 +1,99 @@
<section class="aspect">
<div
class="aspect__header"
data-collapse-id="{{item.uuid}}"
>
<button
type="button"
class="equal-padding reduced-padding"
data-collapse-id="{{item.uuid}}"
tabindex="0"
aria-label="{{dd-i18n 'dotdungeon.sheet.actor.v2.toggle-item-information' item}}"
>
<div aria-hidden="true" class="icon icon--12">
{{#if (dd-set-has meta.expanded item.uuid)}}
{{{ icons.caret-down }}}
{{else}}
{{{ icons.caret-right }}}
{{/if}}
</div>
</button>
<h3 class="aspect__name">
{{item.name}}
</h3>
</div>
{{#if (dd-set-has meta.expanded item.uuid)}}
<hr>
<div class="aspect__content">
<div class="aspect__field editable">
<label for="{{meta.idp}}-{{item.uuid}}-used">
Used
</label>
<input
type="checkbox"
{{checked item.system.used}}
id="{{meta.idp}}-{{item.uuid}}-used"
value="{{item.system.used}}"
data-embedded-id="{{item.uuid}}"
data-embedded-update="system.used"
data-embedded-update-on="change"
>
</div>
<div class="aspect__field">
<span>Duration:</span>
<span>
{{dd-empty-state item.friendlyDuration}}
</span>
</div>
<div class="aspect__field">
<span>Tier:</span>
<span>{{dd-i18n (concat "dotdungeon.rarity." item.system.tier)}}</span>
</div>
<button
type="button"
aria-label="{{dd-i18n 'dotdungeon.common.send-to-chat'}}"
data-tooltip="{{dd-i18n 'dotdungeon.common.send-to-chat'}}"
data-tooltip-direction="RIGHT"
class="aspect__button--send-to-chat"
>
<div aria-hidden="true" class="icon icon--20">
{{{ icons.chat-bubble }}}
</div>
</button>
<p class="aspect__description">
{{#if item.system.description}}
{{item.system.description}}
{{else}}
<span class="placeholder">
This item hasn't been described yet...
</span>
{{/if}}
</p>
<button
type="button"
aria-label="{{dd-i18n 'dotdungeon.common.edit'}}"
data-tooltip="{{dd-i18n 'dotdungeon.common.edit'}}"
data-tooltip-direction="RIGHT"
class="aspect__button--edit"
data-embedded-edit="{{item.uuid}}"
>
<div aria-hidden="true" class="icon icon--20">
{{{ icons.edit }}}
</div>
</button>
<button
type="button"
aria-label="{{dd-i18n 'dotdungeon.common.delete'}}"
data-tooltip="{{dd-i18n 'dotdungeon.common.delete'}}"
data-tooltip-direction="RIGHT"
class="aspect__button--delete"
data-embedded-delete
data-embedded-id="{{item.uuid}}"
>
<div aria-hidden="true" class="icon icon--20">
{{{ icons.garbage-bin }}}
</div>
</button>
</div>
{{/if}}
</section>

View file

@ -28,7 +28,7 @@
{{#if (dd-set-has meta.expanded item.uuid)}}
<hr>
<div class="untyped__content">
<div class="untyped__quantity--edit">
<div class="untyped__field editable">
<label for="{{meta.idp}}-{{item.uuid}}-quantity">
Quantity
</label>
@ -42,13 +42,13 @@
data-embedded-update-on="blur"
>
</div>
<div class="untyped__usage">
<div class="untyped__field">
<span>Usage Cost:</span>
<span>
{{dd-empty-state item.system.usage}}
</span>
</div>
<div class="untyped__tier">
<div class="untyped__field">
<span>Tier:</span>
<span>{{dd-i18n (concat "dotdungeon.rarity." item.system.tier)}}</span>
</div>