index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2024-07-02 15:19:17 -0700 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-07-02 15:27:27 -0700 |
commit | 71724cc97967a876224d1a4b711843b17256cb0d (patch) | |
tree | bf39584668aa2cd8077a01719715663a8b0e3849 /src/modules/record_sheet.js | |
parent | 624991870df0e804d64cf4d9359c63435513d61b (diff) |
WIP: counters
Diffstat (limited to 'src/modules/record_sheet.js')
-rw-r--r-- | src/modules/record_sheet.js | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/modules/record_sheet.js b/src/modules/record_sheet.js index 092870a..0f279d5 100644 --- a/src/modules/record_sheet.js +++ b/src/modules/record_sheet.js @@ -1,17 +1,5 @@ import { Observable } from "./observable"; -// import counters from '../../public/assets/images/counters.svg'; -// console.log('counters', counters); - -// import svg from '../../public/assets/images/counters.svg'; - -// const doc = new DOMParser().parseFromString(svg, 'image/svg+xml'); -// const rifle = document.importNode(doc.querySelector('#rifle'), true); -// const smg = document.importNode(doc.querySelector('#smg'), true); - -// console.log('svg', counters); -// console.log('doc', doc); -// console.log('imported svg', rifle); -// console.log('imported svg', smg); +import counters from './assets/images/counters.svg'; const weapons = { rifle: { @@ -42,9 +30,7 @@ function createIcon(number) { icon.setAttributeNS(null, 'viewBox', '-6 -6 12 12'); icon.setAttribute('xmlns', svgns); - // use.setAttributeNS(null, 'href', `assets/images/counters.svg?v=${cacheBuster}#counter-base`); - use.setAttributeNS(null, 'href', `assets/images/counters.svg#counter-base`); - // use.setAttributeNS(null, 'href', `${counters}#counter-base`); + use.setAttributeNS(null, 'href', `./${counters}#counter-base`); text.textContent = number; @@ -68,12 +54,9 @@ function createWeaponIcon(type) { icon.setAttribute('xmlns', svgns); icon.classList.add('weapon-icon'); - // use.setAttributeNS(null, 'href', `assets/images/counters.svg?v=${cacheBuster}#${type}`); - // use.setAttributeNS(null, 'href', `${counters}#${type}`); - use.setAttributeNS(null, 'href', `assets/images/counters.svg#${type}`); + use.setAttributeNS(null, 'href', `${counters}#${type}`); icon.appendChild(use); - // icon.appendChild(document.importNode(doc.querySelector(`#${type}`), true)); return icon; } |