index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
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; } |