collapse zones with no active quests

This commit is contained in:
smthbh 2025-04-28 13:17:18 -04:00
parent 91257a09f4
commit 3541eff537
3 changed files with 18 additions and 2 deletions

View file

@ -101,6 +101,12 @@ export class Armory {
helpers: { helpers: {
// eslint-disable-next-line @typescript-eslint/no-var-requires // eslint-disable-next-line @typescript-eslint/no-var-requires
...require("handlebars-helpers")(), ...require("handlebars-helpers")(),
eq: function(a: any, b: any) {
return a === b;
},
hasInProgressQuests: function(quests: any[]) {
return quests.some(quest => quest.status === 'In Progress');
}
}, },
}), }),
); );

View file

@ -4,18 +4,24 @@
const aowow_tooltips = { "renamelinks": true, }; const aowow_tooltips = { "renamelinks": true, };
</script> </script>
<script type="application/javascript" src="{{aowow}}/static/widgets/power.js"></script>
{{> character-header }} {{> character-header }}
{{#each data.categories as |quests category|}} {{#each data.categories as |quests category|}}
<div class="quests-table" style="margin-bottom: 20px;"> <div class="quests-table" style="margin-bottom: 20px;">
{{#if (hasInProgressQuests quests)}}
<h2 class="is-size-4 category-header collapsible expanded">
{{else}}
<h2 class="is-size-4 category-header collapsible"> <h2 class="is-size-4 category-header collapsible">
{{/if}}
{{category}} {{category}}
<span class="collapse-icon">▼</span> <span class="collapse-icon">▼</span>
</h2> </h2>
{{#if (hasInProgressQuests quests)}}
<div class="category-content expanded"> <div class="category-content expanded">
{{else}}
<div class="category-content">
{{/if}}
<!-- In Progress Quests --> <!-- In Progress Quests -->
<h3 class="is-size-5 collapsible"> <h3 class="is-size-5 collapsible">
In Progress In Progress

View file

@ -102,3 +102,7 @@
.category-header.expanded .collapse-icon { .category-header.expanded .collapse-icon {
transform: rotate(180deg); transform: rotate(180deg);
} }
.category-header:not(.expanded) .collapse-icon {
transform: rotate(-90deg);
}