import UI from "./ui.js"; class Panel extends UI { constructor(width, height) { super(document.createElement("div"), width, height); this._hidden = true; this.element.classList.add("panel"); this.element.classList.add("shadow"); this.element.classList.add("hidden"); this._children = []; } add(ui) { this._children.push(ui); this.element.appendChild(ui.element); } toggle() { if (this._hidden) { this.show(); } else { this.hide(); } } show() { if (this._hidden) { this.element.classList.remove("hidden"); this._hidden = false; } } hide() { if (!this._hidden) { this.element.classList.add("hidden"); this._hidden = true; } } } export default Panel;