Trying to get modules to work

This commit is contained in:
Ian Gulliver
2021-05-08 13:00:59 -07:00
parent 3e4769b3ef
commit c3b890199d
12 changed files with 78 additions and 17 deletions

14
ts/tower.ts Normal file
View File

@@ -0,0 +1,14 @@
import { TowerMap } from 'tower_map.js';
export function main() {
document.body.style.margin = '0';
document.body.style.backgroundColor = 'black';
const container = document.createElement('div');
document.body.appendChild(container);
container.style.width = '100vmin';
container.style.height = '100vmin';
const map = new TowerMap(container);
map.draw();
};

14
ts/tower_map.ts Normal file
View File

@@ -0,0 +1,14 @@
export class TowerMap {
#prnt;
constructor(prnt: HTMLElement) {
this.#prnt = prnt;
this.#prnt.style.display = 'grid';
}
draw() {
this.#prnt.style.backgroundImage = 'url("images/land1.svg")';
this.#prnt.style.gridTemplateColumns = 'repeat(20, 1ft)';
this.#prnt.style.gridTemplateRows = 'repeat(20, 1ft)';
}
}