-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
92 lines (91 loc) · 2.93 KB
/
index.html
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Topsort Banner</title>
<script
type="module"
src="node_modules/skeleton-webcomponent-loader/dist/skeleton-webcomponent/skeleton-webcomponent.esm.js"
></script>
<script async type="module" src="https://unpkg.com/@topsort/analytics.js"></script>
<script async type="module" src="src/index.ts"></script>
</head>
<script>
// Set up authentication for auctions and events
window.TS = {
token: "%VITE_TS_TOKEN%",
};
// Setup @topsort/banners.js
window.TS_BANNERS = {
getLoadingElement() {
const div = document.createElement("div");
div.innerText = "Loading Banner...";
},
getErrorElement(error) {
const div = document.createElement("div");
const pre = document.createElement("pre");
if (error.name === "TopsortConfigurationError") {
pre.innerText = error.message;
} else {
pre.innerText = "Couldn't load Banner. Check console for more details.";
pre.innerText = `${error.name}: ${error.message}`;
}
div.appendChild(pre);
return div;
},
};
</script>
<style>
body {
display: flex;
justify-content: center;
padding: 20px;
}
</style>
<body>
<div style="padding-right: 1rem">
<h3>Standalone Banner</h3>
<pre>
<code>
<topsort-banner id="an-example-slot" width="800" height="400"></topsort-banner>
</code>
</pre>
<div style="outline 1px solid black">
<topsort-banner id="an-example-slot" width="800" height="400"></topsort-banner>
</div>
</div>
<div style="outline 1px solid black">
<h3>Multiple Banners under one context</h3>
<pre>
<code>
<topsort-banner id="an-example-slot" width="800" height="400" context>
<div>
<h3>First Banner</h3>
<pre>
<code>
<topsort-banner-slot rank="1"></topsort-banner-slot>
</code>
</pre>
<topsort-banner-slot rank="1"></topsort-banner-slot>
</div>
<div>
<h3>Second Banner</h3>
<topsort-banner-slot rank="2"></topsort-banner-slot>
</div>
</topsort-banner>
</code>
</pre>
<topsort-banner id="an-example-slot" width="800" height="400" context="true">
<div>
<h3>First Banner</h3>
<topsort-banner-slot rank="1"></topsort-banner-slot>
</div>
<div>
<h3>Second Banner</h3>
<topsort-banner-slot rank="2"></topsort-banner-slot>
</div>
</topsort-banner>
</div>
</body>
</html>