daggerheart/styles/less/ui/chat/chat.less
WBHarry 6301e575e3
[Feature] Allow Dice Reroll in ChatMessage (#395)
* Troubleshooting

Created test button in 'duality-roll.hbs' and functionality in chatLog.mjs

* Updated functionality

dialog recheck.

* Update duality-roll.hbs

testing toggle on specific areas so only tooltip is triggered.

Rest of CSS functionality not affected.

* Redoing Dice Reroll functionality

Attempting something new

* The rise of NaNs

Resolved Dice Parsing Errors, now dealing with parsing errors from system values.

* Forcing string evaluation for testing

* Fixed rerolling of duality dice

* Fixed message.rolls not being updated

* Added support for d20 rolls

* PR fixes

---------

Co-authored-by: Nikhil Nagarajan <potter.nikhil@gmail.com>
2025-07-23 01:01:21 +02:00

417 lines
12 KiB
Text

@import '../../utils/colors.less';
@import '../../utils/spacing.less';
.daggerheart.chat {
&.downtime {
display: flex;
flex-direction: column;
align-items: center;
.downtime-title-container {
display: flex;
flex-direction: column;
align-items: center;
.downtime-subtitle {
font-size: 17px;
}
}
.downtime-image {
width: 80px;
}
.action-use-button {
width: 100%;
}
}
&.resource-roll {
.reroll-message {
text-align: center;
font-size: 18px;
margin-bottom: 0;
}
}
&.roll {
.dice-flavor {
text-align: center;
font-weight: bold;
}
.dice-tooltip {
.dice-rolls {
&.duality {
display: flex;
gap: 0.25rem;
> .roll {
background-image: none;
.reroll-button {
border: none;
background: initial;
width: 42px;
&:hover {
background: var(--button-background-color);
border: 1px solid var(--button-border-color);
}
}
}
}
&.rerollable {
.reroll-button {
border: none;
background: initial;
&:hover {
background: var(--button-background-color);
border: 1px solid var(--button-border-color);
}
}
}
// margin: 0;
> .roll {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
margin-bottom: 4px;
.dice-container {
display: flex;
flex-direction: column;
gap: 2px;
.dice-title {
color: var(--color-light-1);
text-shadow: 0 0 1px black;
}
.dice-inner-container {
display: flex;
align-items: center;
justify-content: center;
position: relative;
&.hope,
&.fear {
.dice-wrapper {
clip-path: polygon(
50% 0%,
80% 10%,
100% 35%,
100% 70%,
80% 90%,
50% 100%,
20% 90%,
0% 70%,
0% 35%,
20% 10%
);
}
}
.dice-wrapper {
height: 24px;
width: 24px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
.dice {
height: 26px;
width: 26px;
max-width: unset;
position: absolute;
}
}
.dice-value {
position: absolute;
font-weight: bold;
font-size: 16px;
}
&.hope {
.dice-wrapper {
background: black;
.dice {
filter: brightness(0) saturate(100%) invert(79%) sepia(79%) saturate(333%)
hue-rotate(352deg) brightness(102%) contrast(103%);
}
}
.dice-value {
color: var(--color-dark-1);
text-shadow: 0 0 4px white;
}
}
&.fear {
.dice-wrapper {
background: white;
.dice {
filter: brightness(0) saturate(100%) invert(12%) sepia(88%) saturate(4321%)
hue-rotate(221deg) brightness(92%) contrast(110%);
}
}
.dice-value {
color: var(--color-light-1);
text-shadow: 0 0 4px black;
}
}
&.advantage {
.dice-wrapper {
.dice {
filter: brightness(0) saturate(100%) invert(18%) sepia(92%) saturate(4133%)
hue-rotate(96deg) brightness(104%) contrast(107%);
}
}
}
&.disadvantage {
.dice-wrapper {
.dice {
filter: brightness(0) saturate(100%) invert(9%) sepia(78%) saturate(6903%)
hue-rotate(11deg) brightness(93%) contrast(117%);
}
}
}
}
}
}
}
.damage-resource {
font-weight: 600;
margin-top: 5px;
}
}
.dice-total {
&.duality {
&.hope {
border-color: @hope;
border-width: 3px;
background: rgba(@hope, 0.5);
}
&.fear {
border-color: @fear;
border-width: 3px;
background: rgba(@fear, 0.5);
}
&.critical {
border-color: @critical;
border-width: 3px;
background: rgba(@critical, 0.5);
}
}
.dice-total-value {
.hope {
color: @hope;
}
.fear {
color: @fear;
}
.critical {
color: @critical;
}
}
}
.dice-total-label {
font-size: 12px;
font-weight: bold;
font-variant: all-small-caps;
margin: -@fullMargin 0;
}
.target-selection {
display: flex;
justify-content: space-around;
input[type='radio'] {
display: none;
&:checked + label {
text-shadow: 0px 0px 4px #ce5937;
}
&:not(:checked) + label {
opacity: 0.75;
}
}
label {
cursor: pointer;
opacity: 0.75;
&.target-selected {
text-shadow: 0px 0px 4px #ce5937;
opacity: 1;
}
}
}
.target-section {
margin-top: 5px;
.target-container {
display: flex;
transition: all 0.2s ease-in-out;
&:hover {
filter: drop-shadow(0 0 3px @secondaryShadow);
border-color: gold;
}
&.hidden {
display: none;
border: 0;
}
&.hit {
background: @hit;
}
&.miss {
background: @miss;
}
img,
.target-save-container {
width: 22px;
height: 22px;
align-self: center;
border-color: transparent;
}
img {
flex: 0;
margin-left: 8px;
}
.target-save-container {
margin-right: 8px;
justify-content: center;
display: flex;
align-items: center;
min-height: unset;
border: 1px solid black;
}
.target-inner-container {
flex: 1;
display: flex;
justify-content: center;
font-size: var(--font-size-16);
}
&:not(:has(.target-save-container)) .target-inner-container {
margin-right: @hugeMargin;
}
}
}
.dice-actions {
display: flex;
gap: 4px;
button {
flex: 1;
}
}
.dice-result {
.roll-damage-button,
.damage-button,
.duality-action {
margin-top: 5px;
}
}
&:not(.expanded) .dice-tooltip {
grid-template-rows: 0fr;
}
}
&.domain-card {
display: flex;
flex-direction: column;
align-items: center;
.domain-card-title {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
div {
font-size: 20px;
font-variant: small-caps;
font-weight: bold;
}
h2 {
width: 100%;
text-align: center;
margin: 0;
}
}
.ability-card-footer {
display: flex;
width: 100%;
margin-top: @fullMargin;
flex-wrap: wrap;
button {
border-radius: 6px;
background: @positive;
border-color: black;
flex-basis: calc(50% - 2px);
&:nth-of-type(n + 3) {
margin-top: @tinyMargin;
}
}
.ability-card-action-cost {
margin: auto;
font-size: 1.5em;
}
}
img {
width: 80px;
}
}
button {
&.inner-button {
--button-size: 1.25rem;
--input-height: 1.25rem;
padding: 0 0.25rem;
margin: 5px 1px -4px auto;
&.inner-button-right {
margin-left: auto;
}
}
}
[data-use-perm='false'] {
pointer-events: none;
border-color: transparent;
}
[data-view-perm='false'] {
> * {
display: none;
}
&::after {
content: '??';
}
}
}