-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (32 loc) · 1 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import LCDNumber from './src/lcd-number.js'
import VenusWaves from './src/venus-waves.js'
// import waves from './src/waves'
const onload = function () {
// For native Imports, manually fire WebComponentsReady so user code
// can use the same code path for native and polyfill'd imports.
if (!window.HTMLImports) {
document.dispatchEvent(
new CustomEvent('WebComponentsReady', {
bubbles: true,
})
);
}
};
const webComponentsSupported = (
'registerElement' in document &&
'import' in document.createElement('link') &&
'content' in document.createElement('template')
);
if (!webComponentsSupported) {
const script = document.createElement('script');
script.async = true;
script.src = '//unpkg.com/@webcomponents/webcomponentsjs@next/webcomponents-loader.js';
script.onload = onload;
document.head.appendChild(script);
} else {
onload();
}
export default {
'lcd-number': LCDNumber,
'venus-waves': VenusWaves
}