22 lines
631 B
JavaScript
22 lines
631 B
JavaScript
class Window {
|
|
constructor(id) {
|
|
this.container = document.getElementById(`${id}-container`)
|
|
this.innerContainer = document.getElementById(id)
|
|
}
|
|
|
|
show() {
|
|
this.resize()
|
|
this.container.style.display = 'block'
|
|
}
|
|
|
|
hide() {
|
|
this.container.style.display = 'none'
|
|
}
|
|
|
|
resize() {
|
|
this.container.style.width = canvas.getBoundingClientRect().width - 40 + 'px';
|
|
this.container.style.height = canvas.getBoundingClientRect().height - 40 + 'px';
|
|
this.container.style.minHeight = canvas.getBoundingClientRect().width - 40 + 'px';
|
|
this.innerContainer.style.height = canvas.getBoundingClientRect().height - 77 + 'px';
|
|
}
|
|
}
|