index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'public/soldier_record_block.js')
-rw-r--r-- | public/soldier_record_block.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/public/soldier_record_block.js b/public/soldier_record_block.js new file mode 100644 index 0000000..b2465ab --- /dev/null +++ b/public/soldier_record_block.js @@ -0,0 +1,40 @@ +class SoldierRecordBlock extends HTMLDivElement { + constructor() { + super(); + + let template = document.getElementById('soldier-record-block'); + let templateContent = template.content; + + const shadowRoot = this.attachShadow({ mode: "open" }); + shadowRoot.appendChild(templateContent.cloneNode(true)); + + // console.log(shadowRoot) + + // this.shadowRoot + // .querySelectorAll('p:has(input[type="number"]), .physical-status-track') + // .forEach(el => el.addEventListener('click', e => e.stopPropagation())) + // ; + } +} + +customElements.define( + 'damage-block', + class extends HTMLSpanElement { + constructor() { + super(); + + let template = document.getElementById('damage-block'); + let templateContent = template.content; + + const shadowRoot = this.attachShadow({ mode: "open" }); + shadowRoot.appendChild(templateContent.cloneNode(true)); + } + }, + { extends: 'span' } +); + +customElements.define( + 'soldier-record-block', + SoldierRecordBlock, + { extends: 'div'} +);
\ No newline at end of file |