logo.js 569 B

123456789101112131415161718192021222324252627282930
  1. import { is_string } from "./functions.js";
  2. class logo {
  3. #name;
  4. constructor(name) {
  5. if (!is_string(name)) {
  6. throw "Name must be an string.";
  7. }
  8. this.#name = name;
  9. }
  10. get name() {
  11. return this.#name;
  12. }
  13. get ui() {
  14. const container = document.createElement("div");
  15. container.className = "logo";
  16. const name = document.createElement("span");
  17. name.innerText = this.name;
  18. container.appendChild(name);
  19. return container;
  20. }
  21. }
  22. export { logo };