feat(loading): add loading screen as web component
This commit is contained in:
1011
public/scan-loading-screen/scan-loading-screen.css
Normal file
1011
public/scan-loading-screen/scan-loading-screen.css
Normal file
File diff suppressed because it is too large
Load Diff
21
public/scan-loading-screen/scan-loading-screen.js
Normal file
21
public/scan-loading-screen/scan-loading-screen.js
Normal 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);
|
||||||
Reference in New Issue
Block a user