This commit is contained in:
MartinSDampier 2025-06-24 09:10:32 -05:00
parent a087468662
commit c309f92f0c
2 changed files with 25 additions and 3 deletions

View file

@ -58,6 +58,7 @@ export class InitiativeView extends ItemView {
function createHeader(header:string, parent:HTMLElement): void {
let headerElement = parent.createDiv({cls: "flex"});
headerElement.createEl('h3', {text: header})
headerElement.id = header;
}
this.contentEl.empty();
@ -187,10 +188,18 @@ export class InitiativeView extends ItemView {
let classes = "Centered" + (isHero ? " heroes" : " villains") + ' trackerTableStyle';
if (isHero)
{
let groupButton = new ButtonComponent(this.gridEl.children[2] as HTMLElement);
groupButton.setButtonText("Add Group");
groupButton.onClick(() => {this.createGroupRow(true);});
groupButton.setClass("adjustInitiativeHeaderButton");
this.heroesTableEl = this.gridEl.createEl('table', {cls: classes});
}
else
{
let groupButton = new ButtonComponent(this.gridEl.children[4] as HTMLElement);
groupButton.setButtonText("Add Group");
groupButton.onClick(() => {this.createGroupRow(false);});
groupButton.setClass("adjustInitiativeHeaderButton");
this.villainsTableEl = this.gridEl.createEl('table', {cls: classes});
}
let header = isHero ? this.heroesTableEl.createEl('tr') : this.villainsTableEl.createEl('tr');
@ -225,8 +234,10 @@ export class InitiativeView extends ItemView {
//buttonHeader.createEl('button', { text: "Create"});
}
createGroupRow(){
createGroupRow(isHero: boolean){
let row = isHero ? this.heroesTableEl.createEl('tr', {cls: "Centered rowHeight"}) : this.villainsTableEl.createEl('tr', {cls: "Centered rowHeight"});
let creatureType = row.createDiv({text: "Group", cls: "verticalType" })
row.createEl("td", {cls: "rowHeight"} );
}
createCreatureRow(creature: Creature = new Creature, isHero: boolean){

View file

@ -24,6 +24,10 @@
width: 100%;
}
.rowHeight {
height: 70px;
}
.condition-buttons {
display: flex;
flex-flow: row wrap;
@ -42,6 +46,13 @@
.tableRowStyle{
display: table-row;
}
.groupHeader{
margin-top: 11px;
margin-left: -13px;
}
.groupMinHeight{
min-height: 70px;
}
.flex {
display: flex;
}
@ -183,7 +194,7 @@
.verticalType {
transform: translate(-8%) rotate(-90deg) translate(-14px) ;
margin: -18px;
margin-left: -18px;
width: 57px;
font-weight: bold;
margin-bottom: 5px;