Skip to content

Commit

Permalink
fix & change effects panel styling
Browse files Browse the repository at this point in the history
  • Loading branch information
reonZ committed Oct 25, 2024
1 parent a1d8e5f commit 80bc785
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 28 deletions.
5 changes: 4 additions & 1 deletion src/hud/tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,10 @@ class PF2eHudTracker extends PF2eHudBase<TrackerSettings, any, TrackerRenderOpti
if (!effectsPanel || !trackerElement) return;

const offsetHeight = this.#trackerHeight.offsetHeight;
effectsPanel.style.setProperty("max-height", `calc(100% - ${offsetHeight}px - 2em)`);
effectsPanel.style.setProperty(
"max-height",
`calc(100% - ${offsetHeight}px - (var(--panel-gap) * 3) - 4px)`
);
}

#scrollToCurrent(collapsed = this.getSetting("collapsed")) {
Expand Down
58 changes: 33 additions & 25 deletions styles/_tracker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $threat-extreme: red;
right: 0;
bottom: var(--interface-margin);
width: 17em;
max-height: 66%;
max-height: 51%;
padding: 0;
text-shadow: 1px 1px 4px var(--color-shadow-dark);
display: flex;
Expand Down Expand Up @@ -368,41 +368,49 @@ $threat-extreme: red;
}

#effects-panel {
display: flex;
flex-direction: column;
flex-wrap: wrap;
gap: 0px 4px;
direction: rtl;
--cell-width: 52px;

top: var(--panel-gap);
max-height: calc(100% - var(--combatant-height) * 2 - 4em);

.effect-item {
direction: ltr;
position: relative;
.effects-list {
hr {
width: calc(var(--cell-width) - 6px);
margin-inline: auto;
}

.effect-info {
background-color: #000;
z-index: 1;
position: absolute;
right: 100%;
width: max-content;
margin-right: 0;
.effect-item {
direction: ltr;
position: relative;

.effect-info {
background-color: #000;
z-index: 1;
position: absolute;
right: 100%;
width: max-content;
margin-right: 0;
}
}
}
}

&.hud-tracker-tall {
#effects-panel {
hr {
width: 44px;
margin-block: 5px;
}
--cell-width: 44px;

.effect-item {
height: 48px;
.effects-list {
hr {
margin-block: 0.3em;
}

.icon {
height: 44px;
width: 44px;
.effect-item {
height: var(--cell-width);

.icon {
height: calc(var(--cell-width) - 4px);
width: calc(var(--cell-width) - 4px);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion styles/pf2e-hud.css

Large diffs are not rendered by default.

Loading

0 comments on commit 80bc785

Please sign in to comment.