From d51aa18a1948bcdc4d624dbf1417be41a11aad12 Mon Sep 17 00:00:00 2001 From: macniel Date: Sun, 9 Nov 2025 10:53:11 +0100 Subject: [PATCH] finalise darkmode --- src/module/sheets/character/liturgies.mjs | 2 +- src/module/sheets/character/spells.mjs | 19 ++++--- src/module/sheets/groupSheet.mjs | 2 +- src/style/molecules/_equipment.scss | 8 ++- src/style/molecules/_liturgy-banner.scss | 29 ++--------- src/style/molecules/_tabs.scss | 4 +- src/style/organisms/_character-sheet.scss | 41 +++++++++++++++ src/style/organisms/_creature-sheet.scss | 17 +++++- src/style/organisms/_group-sheet.scss | 23 ++++++-- .../organisms/character-tabs/_advsf.scss | 2 +- .../organisms/character-tabs/_combat.scss | 2 +- .../organisms/character-tabs/_inventory.scss | 23 ++++++-- .../organisms/character-tabs/_liturgies.scss | 9 +++- src/style/organisms/character-tabs/_meta.scss | 2 +- .../organisms/character-tabs/_skills.scss | 2 +- .../organisms/character-tabs/_social.scss | 2 +- .../organisms/character-tabs/_spells.scss | 52 ++++++------------- .../actor/character/tab-equipment.hbs | 3 +- .../actor/character/tab-liturgies.hbs | 2 +- src/templates/actor/character/tab-spells.hbs | 2 + src/templates/actor/group/tab-inventory.hbs | 2 + 21 files changed, 160 insertions(+), 88 deletions(-) diff --git a/src/module/sheets/character/liturgies.mjs b/src/module/sheets/character/liturgies.mjs index c51cab64..4c3d38f0 100644 --- a/src/module/sheets/character/liturgies.mjs +++ b/src/module/sheets/character/liturgies.mjs @@ -62,7 +62,7 @@ export default { insertObject["count" + name] = insertObject["count" + name] + 1; - insertObject[name].push({ + insertObject[name]?.push({ id: item._id, name: item.name, lkpReq: lkp, diff --git a/src/module/sheets/character/spells.mjs b/src/module/sheets/character/spells.mjs index 920283c7..917679be 100644 --- a/src/module/sheets/character/spells.mjs +++ b/src/module/sheets/character/spells.mjs @@ -14,14 +14,21 @@ export default { return merkmale.split(",").map((merkmal) => merkmal.trim()) } + const prepareEigenschaftRoll = (actorData, name) => { + if (name && name !== "*") { + return actorData.system.attribute[name.toLowerCase()].aktuell + } else { + return 0 + } + } + + actorData.itemTypes["Spell"].forEach((item, index) => { - Object.values(actorData.items).forEach((item, index) => { - if (item.type === "Spell") { const eigenschaften = item.system.probe; const werte = [ - {name: eigenschaften[0], value: this.prepareEigenschaftRoll(actorData, eigenschaften[0])}, - {name: eigenschaften[1], value: this.prepareEigenschaftRoll(actorData, eigenschaften[1])}, - {name: eigenschaften[2], value: this.prepareEigenschaftRoll(actorData, eigenschaften[2])} + {name: eigenschaften[0], value: prepareEigenschaftRoll(actorData, eigenschaften[0])}, + {name: eigenschaften[1], value: prepareEigenschaftRoll(actorData, eigenschaften[1])}, + {name: eigenschaften[2], value: prepareEigenschaftRoll(actorData, eigenschaften[2])} ] context.spells.push({ id: item._id, @@ -36,7 +43,7 @@ export default { eigenschaft2: werte[1].name, eigenschaft3: werte[2].name, }) - } + }) context.hasSpells = context.spells.length > 0 diff --git a/src/module/sheets/groupSheet.mjs b/src/module/sheets/groupSheet.mjs index edf38211..e69858d3 100644 --- a/src/module/sheets/groupSheet.mjs +++ b/src/module/sheets/groupSheet.mjs @@ -251,7 +251,7 @@ export class GroupSheet extends HandlebarsApplicationMixin(ActorSheetV2) { // Drag-drop new foundry.applications.ux.DragDrop.implementation({ dragSelector: ".inventory-table .equipment", - dropSelector: ".inventory-table", + dropSelector: ".inventory", permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) diff --git a/src/style/molecules/_equipment.scss b/src/style/molecules/_equipment.scss index c15a607e..8b541f92 100644 --- a/src/style/molecules/_equipment.scss +++ b/src/style/molecules/_equipment.scss @@ -1,6 +1,6 @@ @use "../atoms/assets"; -@mixin equipment { +@mixin equipment($darkmode: false) { position: relative; height: 32px; display: grid; @@ -9,7 +9,11 @@ padding: 2px 0 0 2px; margin: 4px 0 0 4px; gap: 8px; - background: assets.$tab-pane-background; + @if darkmode { + background: rgba(0, 0, 0, 0.3); + } @else { + background: assets.$tab-pane-background; + } .icon { width: 32px; diff --git a/src/style/molecules/_liturgy-banner.scss b/src/style/molecules/_liturgy-banner.scss index c79f60cb..75b73fe7 100644 --- a/src/style/molecules/_liturgy-banner.scss +++ b/src/style/molecules/_liturgy-banner.scss @@ -91,6 +91,9 @@ $deity_colours_tint: ( @include coloring('Rahja'); tr { + + background-color: unset; + th.background { &::before { @@ -211,33 +214,9 @@ $deity_colours_tint: ( z-index: 1; position: relative; - .border { - fill: #0000; - } - .center { + path { fill: $color; - stroke: colour.$rollable-die-border-color; - } - - .topleft { - fill: color.adjust($color, $lightness: numbers.$lighter_factor); - stroke: colour.$rollable-die-border-color; - } - - .bottomleft { - fill: color.adjust($color, $lightness: numbers.$lightest_factor); - stroke: colour.$rollable-die-border-color; - } - - .topright { - fill: color.adjust($color, $lightness: numbers.$darken_factor); - stroke: colour.$rollable-die-border-color; - } - - .bottomright, .bottom { - fill: color.adjust($color, $lightness: numbers.$darkest_factor); - stroke: colour.$rollable-die-border-color; } } } diff --git a/src/style/molecules/_tabs.scss b/src/style/molecules/_tabs.scss index ded2f906..cfcaf2bf 100644 --- a/src/style/molecules/_tabs.scss +++ b/src/style/molecules/_tabs.scss @@ -87,7 +87,9 @@ background: rgba(0, 0, 0, 0.3); &::after { - background: rgba(0, 0, 0, 0.3); + background: rgba(0, 0, 0, 0.75); + bottom: 0; + height: 1px; } } diff --git a/src/style/organisms/_character-sheet.scss b/src/style/organisms/_character-sheet.scss index 79f739e2..5b452e73 100644 --- a/src/style/organisms/_character-sheet.scss +++ b/src/style/organisms/_character-sheet.scss @@ -105,3 +105,44 @@ } } + +.theme-dark { + + .application.sheet.dsa41.actor.character { + + .tab.meta.active { + @include meta.tab(true); + } + + .tab.social.active { + @include social.tab(true); + } + + .tab.advsf.active { + @include advsf.tab(true); + } + + .tab.equipment.active { + @include inventory.tab(true); + } + + .tab.combat.active { + @include combat.tab(true); + } + + .tab.skills.active { + @include skills.tab(true); + } + + .tab.spells { + @include spells.tab(true); + } + + .tab.liturgies { + @include liturgies.tab(true); + } + + + } + +} \ No newline at end of file diff --git a/src/style/organisms/_creature-sheet.scss b/src/style/organisms/_creature-sheet.scss index 407cc09e..a2d8fded 100644 --- a/src/style/organisms/_creature-sheet.scss +++ b/src/style/organisms/_creature-sheet.scss @@ -168,7 +168,7 @@ div { .equipment { - @include equipment.equipment + @include equipment.equipment(false) } } @@ -177,3 +177,18 @@ } } +.theme-dark { + + .dsa41.sheet.actor.creature { + + .tab.loot { + + div .equipment { + @include equipment.equipment(true) + } + + } + + } + +} \ No newline at end of file diff --git a/src/style/organisms/_group-sheet.scss b/src/style/organisms/_group-sheet.scss index e246ff98..00635e88 100644 --- a/src/style/organisms/_group-sheet.scss +++ b/src/style/organisms/_group-sheet.scss @@ -150,9 +150,26 @@ } - .equipment:hover { - .item-name { - text-shadow: 0 0 10px rgb(255 0 0); + .equipment { + + display: grid; + height: 32px; + grid-template-columns: 32px 24px 1fr 80px; + grid-template-rows: 1fr; + + input { + appearance: base; + } + + span { + line-height: 32px; + vertical-align: middle; + } + + &:hover { + .item-name { + text-shadow: 0 0 10px rgb(255 0 0); + } } } diff --git a/src/style/organisms/character-tabs/_advsf.scss b/src/style/organisms/character-tabs/_advsf.scss index ecf0b2e8..7d7834c9 100644 --- a/src/style/organisms/character-tabs/_advsf.scss +++ b/src/style/organisms/character-tabs/_advsf.scss @@ -1,4 +1,4 @@ -@mixin tab { +@mixin tab($darkmode: false) { .advantages-and-specialabilities { display: flex; diff --git a/src/style/organisms/character-tabs/_combat.scss b/src/style/organisms/character-tabs/_combat.scss index 58cf677a..1e3163b7 100644 --- a/src/style/organisms/character-tabs/_combat.scss +++ b/src/style/organisms/character-tabs/_combat.scss @@ -1,4 +1,4 @@ -@mixin tab { +@mixin tab($darkmode: false) { display: grid; diff --git a/src/style/organisms/character-tabs/_inventory.scss b/src/style/organisms/character-tabs/_inventory.scss index b61dffac..3ad244aa 100644 --- a/src/style/organisms/character-tabs/_inventory.scss +++ b/src/style/organisms/character-tabs/_inventory.scss @@ -1,7 +1,7 @@ @use "../../atoms/assets"; @use "../../molecules/equipment"; -@mixin tab { +@mixin tab($darkmode: false) { & > div { display: grid; @@ -35,7 +35,22 @@ left: 0; top: 0; bottom: 0; - background: linear-gradient(to bottom, #0bad29 0%, #11f128 50%, #0cde24 51%, #6ff77b 100%); + background: url('/systems/DSA_4-1/assets/gradient.png'); + background-size: 8px 100%; + + &:after { + position: absolute; + left: 0; + top: 0; + bottom: 0; + right: 0; + background-color: rgba(0, 128, 0, 0.5); + content: ''; + } + + &.danger::after { + background-color: rgba(224, 60, 20, 0.5); + } } } @@ -62,9 +77,9 @@ .equipment { - @include equipment.equipment + @include equipment.equipment($darkmode) } } } -} \ No newline at end of file +} diff --git a/src/style/organisms/character-tabs/_liturgies.scss b/src/style/organisms/character-tabs/_liturgies.scss index 197464df..f76bad42 100644 --- a/src/style/organisms/character-tabs/_liturgies.scss +++ b/src/style/organisms/character-tabs/_liturgies.scss @@ -1,4 +1,4 @@ -@mixin tab { +@mixin tab($darkmode: false) { > div { @@ -9,6 +9,12 @@ border-top: unset; border-bottom: unset; position: relative; + background: unset; + + tr { + background-color: unset; + } + } .liturgy-header { @@ -20,7 +26,6 @@ th { vertical-align: middle; - color: black; text-shadow: 2px 2px 1px rgba(0, 0, 0, 0.2); } } diff --git a/src/style/organisms/character-tabs/_meta.scss b/src/style/organisms/character-tabs/_meta.scss index 62876997..4499739d 100644 --- a/src/style/organisms/character-tabs/_meta.scss +++ b/src/style/organisms/character-tabs/_meta.scss @@ -1,4 +1,4 @@ -@mixin tab { +@mixin tab($darkmode: false) { display: flex; flex-direction: column; diff --git a/src/style/organisms/character-tabs/_skills.scss b/src/style/organisms/character-tabs/_skills.scss index ae8552b8..3a2a7e4f 100644 --- a/src/style/organisms/character-tabs/_skills.scss +++ b/src/style/organisms/character-tabs/_skills.scss @@ -1,4 +1,4 @@ -@mixin tab { +@mixin tab($darkmode: false) { container: thisTab / inline-size; diff --git a/src/style/organisms/character-tabs/_social.scss b/src/style/organisms/character-tabs/_social.scss index bbfc49e7..fcc8ba39 100644 --- a/src/style/organisms/character-tabs/_social.scss +++ b/src/style/organisms/character-tabs/_social.scss @@ -1,4 +1,4 @@ -@mixin tab { +@mixin tab($darkmode: false) { display: flex; flex-direction: column; diff --git a/src/style/organisms/character-tabs/_spells.scss b/src/style/organisms/character-tabs/_spells.scss index 433d556d..8a47be00 100644 --- a/src/style/organisms/character-tabs/_spells.scss +++ b/src/style/organisms/character-tabs/_spells.scss @@ -2,11 +2,12 @@ @use "../../atoms/numbers"; @use "../../atoms/colours" as colour; -@mixin tab { +@mixin tab($darkmode: false) { tr { height: 24px; margin: 0; padding: 0; + background-color: unset; } td { @@ -15,45 +16,26 @@ height: 24px; } - $color: #05f; - - .spell.rollable svg { - width: 24px; - height: 24px; - top: 1px; - z-index: 1; + .spell.rollable { position: relative; - .border { - fill: #0000; - } + svg { - .center { - fill: $color; - stroke: colour.$rollable-die-border-color; - } + position: absolute; + width: 32px; + height: 32px; + z-index: 2; + top: 0; + left: -4px; + display: none; - .topleft { - fill: color.adjust($color, $lightness: numbers.$lighter_factor); - stroke: colour.$rollable-die-border-color; - } - - .bottomleft { - fill: color.adjust($color, $lightness: numbers.$lightest_factor); - stroke: colour.$rollable-die-border-color; - } - - .topright { - fill: color.adjust($color, $lightness: numbers.$darken_factor); - stroke: colour.$rollable-die-border-color; - } - - .bottomright, .bottom { - fill: color.adjust($color, $lightness: numbers.$darkest_factor); - stroke: colour.$rollable-die-border-color; + path { + fill: colour.$zauber-color; + } } } + .die-column { width: 24px; } @@ -73,7 +55,7 @@ &::after { content: ''; - background-image: linear-gradient(to right, rgba(color.scale($color, $lightness: numbers.$zebra_light), numbers.$start_gradient), rgba(color.scale($color, $lightness: numbers.$zebra_light), numbers.$end_2_gradient)); + background-image: linear-gradient(to right, rgba(color.scale(colour.$zauber-color, $lightness: numbers.$zebra_light), numbers.$start_gradient), rgba(color.scale(colour.$zauber-color, $lightness: numbers.$zebra_light), numbers.$end_2_gradient)); border-top-right-radius: 8px; border-bottom-right-radius: 8px; position: absolute; @@ -87,7 +69,7 @@ &:nth-child(odd) { &::after { - background-image: linear-gradient(to right, rgba(color.scale($color, $lightness: numbers.$zebra_dark), numbers.$start_gradient), rgba(color.scale($color, $lightness: numbers.$zebra_dark), numbers.$end_2_gradient)); + background-image: linear-gradient(to right, rgba(color.scale(colour.$zauber-color, $lightness: numbers.$zebra_dark), numbers.$start_gradient), rgba(color.scale(colour.$zauber-color, $lightness: numbers.$zebra_dark), numbers.$end_2_gradient)); } } } diff --git a/src/templates/actor/character/tab-equipment.hbs b/src/templates/actor/character/tab-equipment.hbs index 507e13cc..2f59d916 100644 --- a/src/templates/actor/character/tab-equipment.hbs +++ b/src/templates/actor/character/tab-equipment.hbs @@ -5,7 +5,8 @@
- +
diff --git a/src/templates/actor/character/tab-liturgies.hbs b/src/templates/actor/character/tab-liturgies.hbs index e1e41c60..18b75b04 100644 --- a/src/templates/actor/character/tab-liturgies.hbs +++ b/src/templates/actor/character/tab-liturgies.hbs @@ -19,7 +19,7 @@ - Liturgiekenntnis: {{this.lkp}} + Liturgiekenntnis: {{this.lkp}} diff --git a/src/templates/actor/character/tab-spells.hbs b/src/templates/actor/character/tab-spells.hbs index b8ea3278..46ec9463 100644 --- a/src/templates/actor/character/tab-spells.hbs +++ b/src/templates/actor/character/tab-spells.hbs @@ -2,6 +2,7 @@ data-tab="{{tabs.spells.id}}" data-group="{{tabs.spells.group}}"> +
@@ -46,4 +47,5 @@ {{/each}} +
\ No newline at end of file diff --git a/src/templates/actor/group/tab-inventory.hbs b/src/templates/actor/group/tab-inventory.hbs index e3a6eae2..cc647291 100644 --- a/src/templates/actor/group/tab-inventory.hbs +++ b/src/templates/actor/group/tab-inventory.hbs @@ -2,6 +2,8 @@ data-tab="{{tabs.inventory.id}}" data-group="{{tabs.inventory.group}}"> +
{{> "systems/DSA_4-1/templates/ui/partial-equipment-button.hbs" inventoryItems}} +