feat(loading): add loading screen as web component

This commit is contained in:
2026-01-01 22:14:58 -03:00
parent f095efd9e0
commit 92e426b316
2 changed files with 1032 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
class ScanLoadingScreen extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({mode: 'open'});
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = '/scan-loading-screen/scan-loading-screen.css';
const container = document.createElement('div');
container.classList.add('container');
const barcode = document.createElement('div');
barcode.classList.add('barcode');
for(let i = 0; i < 30; i++) {
const div = document.createElement('div');
barcode.appendChild(div);
}
container.appendChild(barcode);
shadowRoot.appendChild(link);
shadowRoot.appendChild(container);
}
}
customElements.define('scan-loading-screen', ScanLoadingScreen);