Skip to content

Commit dd66ba5

Browse files
author
Marko Petzold
committed
thumbnail
1 parent d4fcb6f commit dd66ba5

4 files changed

Lines changed: 378 additions & 7 deletions

File tree

demo/index.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
padding: 0;
1111
width: 100%;
1212
height: 100%;
13-
background-color: aliceblue;
13+
background-color: #f5f5f5;
1414
font-family:
1515
Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
1616
--font-family-serif: Helvetica;
@@ -34,17 +34,20 @@
3434
<script src="https://storage.googleapis.com/reswarm-images/ObjectRandomizer.js"></script>
3535

3636
<script type="module">
37-
import { html, render } from 'lit'
37+
import { render } from 'lit'
38+
import { html, unsafeStatic } from 'lit/static-html.js'
39+
const packageJson = await fetch('../package.json').then((res) => res.json())
40+
const tag = unsafeStatic(`widget-mapbox-${packageJson.version}`)
3841
import '../dist/widget-mapbox.js'
3942
const data = await fetch('../src/default-data.json').then((res) => res.json())
40-
const themeObject = await fetch('themes/vintage.json').then((res) => res.json())
41-
const theme = { theme_name: 'vintage', theme_object: themeObject }
43+
const themeObject = await fetch('themes/light.json').then((res) => res.json())
44+
const theme = { theme_name: 'light', theme_object: themeObject }
4245
render(
4346
html`
44-
<widget-mapbox-1.5.4 .theme="${theme}" .inputData=${data}>
47+
<${tag} .theme="${theme}" .inputData=${data}>
4548
web component is not registered. Make sure to use the tag with the correct version
4649
string from the package.json
47-
</widget-mapbox-1.5.4>
50+
</${tag}>
4851
`,
4952
document.getElementById('demo')
5053
)

0 commit comments

Comments
 (0)