Make Fear Panel resizable

This commit is contained in:
Dapoulp 2025-05-31 23:34:11 +02:00
parent e454d8bb06
commit 3d949d6375
3 changed files with 22 additions and 10 deletions

View file

@ -17,18 +17,24 @@ export default class Resources extends HandlebarsApplicationMixin(ApplicationV2)
/** @inheritDoc */ /** @inheritDoc */
static DEFAULT_OPTIONS = { static DEFAULT_OPTIONS = {
id: "resources", id: "resources",
classes: ["flexcol"], classes: [],
tag: "div", tag: "div",
window: { window: {
frame: true, frame: true,
title: "Fear", title: "Fear",
positioned: true positioned: true,
resizable: true
}, },
actions: { actions: {
setFear: Resources.setFear, setFear: Resources.setFear,
increaseFear: Resources.increaseFear increaseFear: Resources.increaseFear
}, },
position: {} position: {
width: 222,
height: 222,
// top: "200px",
// left: "120px"
}
}; };
/** @override */ /** @override */
@ -65,7 +71,7 @@ export default class Resources extends HandlebarsApplicationMixin(ApplicationV2)
/** @override */ /** @override */
async _preFirstRender(context, options) { async _preFirstRender(context, options) {
options.position = game.user.getFlag(SYSTEM.id, 'app.resources.position') ?? {}; options.position = game.user.getFlag(SYSTEM.id, 'app.resources.position') ?? Resources.DEFAULT_OPTIONS.position;
} }
/** @override */ /** @override */

View file

@ -2719,6 +2719,10 @@ div.daggerheart.views.multiclass {
--secondary-color-fear: rgba(9, 71, 179, 0.75); --secondary-color-fear: rgba(9, 71, 179, 0.75);
--shadow-text-stroke: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; --shadow-text-stroke: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
} }
#resources {
min-height: calc(var(--header-height) + 4rem);
min-width: 4rem;
}
#resources .window-content { #resources .window-content {
padding: 0.5rem; padding: 0.5rem;
} }
@ -2730,14 +2734,13 @@ div.daggerheart.views.multiclass {
} }
#resources .window-content #resource-fear i { #resources .window-content #resource-fear i {
font-size: var(--font-size-18); font-size: var(--font-size-18);
flex: 1 1 calc(25% - 0.25rem);
border: 1px solid rgba(0, 0, 0, 0.5); border: 1px solid rgba(0, 0, 0, 0.5);
border-radius: 50%; border-radius: 50%;
aspect-ratio: 1; aspect-ratio: 1;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 0.5rem; width: 3rem;
background-color: var(--primary-color-fear); background-color: var(--primary-color-fear);
-webkit-box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.75); -webkit-box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.75);
box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.75); box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.75);
@ -2812,7 +2815,8 @@ div.daggerheart.views.multiclass {
border-color: transparent; border-color: transparent;
} }
#resources:not(:hover):not(.minimized) header, #resources:not(:hover):not(.minimized) header,
#resources:not(:hover):not(.minimized) .controls { #resources:not(:hover):not(.minimized) .controls,
#resources:not(:hover):not(.minimized) .window-resize-handle {
visibility: hidden; visibility: hidden;
} }
.application.sheet.daggerheart.dh-style.feature .item-sheet-header { .application.sheet.daggerheart.dh-style.feature .item-sheet-header {

View file

@ -5,6 +5,8 @@
} }
#resources { #resources {
min-height: calc(var(--header-height) + 4rem);
min-width: 4rem;
.window-content { .window-content {
padding: .5rem; padding: .5rem;
#resource-fear { #resource-fear {
@ -14,14 +16,14 @@
flex-wrap: wrap; flex-wrap: wrap;
i { i {
font-size: var(--font-size-18); font-size: var(--font-size-18);
flex: 1 1 calc(25% - 0.25rem); // flex: 1 1 calc(25% - 0.25rem);
border: 1px solid rgba(0,0,0,.5); border: 1px solid rgba(0,0,0,.5);
border-radius: 50%; border-radius: 50%;
aspect-ratio: 1; aspect-ratio: 1;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: .5rem; width: 3rem;
background-color: var(--primary-color-fear); background-color: var(--primary-color-fear);
-webkit-box-shadow: 0px 0px 5px 1px rgba(0,0,0,.75); -webkit-box-shadow: 0px 0px 5px 1px rgba(0,0,0,.75);
box-shadow: 0px 0px 5px 1px rgba(0,0,0,.75); box-shadow: 0px 0px 5px 1px rgba(0,0,0,.75);
@ -100,7 +102,7 @@
background: transparent; background: transparent;
box-shadow: unset; box-shadow: unset;
border-color: transparent; border-color: transparent;
header, .controls { header, .controls, .window-resize-handle {
visibility: hidden; visibility: hidden;
} }
} }