Files
tower/js/tile.js

15 lines
500 B
JavaScript
Raw Normal View History

2021-05-11 02:57:17 +00:00
export class Tile {
2021-05-17 04:26:18 +00:00
constructor(width, height, masks) {
this.masks = masks;
2021-05-11 02:57:17 +00:00
this.elem = document.createElement('div');
this.elem.style.gridColumnEnd = `span ${width}`;
this.elem.style.gridRowEnd = `span ${height}`;
2021-05-17 04:26:18 +00:00
// Hack to avoid floating point stitching gaps
this.elem.style.width = 'calc(100% + 1px)';
this.elem.style.height = 'calc(100% + 1px)';
2021-05-11 02:57:17 +00:00
}
2021-05-11 05:17:16 +00:00
remove() {
this.elem.remove();
}
2021-05-11 02:57:17 +00:00
}
//# sourceMappingURL=tile.js.map