mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 10:29:54 +02:00
Fixed so that hidden countdowns don't take up space
This commit is contained in:
parent
8e5cdedaac
commit
f91bfaecb1
3 changed files with 14 additions and 2 deletions
|
|
@ -186,6 +186,7 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
|
||||||
|
|
||||||
context.userCountdownTypes = game.user.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.userFlags.countdownTypeModes)
|
context.userCountdownTypes = game.user.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.userFlags.countdownTypeModes)
|
||||||
?? [shortterm.id, longterm.id];
|
?? [shortterm.id, longterm.id];
|
||||||
|
|
||||||
context.typeToggles =
|
context.typeToggles =
|
||||||
Object.values(CONFIG.DH.GENERAL.countdownType).map(type => ({
|
Object.values(CONFIG.DH.GENERAL.countdownType).map(type => ({
|
||||||
type: type.id,
|
type: type.id,
|
||||||
|
|
@ -194,6 +195,13 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
|
||||||
}));
|
}));
|
||||||
|
|
||||||
context.countdowns = this._getCountdownData();
|
context.countdowns = this._getCountdownData();
|
||||||
|
context.countdownTypesWithVisibleEntries = this.#getCountdowns().reduce((acc, data) => {
|
||||||
|
if (context.userCountdownTypes.includes(data.countdown.type) && !acc.includes(data.countdown.type))
|
||||||
|
acc.push(data.countdown.type);
|
||||||
|
|
||||||
|
return acc;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,10 @@
|
||||||
max-height: 312px;
|
max-height: 312px;
|
||||||
|
|
||||||
.countdown-category-container {
|
.countdown-category-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
|
||||||
&.hidden {
|
&.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
@ -117,7 +121,7 @@
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
|
||||||
&.change-glow {
|
&.change-glow {
|
||||||
animation: shimmer 1s ease-in-out;
|
animation: shimmer 1s ease-in-out infinite;
|
||||||
background: linear-gradient(-45deg, transparent 30%, light-dark(@dark-blue-40, @golden-40) 35%, transparent 40%);
|
background: linear-gradient(-45deg, transparent 30%, light-dark(@dark-blue-40, @golden-40) 35%, transparent 40%);
|
||||||
background-size: 300%;
|
background-size: 300%;
|
||||||
background-position-x: 100%
|
background-position-x: 100%
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{{#each countdowns as | category key |}}
|
{{#each countdowns as | category key |}}
|
||||||
<div class="countdown-category-container {{#unless (includes @root.userCountdownTypes key)}}hidden{{/unless}}">
|
<div class="countdown-category-container {{#unless (includes @root.countdownTypesWithVisibleEntries key)}}hidden{{/unless}}">
|
||||||
{{#each category as |countdown id|}}
|
{{#each category as |countdown id|}}
|
||||||
<div class="countdown-container {{#if ../iconOnly}}icon-only{{/if}}" data-countdown="{{id}}">
|
<div class="countdown-container {{#if ../iconOnly}}icon-only{{/if}}" data-countdown="{{id}}">
|
||||||
<div class="countdown-main-container">
|
<div class="countdown-main-container">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue