finalise darkmode

pull/65/head 0.5.1-rc1
macniel 2025-11-09 10:53:11 +01:00
parent 0f9032c3f5
commit d51aa18a19
21 changed files with 160 additions and 88 deletions

View File

@ -62,7 +62,7 @@ export default {
insertObject["count" + name] = insertObject["count" + name] + 1; insertObject["count" + name] = insertObject["count" + name] + 1;
insertObject[name].push({ insertObject[name]?.push({
id: item._id, id: item._id,
name: item.name, name: item.name,
lkpReq: lkp, lkpReq: lkp,

View File

@ -14,14 +14,21 @@ export default {
return merkmale.split(",").map((merkmal) => merkmal.trim()) 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 eigenschaften = item.system.probe;
const werte = [ const werte = [
{name: eigenschaften[0], value: this.prepareEigenschaftRoll(actorData, eigenschaften[0])}, {name: eigenschaften[0], value: prepareEigenschaftRoll(actorData, eigenschaften[0])},
{name: eigenschaften[1], value: this.prepareEigenschaftRoll(actorData, eigenschaften[1])}, {name: eigenschaften[1], value: prepareEigenschaftRoll(actorData, eigenschaften[1])},
{name: eigenschaften[2], value: this.prepareEigenschaftRoll(actorData, eigenschaften[2])} {name: eigenschaften[2], value: prepareEigenschaftRoll(actorData, eigenschaften[2])}
] ]
context.spells.push({ context.spells.push({
id: item._id, id: item._id,
@ -36,7 +43,7 @@ export default {
eigenschaft2: werte[1].name, eigenschaft2: werte[1].name,
eigenschaft3: werte[2].name, eigenschaft3: werte[2].name,
}) })
}
}) })
context.hasSpells = context.spells.length > 0 context.hasSpells = context.spells.length > 0

View File

@ -251,7 +251,7 @@ export class GroupSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
// Drag-drop // Drag-drop
new foundry.applications.ux.DragDrop.implementation({ new foundry.applications.ux.DragDrop.implementation({
dragSelector: ".inventory-table .equipment", dragSelector: ".inventory-table .equipment",
dropSelector: ".inventory-table", dropSelector: ".inventory",
permissions: { permissions: {
dragstart: this._canDragStart.bind(this), dragstart: this._canDragStart.bind(this),
drop: this._canDragDrop.bind(this) drop: this._canDragDrop.bind(this)

View File

@ -1,6 +1,6 @@
@use "../atoms/assets"; @use "../atoms/assets";
@mixin equipment { @mixin equipment($darkmode: false) {
position: relative; position: relative;
height: 32px; height: 32px;
display: grid; display: grid;
@ -9,7 +9,11 @@
padding: 2px 0 0 2px; padding: 2px 0 0 2px;
margin: 4px 0 0 4px; margin: 4px 0 0 4px;
gap: 8px; gap: 8px;
@if darkmode {
background: rgba(0, 0, 0, 0.3);
} @else {
background: assets.$tab-pane-background; background: assets.$tab-pane-background;
}
.icon { .icon {
width: 32px; width: 32px;

View File

@ -91,6 +91,9 @@ $deity_colours_tint: (
@include coloring('Rahja'); @include coloring('Rahja');
tr { tr {
background-color: unset;
th.background { th.background {
&::before { &::before {
@ -211,33 +214,9 @@ $deity_colours_tint: (
z-index: 1; z-index: 1;
position: relative; position: relative;
.border {
fill: #0000;
}
.center { path {
fill: $color; 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;
} }
} }
} }

View File

@ -87,7 +87,9 @@
background: rgba(0, 0, 0, 0.3); background: rgba(0, 0, 0, 0.3);
&::after { &::after {
background: rgba(0, 0, 0, 0.3); background: rgba(0, 0, 0, 0.75);
bottom: 0;
height: 1px;
} }
} }

View File

@ -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);
}
}
}

View File

@ -168,7 +168,7 @@
div { div {
.equipment { .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)
}
}
}
}

View File

@ -150,10 +150,27 @@
} }
.equipment:hover { .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 { .item-name {
text-shadow: 0 0 10px rgb(255 0 0); text-shadow: 0 0 10px rgb(255 0 0);
} }
} }
}
} }

View File

@ -1,4 +1,4 @@
@mixin tab { @mixin tab($darkmode: false) {
.advantages-and-specialabilities { .advantages-and-specialabilities {
display: flex; display: flex;

View File

@ -1,4 +1,4 @@
@mixin tab { @mixin tab($darkmode: false) {
display: grid; display: grid;

View File

@ -1,7 +1,7 @@
@use "../../atoms/assets"; @use "../../atoms/assets";
@use "../../molecules/equipment"; @use "../../molecules/equipment";
@mixin tab { @mixin tab($darkmode: false) {
& > div { & > div {
display: grid; display: grid;
@ -35,7 +35,22 @@
left: 0; left: 0;
top: 0; top: 0;
bottom: 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,7 +77,7 @@
.equipment { .equipment {
@include equipment.equipment @include equipment.equipment($darkmode)
} }
} }

View File

@ -1,4 +1,4 @@
@mixin tab { @mixin tab($darkmode: false) {
> div { > div {
@ -9,6 +9,12 @@
border-top: unset; border-top: unset;
border-bottom: unset; border-bottom: unset;
position: relative; position: relative;
background: unset;
tr {
background-color: unset;
}
} }
.liturgy-header { .liturgy-header {
@ -20,7 +26,6 @@
th { th {
vertical-align: middle; vertical-align: middle;
color: black;
text-shadow: 2px 2px 1px rgba(0, 0, 0, 0.2); text-shadow: 2px 2px 1px rgba(0, 0, 0, 0.2);
} }
} }

View File

@ -1,4 +1,4 @@
@mixin tab { @mixin tab($darkmode: false) {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -1,4 +1,4 @@
@mixin tab { @mixin tab($darkmode: false) {
container: thisTab / inline-size; container: thisTab / inline-size;

View File

@ -1,4 +1,4 @@
@mixin tab { @mixin tab($darkmode: false) {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -2,11 +2,12 @@
@use "../../atoms/numbers"; @use "../../atoms/numbers";
@use "../../atoms/colours" as colour; @use "../../atoms/colours" as colour;
@mixin tab { @mixin tab($darkmode: false) {
tr { tr {
height: 24px; height: 24px;
margin: 0; margin: 0;
padding: 0; padding: 0;
background-color: unset;
} }
td { td {
@ -15,44 +16,25 @@
height: 24px; height: 24px;
} }
$color: #05f; .spell.rollable {
.spell.rollable svg {
width: 24px;
height: 24px;
top: 1px;
z-index: 1;
position: relative; position: relative;
.border { svg {
fill: #0000;
position: absolute;
width: 32px;
height: 32px;
z-index: 2;
top: 0;
left: -4px;
display: none;
path {
fill: colour.$zauber-color;
}
}
} }
.center {
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;
}
}
.die-column { .die-column {
width: 24px; width: 24px;
@ -73,7 +55,7 @@
&::after { &::after {
content: ''; 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-top-right-radius: 8px;
border-bottom-right-radius: 8px; border-bottom-right-radius: 8px;
position: absolute; position: absolute;
@ -87,7 +69,7 @@
&:nth-child(odd) { &:nth-child(odd) {
&::after { &::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));
} }
} }
} }

View File

@ -5,7 +5,8 @@
<div class="capacity"> <div class="capacity">
<label>Tragkraft: {{this.carryingweight}} von maximal {{this.maxcarryingcapacity}} Stein</label> <label>Tragkraft: {{this.carryingweight}} von maximal {{this.maxcarryingcapacity}} Stein</label>
<div class="resource"> <div class="resource">
<span class="fill" style="width: {{this.carryingpercentage}}%"></span> <span class="fill {{#if (gte this.carryingpercentage 75)}}danger{{/if}}"
style="width: {{this.carryingpercentage}}%"></span>
</div> </div>
</div> </div>

View File

@ -19,7 +19,7 @@
<th style="width: 0"></th> <th style="width: 0"></th>
<th class="banner-top" style="width: 90px"><img <th class="banner-top" style="width: 90px"><img
src="systems/DSA_4-1/assets/deities/{{this.deity}}.png"/></th> src="systems/DSA_4-1/assets/deities/{{this.deity}}.png"/></th>
<th colspan="2">Liturgiekenntnis: {{this.lkp}}</th> <th class="lkp" colspan="2">Liturgiekenntnis: {{this.lkp}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -2,6 +2,7 @@
data-tab="{{tabs.spells.id}}" data-tab="{{tabs.spells.id}}"
data-group="{{tabs.spells.group}}"> data-group="{{tabs.spells.group}}">
<div>
<div class="tab-resources"> <div class="tab-resources">
<div class="astralpoints"> <div class="astralpoints">
@ -46,4 +47,5 @@
{{/each}} {{/each}}
</tbody> </tbody>
</table> </table>
</div>
</section> </section>

View File

@ -2,6 +2,8 @@
data-tab="{{tabs.inventory.id}}" data-tab="{{tabs.inventory.id}}"
data-group="{{tabs.inventory.group}}"> data-group="{{tabs.inventory.group}}">
<div class="inventory">
{{> "systems/DSA_4-1/templates/ui/partial-equipment-button.hbs" inventoryItems}} {{> "systems/DSA_4-1/templates/ui/partial-equipment-button.hbs" inventoryItems}}
</div>
</section> </section>