Embedding Duality Rolls (#52)

* Added DualityRoll direct rolls in chat
* Added button render to renderJournalEntryPageProseMirrorSheet and renderHandlebarsApplication
* Hope and Fear dice totals are now properly added together
* Added Colorful/Normal DualityRoll color settings
This commit is contained in:
WBHarry 2025-05-26 16:34:32 +02:00 committed by GitHub
parent cf51153432
commit d1a0a9ab24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 1192 additions and 1264 deletions

View file

@ -1,3 +1,303 @@
.chat-message {
&.duality {
border-color: black;
padding: 8px 0 0 0;
.message-header {
color: var(--color-light-3);
padding: 0 8px;
}
.duality-data {
display: flex;
flex-direction: column;
.duality-title {
color: var(--color-light-1);
text-shadow: 0 0 1px black;
border-bottom: 1px solid;
margin-bottom: 2px;
display: flex;
align-items: end;
justify-content: space-between;
padding: 0 8px;
.duality-result-value {
border: 1px solid var(--color-dark-5);
padding: 2px;
font-weight: bold;
background: var(--color-dark-1);
margin-bottom: 4px;
font-size: 16px;
}
}
.duality-modifiers {
display: flex;
gap: 2px;
margin-bottom: 4px;
padding: 0 8px;
.duality-modifier {
padding: 2px;
border-radius: 6px;
border: 1px solid;
background: var(--color-dark-6);
font-size: 12px;
}
}
.duality-line {
display: flex;
align-items: end;
justify-content: space-between;
padding: 0 8px;
&.simple {
padding-right: 0;
}
.dice-outer-container {
display: flex;
align-items: 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;
.dice-wrapper {
height: 24px;
width: 24px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
clip-path: polygon(
50% 0%,
80% 10%,
100% 35%,
100% 70%,
80% 90%,
50% 100%,
20% 90%,
0% 70%,
0% 35%,
20% 10%
);
.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-container {
padding-top: 21px;
.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;
}
}
&.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%);
}
}
}
}
.duality-modifier {
padding-top: 21px;
color: var(--color-light-1);
text-shadow: 0 0 1px black;
font-size: 16px;
}
}
}
}
.duality-result {
display: flex;
flex-direction: column;
align-items: end;
justify-content: center;
gap: 2px;
color: var(--color-light-1);
text-shadow: 0 0 1px black;
font-weight: bold;
background: var(--color-dark-1);
padding: 4px;
border-radius: 6px 0 0 0;
}
.duality-actions {
display: flex;
justify-content: space-between;
.duality-action {
color: var(--color-light-1);
text-shadow: 0 0 1px black;
font-weight: bold;
background: var(--color-dark-1);
padding: 4px;
border-radius: 0 6px 0 0;
border-color: black;
min-height: unset;
height: 26px;
&:hover {
background: var(--button-hover-background-color);
}
}
}
.target-section {
margin: 4px 4px;
border: 2px solid;
.target-container {
display: flex;
align-items: center;
transition: all 0.2s ease-in-out;
&:hover {
filter: drop-shadow(0 0 3px @secondaryShadow);
border-color: gold;
}
&.hit {
background: @hit;
}
&.miss {
background: @miss;
}
img {
flex: 0;
width: 22px;
height: 22px;
margin-left: 8px;
align-self: center;
border-color: transparent;
}
.target-inner-container {
flex: 1;
display: flex;
justify-content: center;
margin-right: @hugeMargin;
font-weight: bold;
font-size: 17px;
}
}
}
&.hope {
background: linear-gradient(0, @hopeBackgroundEnd 40px, @hopeBackgroundStart);
}
&.fear {
background: linear-gradient(0, @fearBackgroundEnd, @fearBackgroundStart);
}
&.critical {
background: linear-gradient(0, @criticalBackgroundEnd, @criticalBackgroundStart);
}
.dice-roll {
color: var(--color-dark-1);
.dice-flavor {
color: var(--color-light-1);
}
}
}
}
.daggerheart.chat {
&.downtime {
display: flex;
@ -110,6 +410,24 @@
}
.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;

View file

@ -1,11 +1,12 @@
/* General */
/* Drop Shadows */
/* Background */
/* Base Value */
/* Margins */
/* Borders */
/* Padding */
/* Inputs */
/* General */
/* Drop Shadows */
/* Background */
/* Duality */
@import '../node_modules/@yaireo/tagify/dist/tagify.css';
.daggerheart.sheet.class .editor {
height: 500px;
@ -1346,6 +1347,234 @@
cursor: pointer;
filter: drop-shadow(0 0 3px red);
}
.chat-message.duality {
border-color: black;
padding: 8px 0 0 0;
}
.chat-message.duality .message-header {
color: var(--color-light-3);
padding: 0 8px;
}
.chat-message.duality .duality-data {
display: flex;
flex-direction: column;
}
.chat-message.duality .duality-data .duality-title {
color: var(--color-light-1);
text-shadow: 0 0 1px black;
border-bottom: 1px solid;
margin-bottom: 2px;
display: flex;
align-items: end;
justify-content: space-between;
padding: 0 8px;
}
.chat-message.duality .duality-data .duality-title .duality-result-value {
border: 1px solid var(--color-dark-5);
padding: 2px;
font-weight: bold;
background: var(--color-dark-1);
margin-bottom: 4px;
font-size: 16px;
}
.chat-message.duality .duality-data .duality-modifiers {
display: flex;
gap: 2px;
margin-bottom: 4px;
padding: 0 8px;
}
.chat-message.duality .duality-data .duality-modifiers .duality-modifier {
padding: 2px;
border-radius: 6px;
border: 1px solid;
background: var(--color-dark-6);
font-size: 12px;
}
.chat-message.duality .duality-data .duality-line {
display: flex;
align-items: end;
justify-content: space-between;
padding: 0 8px;
}
.chat-message.duality .duality-data .duality-line.simple {
padding-right: 0;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container {
display: flex;
align-items: center;
gap: 4px;
margin-bottom: 4px;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container {
display: flex;
flex-direction: column;
gap: 2px;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-title {
color: var(--color-light-1);
text-shadow: 0 0 1px black;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container {
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container .dice-wrapper {
height: 24px;
width: 24px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
clip-path: polygon(50% 0%, 80% 10%, 100% 35%, 100% 70%, 80% 90%, 50% 100%, 20% 90%, 0% 70%, 0% 35%, 20% 10%);
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container .dice-wrapper .dice {
height: 26px;
width: 26px;
max-width: unset;
position: absolute;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container .dice-value {
position: absolute;
font-weight: bold;
font-size: 16px;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container.hope .dice-wrapper {
background: black;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container.hope .dice-wrapper .dice {
filter: brightness(0) saturate(100%) invert(79%) sepia(79%) saturate(333%) hue-rotate(352deg) brightness(102%) contrast(103%);
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container.hope .dice-value {
color: var(--color-dark-1);
text-shadow: 0 0 4px white;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container.fear .dice-wrapper {
background: white;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container.fear .dice-wrapper .dice {
filter: brightness(0) saturate(100%) invert(12%) sepia(88%) saturate(4321%) hue-rotate(221deg) brightness(92%) contrast(110%);
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container.fear .dice-value {
color: var(--color-light-1);
text-shadow: 0 0 4px black;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .advantage-container {
padding-top: 21px;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .advantage-container .dice-wrapper {
height: 24px;
width: 24px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .advantage-container .dice-wrapper .dice {
height: 26px;
width: 26px;
max-width: unset;
position: absolute;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .advantage-container .dice-wrapper .dice-value {
position: absolute;
font-weight: bold;
font-size: 16px;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .advantage-container.advantage .dice-wrapper .dice {
filter: brightness(0) saturate(100%) invert(18%) sepia(92%) saturate(4133%) hue-rotate(96deg) brightness(104%) contrast(107%);
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .advantage-container.disadvantage .dice-wrapper .dice {
filter: brightness(0) saturate(100%) invert(9%) sepia(78%) saturate(6903%) hue-rotate(11deg) brightness(93%) contrast(117%);
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .duality-modifier {
padding-top: 21px;
color: var(--color-light-1);
text-shadow: 0 0 1px black;
font-size: 16px;
}
.chat-message.duality .duality-result {
display: flex;
flex-direction: column;
align-items: end;
justify-content: center;
gap: 2px;
color: var(--color-light-1);
text-shadow: 0 0 1px black;
font-weight: bold;
background: var(--color-dark-1);
padding: 4px;
border-radius: 6px 0 0 0;
}
.chat-message.duality .duality-actions {
display: flex;
justify-content: space-between;
}
.chat-message.duality .duality-actions .duality-action {
color: var(--color-light-1);
text-shadow: 0 0 1px black;
font-weight: bold;
background: var(--color-dark-1);
padding: 4px;
border-radius: 0 6px 0 0;
border-color: black;
min-height: unset;
height: 26px;
}
.chat-message.duality .duality-actions .duality-action:hover {
background: var(--button-hover-background-color);
}
.chat-message.duality .target-section {
margin: 4px 4px;
border: 2px solid;
}
.chat-message.duality .target-section .target-container {
display: flex;
align-items: center;
transition: all 0.2s ease-in-out;
}
.chat-message.duality .target-section .target-container:hover {
filter: drop-shadow(0 0 3px gold);
border-color: gold;
}
.chat-message.duality .target-section .target-container.hit {
background: #008000;
}
.chat-message.duality .target-section .target-container.miss {
background: #ff0000;
}
.chat-message.duality .target-section .target-container img {
flex: 0;
width: 22px;
height: 22px;
margin-left: 8px;
align-self: center;
border-color: transparent;
}
.chat-message.duality .target-section .target-container .target-inner-container {
flex: 1;
display: flex;
justify-content: center;
margin-right: 32px;
font-weight: bold;
font-size: 17px;
}
.chat-message.duality.hope {
background: linear-gradient(0, rgba(165, 42, 42, 0.6) 40px, rgba(0, 0, 0, 0.6));
}
.chat-message.duality.fear {
background: linear-gradient(0, rgba(0, 0, 255, 0.6), rgba(15, 15, 97, 0.6));
}
.chat-message.duality.critical {
background: linear-gradient(0, rgba(128, 0, 128, 0.6), rgba(37, 8, 37, 0.6));
}
.chat-message.duality .dice-roll {
color: var(--color-dark-1);
}
.chat-message.duality .dice-roll .dice-flavor {
color: var(--color-light-1);
}
.daggerheart.chat.downtime {
display: flex;
flex-direction: column;
@ -1391,7 +1620,7 @@
}
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .roll.die.hope {
color: white;
-webkit-text-stroke-color: #008080;
-webkit-text-stroke-color: #ffe760;
-webkit-text-stroke-width: 1.5px;
font-weight: 400;
}
@ -1400,7 +1629,7 @@
}
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .roll.die.fear {
color: white;
-webkit-text-stroke-color: #430070;
-webkit-text-stroke-color: #0032b1;
-webkit-text-stroke-width: 1.5px;
font-weight: 400;
}
@ -1415,7 +1644,7 @@
}
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .roll.die.advantage {
color: white;
-webkit-text-stroke-color: green;
-webkit-text-stroke-color: #008000;
-webkit-text-stroke-width: 1.5px;
font-weight: 400;
}
@ -1431,14 +1660,29 @@
text-align: end;
font-weight: bold;
}
.daggerheart.chat.roll .dice-total.duality.hope {
border-color: #ffe760;
border-width: 3px;
background: rgba(255, 231, 96, 0.5);
}
.daggerheart.chat.roll .dice-total.duality.fear {
border-color: #0032b1;
border-width: 3px;
background: rgba(0, 50, 177, 0.5);
}
.daggerheart.chat.roll .dice-total.duality.critical {
border-color: #430070;
border-width: 3px;
background: rgba(67, 0, 112, 0.5);
}
.daggerheart.chat.roll .dice-total .dice-total-value .hope {
color: #008080;
color: #ffe760;
}
.daggerheart.chat.roll .dice-total .dice-total-value .fear {
color: #430070;
color: #0032b1;
}
.daggerheart.chat.roll .dice-total .dice-total-value .critical {
color: #ffd700;
color: #430070;
}
.daggerheart.chat.roll .dice-total-label {
font-size: 12px;

View file

@ -1,4 +1,5 @@
@import './variables/variables.less';
@import './variables/colors.less';
@import './class.less';
@import './pc.less';
@import './ui.less';

View file

@ -1,8 +1,5 @@
/* General */
@hope: #008080;
@fear: #430070;
@critical: #ffd700;
@advantage: green;
@advantage: #008000;
@disadvantage: #b30000;
@miss: rgb(255, 0, 0);
@hit: rgb(0, 128, 0);
@ -22,3 +19,16 @@
@secondaryAccent: #708090;
@formBackground: #782e22;
@hoverBackground: #2f4f4f40;
/* Duality */
@hope: #ffe760;
@hopeBackgroundStart: rgba(0, 0, 0, 0.6);
@hopeBackgroundEnd: rgba(165, 42, 42, 0.6);
@fear: #0032b1;
@fearAccent: #2555cd;
@fearBackgroundStart: rgba(15, 15, 97, 0.6);
@fearBackgroundEnd: rgba(0, 0, 255, 0.6);
@critical: #430070;
@criticalAccent: #66159c;
@criticalBackgroundStart: rgba(37, 8, 37, 0.6);
@criticalBackgroundEnd: rgba(128, 0, 128, 0.6);