export default class Loader {
/** @type {HTMLDivElement} */
#container;
constructor() {
this.#container = document.createElement("div");
this.#container.id = "dribbblish-loader";
this.#container.innerHTML = /* html */ `
Loading...
`;
document.body.appendChild(this.#container);
}
show(text) {
this.#container.querySelector("span").innerText = text ?? "";
this.#container.setAttribute("active", "");
}
hide() {
this.#container.removeAttribute("active");
}
}