| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import { types } from "assets/types.js";
- class loading_screen {
- #cover;
- static #self;
- constructor(cover = undefined) {
- if (loading_screen.#self instanceof loading_screen) {
- return loading_screen.#self;
- }
-
- loading_screen.#self = this;
- types.check_html_element(cover);
- this.#cover = cover;
- this.#prepare();
- }
- get cover() {
- return this.#cover;
- }
- #prepare() {
- this.cover.style.transition = "opacity 0.5s ease-in-out";
- }
- show() {
- this.cover.style.display = "";
- this.cover.style.opacity = "1";
- }
- hide() {
- this.cover.style.opacity = "0";
- setTimeout(() => {
- this.cover.style.display = "none";
- }, 500);
- }
- }
- export { loading_screen };
|