update ActorSheet to ActorSheetV2 and do a general cleanup pass

move editable-input partial into its own file so it doesn't have to be copy-pasted everywhere
change css to use nesting
This commit is contained in:
Sven Balzer
2024-11-05 13:07:17 +01:00
parent 2f9410180c
commit 6aa65be7a0
8 changed files with 721 additions and 803 deletions
+304 -267
View File
@@ -1,268 +1,305 @@
.tabs > [data-tab] > * {
pointer-events: auto;
}
.row {
display: flex;
flex-direction: row;
flex: 1;
}
.col {
display: flex;
flex-direction: column;
flex: 1;
}
.noflex {
flex: 0;
}
.wrap {
flex-wrap: wrap;
}
.left {
text-align: left;
justify-content: left;
justify-self: left;
}
.center {
text-align: center;
justify-content: center;
align-content: center;
}
.none {
display: none;
}
.grid2 {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid3 {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid4 {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid5 {
display: grid;
grid-template-columns: repeat(5, minmax(0, 1fr));
}
.subgrid {
display: grid;
grid-template-rows: subgrid;
grid-template-columns: subgrid;
}
.colspan2 { grid-column: span 2; }
.colspan3 { grid-column: span 3; }
.colspan4 { grid-column: span 4; }
.colspan5 { grid-column: span 5; }
.colspan6 { grid-column: span 6; }
.colspan7 { grid-column: span 7; }
.colspan8 { grid-column: span 8; }
.colspan9 { grid-column: span 9; }
.rowspan2 { grid-row: span 2; }
.rowspan3 { grid-row: span 3; }
.rowspan4 { grid-row: span 4; }
.rowspan5 { grid-row: span 5; }
.rowspan6 { grid-row: span 6; }
.rowspan7 { grid-row: span 7; }
.rowspan8 { grid-row: span 8; }
.rowspan9 { grid-row: span 9; }
.editable-input {
flex: 1;
padding: 0px 3px;
}
.editable-input input {
border: none;
}
.editable-number {
text-align: center;
}
.placeholder {
font-size: 0.8em;
border-top: 1px solid;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.sheet .die {
display: inline-grid;
text-align: center;
align-items: center;
color: #fff;
width: 48px;
height: 48px;
}
.sheet .die > * {
grid-row: 1;
grid-column: 1;
}
.sheet .die-courage { fill: #b22319; }
.sheet .die-cleverness { fill: #8158a3; }
.sheet .die-intuition { fill: #388834; }
.sheet .die-charisma { fill: #0c0c0c; }
.sheet .die-dexterity { fill: #d4b366; }
.sheet .die-agility { fill: #678ec3; }
.sheet .die-constitution { fill: #a3a3a3; }
.sheet .die-strength { fill: #d5a877; }
.sheet .die-attacke { fill: #b22319; }
.sheet .die-parade { fill: #388834; }
.sheet .die-trefferpunkte { fill: #0c0c0c; }
.sheet .item-open,
.sheet .item-delete,
.sheet .roll {
cursor: pointer;
}
.sheet .item-open:hover,
.sheet .item-delete:hover,
.sheet .roll:hover {
transform: scale(1.05);
}
.character-image {
width: 115px;
height: 115px;
}
.item-image {
width: 80px;
height: 80px;
}
.list-header {
padding: 0.5rem;
}
.list {
box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
}
.list-item {
padding: 0.25rem;
border-bottom: 1px dotted;
}
.list-item:last-child {
border: none;
}
.item-name {
gap: 0.5rem;
flex: 0 1 auto;
}
.item-sub {
font-size: 0.625rem;
}
.inventar {
gap: 16px;
}
.kampf {
gap: 16px;
}
.actor-sheet fieldset {
width: 100%;
}
.actor-sheet table {
border: none;
background: none;
table-layout: fixed;
}
.actor-sheet .item-image {
width: 32px;
height: 32px;
}
.actor-sheet .tabs,
.DSA41 .tabs {
padding: .5rem;
margin-top: .5rem;
margin-bottom: .5rem;
border-top: 1px solid;
border-bottom: 1px solid;
}
.DSA41 .tabs > * {
align-items: center;
}
.DSA41 .tabs .active {
text-decoration: underline;
}
.actor-sheet .kampf .ruestungen {
display: grid;
grid-template-columns: 2fr repeat(8, 1fr) repeat(2, 1.5fr);
}
.actor-sheet .kampf .ruestungen > * {
display: grid;
grid-column: 1 / -1;
grid-template-columns: subgrid;
padding: 0.25rem;
border-bottom: 1px dotted;
text-align: center;
place-items: center;
}
.actor-sheet .kampf .ruestungen > *:last-child {
border: none;
}
.DSA41 .Bewaffnung .tab > * {
display: grid;
grid-template-columns: minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr);
align-items: center;
gap: 0.5rem;
}
.DSA41 .Ruestung {
display: grid;
grid-template-columns: minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr);
align-items: center;
gap: 0.5rem;
margin-top: 0.5rem;
}
#tooltip:has(> .dsa41-tooltip) {
/* background-color: #678ec3; */
.DSA41 {
font-size: 14px;
/* Change from FoundryVTT's default of 'none' to 'auto' to allow checkboxes in the nav bar */
& .tabs > [data-tab] > * {
pointer-events: auto;
}
/* Allow application content to be scrolled */
& .window-content {
overflow-y: scroll;
}
& [data-action] {
cursor: pointer;
&:hover {
transform: scale(1.05);
}
}
& .small {
font-size: 0.75em;
}
& .left {
text-align: left;
justify-content: left;
justify-self: left;
}
& .right {
text-align: right;
justify-content: right;
justify-self: right;
}
& .center {
text-align: center;
justify-content: center;
align-content: center;
align-items: center;
}
& .row {
display: flex;
flex-direction: row;
flex: 1;
}
& .col {
display: flex;
flex-direction: column;
flex: 1;
}
& .noflex {
flex: 0;
}
& .subgrid {
display: grid;
grid-template-rows: subgrid;
grid-template-columns: subgrid;
}
& .subgrid-columns {
display: grid;
grid-template-columns: subgrid;
}
& .subgrid-rows {
display: grid;
grid-template-rows: subgrid;
}
& .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
& .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
& .grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
& .grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
& .grid6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
& .grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
& .grid8 { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
& .grid9 { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); }
& .colspan2 { grid-column: span 2; }
& .colspan3 { grid-column: span 3; }
& .colspan4 { grid-column: span 4; }
& .colspan5 { grid-column: span 5; }
& .colspan6 { grid-column: span 6; }
& .colspan7 { grid-column: span 7; }
& .colspan8 { grid-column: span 8; }
& .colspan9 { grid-column: span 9; }
& .colspan-all { grid-column: 1 / -1; }
& .rowspan2 { grid-row: span 2; }
& .rowspan3 { grid-row: span 3; }
& .rowspan4 { grid-row: span 4; }
& .rowspan5 { grid-row: span 5; }
& .rowspan6 { grid-row: span 6; }
& .rowspan7 { grid-row: span 7; }
& .rowspan8 { grid-row: span 8; }
& .rowspan9 { grid-row: span 9; }
& .rowspan-all { grid-row: 1 / -1; }
& .editable-input {
flex: 1;
padding: 0px 3px;
& input {
border: none;
}
&.editable-number {
text-align: center;
}
& .placeholder {
font-size: 0.8em;
border-top: 1px solid;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
& .character-image {
width: 115px;
height: 115px;
}
& .item-image {
width: 80px;
height: 80px;
}
& .die {
display: inline-grid;
text-align: center;
align-items: center;
color: #fff;
width: 3.5em;
height: 3.5em;
& > * {
grid-row: 1;
grid-column: 1;
}
&.die-courage { fill: #b22319; }
&.die-cleverness { fill: #8158a3; }
&.die-intuition { fill: #388834; }
&.die-charisma { fill: #0c0c0c; }
&.die-dexterity { fill: #d4b366; }
&.die-agility { fill: #678ec3; }
&.die-constitution { fill: #a3a3a3; }
&.die-strength { fill: #d5a877; }
&.die-attacke { fill: #b22319; }
&.die-parade { fill: #388834; }
&.die-trefferpunkte { fill: #0c0c0c; }
}
& .tabs {
padding: .5rem;
margin-top: .5rem;
margin-bottom: .5rem;
border-top: 1px solid;
border-bottom: 1px solid;
& > * {
align-items: center;
}
& .active {
text-decoration: underline;
}
}
& .tab.active {
display: grid;
gap: 0.5rem;
}
& .list {
display: grid;
background: #252830;
box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
& .item-image {
width: 40px;
height: 40px;
}
& .item-name {
gap: 0.5rem;
}
}
& .list-header {
display: grid;
grid-column: 1 / -1;
grid-template-rows: subgrid;
grid-template-columns: subgrid;
align-items: center;
padding: 0.5rem;
border-radius: 5px 5px 0px 0px;
background: linear-gradient(90deg, rgb(36, 133, 44) 0%, rgb(0, 79, 7) 40%, rgb(0, 51, 5) 100%);
}
& .list-item {
display: grid;
grid-column: 1 / -1;
grid-template-rows: subgrid;
grid-template-columns: subgrid;
align-items: center;
padding: 0.25rem;
border-bottom: 1px dotted;
&:last-child {
border: none;
}
}
& [data-application-part="Bewaffnung"] {
& .tab {
grid-template-columns: minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr);
align-items: center;
}
}
& [data-application-part="Ruestung"] {
& .tab {
grid-template-columns: minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr);
align-items: center;
}
}
& [data-application-part="ActorSheet"] {
& .tab {
&[data-tab="tab1"] {
& .Eigenschaften {
display: grid;
grid-template-columns: minmax(0, max-content) repeat(8, minmax(0, 1fr));
align-items: center;
gap: 0.5rem;
}
& .Basiswerte {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
}
}
&[data-tab="tab2"] {
& .Kampftalente {
display: grid;
grid-template-columns: minmax(0, max-content) repeat(5, minmax(0, 1fr));
align-items: center;
gap: 0.5rem;
}
& .Talente {
display: grid;
grid-template-columns: minmax(0, max-content) repeat(2, minmax(0, 1fr));
align-items: center;
gap: 0.5rem;
}
}
&[data-tab="tab3"] {
grid-template-columns: minmax(min-content, max-content) auto minmax(min-content, max-content) min-content;
& > * {
grid-column: 1 / -1;
}
}
&[data-tab="tab4"] {
& .Bewaffnung {
grid-template-columns: minmax(0, max-content) repeat(3, minmax(0, auto));
& .die {
font-size: 12px;
}
}
& .Ruestung {
grid-template-columns: 2fr repeat(8, 1fr) repeat(2, 1.5fr);
text-align: center;
}
}
}
}
}