@livelike/embet 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.html ADDED
@@ -0,0 +1,332 @@
1
+ <!DOCTYPE html>
2
+
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>LiveLike Demo</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ </head>
8
+
9
+ <body>
10
+ <!-- Need for IE11 -->
11
+ <script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
12
+ <!-- SDK -->
13
+ <!-- <script src="embet.umd.min.js"></script> -->
14
+ <script src="tt.js" type="module"></script>
15
+ <style>
16
+ /* * {
17
+ box-sizing: border-box;
18
+ } */
19
+
20
+ body {
21
+ background: #444;
22
+ }
23
+ </style>
24
+
25
+ <main class="app" style="display: flex;">
26
+ <section class="livelike-container" style="width: 50%">
27
+ <embet-widgets programid="bce2f344-c6ac-459a-b3ce-4e7bc004e06a" id="livelikeWidget" class="root widget-container">
28
+ </embet-widgets>
29
+ </section>
30
+ </main>
31
+ </body>
32
+ <!-- <script>
33
+ const embetWidgets = document.querySelector('embet-widgets');
34
+ // bce2f344-c6ac-459a-b3ce-4e7bc004e06a
35
+
36
+ // e6a92db7-f8f3-4dcc-91fc-6a3b925828fb
37
+ // programid="bce2f344-c6ac-459a-b3ce-4e7bc004e06a"
38
+ // customid="test-custom-id-02"
39
+
40
+ function saveLiveLikeProfile(profile) {
41
+ console.log('LiveLike Profile: ', profile);
42
+ }
43
+
44
+ // function createBettingWidget() {
45
+ // embetWidgets.widgetContainer.createWidgetElement({
46
+ // // id: "e349a582-919e-40f7-8415-27ca0122ac01", // moneylinePayloadGreen:
47
+ // id: "d1f75463-3d99-48b8-a893-9792e7fe910e", //moneylinePayloadBlue
48
+ // // id: "adebe480-7752-4126-8488-ccd4c89544c5", //spreadPayloadGreen
49
+ // // id: "3ec530c0-d635-4893-9590-e0f9f037c6f6", //spreadPayloadBlue
50
+ // // id: "99a4a7d3-1b86-44ac-8f64-19b3bb255376", //totalPayloadGreen
51
+ // // id: "fe5f61e0-33a4-4c48-a1cc-05272851aedf", // totalPayloadBlue
52
+ // kind: 'image-poll',
53
+ // // id: "8a88f56e-f94a-4ee5-82a4-7496b2798d25",
54
+ // // kind: 'image-prediction',
55
+ // mode: ({ widget }) =>
56
+ // embetWidgets.widgetContainer.attach(widget)
57
+ // .then(widget.interactive)
58
+ // })
59
+ // }
60
+ function createBettingWidget() {
61
+ embetWidgets.createWidgetElement({
62
+ // id: "e349a582-919e-40f7-8415-27ca0122ac01", // moneylinePayloadGreen:
63
+ // id: "d1f75463-3d99-48b8-a893-9792e7fe910e", //moneylinePayloadBlue
64
+ // id: "adebe480-7752-4126-8488-ccd4c89544c5", //spreadPayloadGreen
65
+ // id: "3ec530c0-d635-4893-9590-e0f9f037c6f6", //spreadPayloadBlue
66
+ // id: "99a4a7d3-1b86-44ac-8f64-19b3bb255376", //totalPayloadGreen
67
+ // id: "fe5f61e0-33a4-4c48-a1cc-05272851aedf", // totalPayloadBlue
68
+ // kind: 'image-poll',
69
+ id: "8a88f56e-f94a-4ee5-82a4-7496b2798d25",
70
+ // kind: 'image-prediction',
71
+ mode: ({ widget }) =>
72
+ embetWidgets.widgetContainer.attach(widget)
73
+ .then(widget.interactive)
74
+ })
75
+ }
76
+ // function displayWidget() {
77
+ // const embetWidgets = document.querySelector("embet-widgets");
78
+ // const liveSpread = document.createElement("live-spread");
79
+ // liveSpread.kind = "image-poll";
80
+ // liveSpread.widgetPayload = { id: '' };
81
+ // liveSpread.options = [
82
+ // {
83
+ // image_url:
84
+ // "https://cf-blast-storage-qa.livelikecdn.com/assets/65c28c9a-e1fe-437c-add2-3d48be4a56e2.png",
85
+ // description: "Astros",
86
+ // },
87
+ // {
88
+ // description: "Dodgers",
89
+ // image_url:
90
+ // "https://cf-blast-storage-qa.livelikecdn.com/assets/85632f6e-55c7-4704-b5b8-59da18bc3c57.png",
91
+ // },
92
+ // ];
93
+ // liveSpread.question = "Will LA win by 3 or more runs?";
94
+ // liveSpread.customData = {
95
+ // place_bet_url: "#",
96
+ // type: "LIVE SPREAD",
97
+ // sponsors: [
98
+ // {
99
+ // logo_url:
100
+ // "https://cf-blast-storage-qa.livelikecdn.com/assets/0464f0fd-3745-4b17-936c-1e26765652c9.png",
101
+ // name: "LL logo",
102
+ // },
103
+ // ],
104
+ // theme: {
105
+ // widgets: {
106
+ // poll: {
107
+ // header: {
108
+ // background: { format: "fill", color: "#2b4364bf" },
109
+ // },
110
+ // body: {
111
+ // background: { format: "fill", color: "#2b4364bf" },
112
+ // },
113
+ // footer: {
114
+ // background: { format: "fill", color: "#2b4364bf" },
115
+ // },
116
+ // timer: {
117
+ // background: { format: "fill", color: "#1493ff" },
118
+ // },
119
+ // unselectedOption: {
120
+ // borderColor: "#1493ff",
121
+ // },
122
+ // betButton: {
123
+ // background: { format: "fill", color: "#1493ff" },
124
+ // borderColor: "#1493ff",
125
+ // fontColor: "#ffffff",
126
+ // },
127
+ // },
128
+ // },
129
+ // },
130
+ // betDetails: [
131
+ // { bet: "+2.5(-110)", description: "Astros" },
132
+ // { bet: "-2.5(-110)", description: "Dodgers" },
133
+ // ],
134
+ // };
135
+ // embetWidgets.append(liveSpread);
136
+ // }
137
+
138
+ // function displayWidget(optionNum) {
139
+ // // const embetWidgets = document.querySelector("main");
140
+ // // const embetWidgets = document.querySelector("main");
141
+ // // const liveMoneyline = document.createElement("live-moneyline");
142
+ // // const liveMoneyline = document.createElement("live-total");
143
+ // const liveMoneyline = document.createElement("live-spread");
144
+ // // liveMoneyline.kind = "image-prediction";
145
+ // // liveMoneyline.widgetPayload = { id: '' };
146
+
147
+ // const options = [
148
+ // {
149
+ // image_url:
150
+ // "https://cf-blast-storage-qa.livelikecdn.com/assets/65c28c9a-e1fe-437c-add2-3d48be4a56e2.png",
151
+ // description: "Astros",
152
+ // },
153
+ // {
154
+ // description: "Dodgers",
155
+ // image_url:
156
+ // "https://cf-blast-storage-qa.livelikecdn.com/assets/85632f6e-55c7-4704-b5b8-59da18bc3c57.png",
157
+ // },
158
+ // ];
159
+
160
+ // if (optionNum && optionNum > 2) {
161
+ // for (let i = 0; i < optionNum - 2; i++) {
162
+ // options.push({
163
+ // description: "Dodgers" + String(i + 2),
164
+ // image_url:
165
+ // "https://cf-blast-storage-qa.livelikecdn.com/assets/85632f6e-55c7-4704-b5b8-59da18bc3c57.png",
166
+ // })
167
+ // }
168
+ // }
169
+
170
+ // liveMoneyline.options = options;
171
+
172
+ // liveMoneyline.question = "Will LA win by 3 or more runs?";
173
+ // liveMoneyline.customData = {
174
+ // place_bet_url: "#",
175
+ // type: "LIVE SPREAD",
176
+ // // type: "LIVE MONEYLINE",
177
+ // // type: "LIVE TOTAL",
178
+ // // widgetVariation: "inline",
179
+ // sponsors: [
180
+ // {
181
+ // logo_url:
182
+ // "https://cf-blast-storage-qa.livelikecdn.com/assets/0464f0fd-3745-4b17-936c-1e26765652c9.png",
183
+ // name: "LL logo",
184
+ // },
185
+ // ],
186
+ // theme: {
187
+ // widgets: {
188
+ // prediction: {
189
+ // header: {
190
+ // background: { format: "fill", color: "#027658bf" },
191
+ // },
192
+ // body: {
193
+ // background: { format: "fill", color: "#027658bf" },
194
+ // },
195
+ // footer: {
196
+ // background: { format: "fill", color: "#027658bf" },
197
+ // },
198
+ // timer: {
199
+ // background: { format: "fill", color: "#fbd703" },
200
+ // },
201
+ // unselectedOption: {
202
+ // borderColor: "#fbd703",
203
+ // },
204
+ // betButton: {
205
+ // background: { format: "fill", color: "#fbd703" },
206
+ // borderColor: "#fbd703",
207
+ // fontColor: "#000000",
208
+ // },
209
+ // },
210
+ // },
211
+ // },
212
+ // betDetails: [
213
+ // { bet: "+120", description: "Astros" },
214
+ // { bet: "-140", description: "Dodgers" },
215
+ // // { bet: "-180", description: "Dodgers2" },
216
+ // ],
217
+ // }
218
+
219
+ // const livelikeWidgets = document.querySelector('livelike-widgets');
220
+ // document.querySelector('main').append(liveMoneyline);
221
+ // // livelikeWidgets.append(liveMoneyline);
222
+
223
+ // }
224
+
225
+ function displayPreview(optionNum) {
226
+ const options = [
227
+ {
228
+ image_url:
229
+ "https://cf-blast-storage-qa.livelikecdn.com/assets/65c28c9a-e1fe-437c-add2-3d48be4a56e2.png",
230
+ description: "Astros",
231
+ },
232
+ {
233
+ description: "Dodgers",
234
+ image_url:
235
+ "https://cf-blast-storage-qa.livelikecdn.com/assets/85632f6e-55c7-4704-b5b8-59da18bc3c57.png",
236
+ },
237
+ ];
238
+
239
+ if (optionNum && optionNum > 2) {
240
+ for (let i = 0; i < optionNum - 2; i++) {
241
+ options.push({
242
+ description: "Dodgers" + String(i + 2),
243
+ image_url:
244
+ "https://cf-blast-storage-qa.livelikecdn.com/assets/85632f6e-55c7-4704-b5b8-59da18bc3c57.png",
245
+ })
246
+ }
247
+ }
248
+
249
+
250
+
251
+
252
+ const widgetData = {
253
+ options,
254
+ question: "Will LA win by 3 or more runs?",
255
+ customData: {
256
+ place_bet_url: "#",
257
+ type: "LIVE SPREAD",
258
+ // type: "LIVE MONEYLINE",
259
+ // type: "LIVE TOTAL",
260
+ widgetVariation: "inline",
261
+ // widgetVariation: "bar",
262
+ // widgetVariation: "square",
263
+ sponsors: [
264
+ {
265
+ logo_url:
266
+ "https://cf-blast-storage-qa.livelikecdn.com/assets/0464f0fd-3745-4b17-936c-1e26765652c9.png",
267
+ name: "LL logo",
268
+ },
269
+ ],
270
+ // theme: {
271
+ // widgets: {
272
+ // prediction: {
273
+ // // header: {
274
+ // // background: { format: "fill", color: "#027658bf" },
275
+ // // },
276
+ // // body: {
277
+ // // background: { format: "fill", color: "#027658bf" },
278
+ // // },
279
+ // // footer: {
280
+ // // background: { format: "fill", color: "#027658bf" },
281
+ // // },
282
+ // // timer: {
283
+ // // background: { format: "fill", color: "#fbd703" },
284
+ // // },
285
+ // // unselectedOption: {
286
+ // // borderColor: "#fbd703",
287
+ // // },
288
+ // // betButton: {
289
+ // // background: { format: "fill", color: "#fbd703" },
290
+ // // borderColor: "#fbd703",
291
+ // // fontColor: "#000000",
292
+ // // },
293
+ // },
294
+ // },
295
+ // },
296
+ betDetails: [
297
+ { bet: "+120", description: "Astros" },
298
+ { bet: "-140", description: "Dodgers" },
299
+ { bet: "-180", description: "Dodgers2" },
300
+ ]
301
+ }
302
+ }
303
+
304
+ return widgetData;
305
+ // const livelikeWidgets = document.querySelector('livelike-widgets');
306
+ // document.querySelector('main').append(liveMoneyline);
307
+ // livelikeWidgets.append(liveMoneyline);
308
+
309
+ }
310
+
311
+
312
+ embet.init({
313
+ clientId: "pnODbVXg0UI80s0l2aH5Y7FOuGbftoAdSNqpdvo6",
314
+ endpoint: 'https://cf-blast-qa.livelikecdn.com/api/v1/'
315
+ })
316
+ .then((profile) => {
317
+ // embetWidgets.displayWidgetPreview(displayPreview())
318
+ embet.displayWidgetPreview({widgetPayload: displayPreview(3), target: embetWidgets})
319
+ // saveLiveLikeProfile(profile);
320
+ // createBettingWidget();
321
+ // displayWidget();
322
+ // displayWidget();
323
+ // displayWidget(3);
324
+ // displayWidget(4);
325
+ // displayWidget(5);
326
+ // console.log('profile', profile)
327
+ })
328
+
329
+ </script> -->
330
+
331
+ </html>
332
+
package/j.js ADDED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livelike/embet",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "embet sdk",
5
5
  "main": "embet.esm.min.js",
6
6
  "browserslist": [
package/tt.js ADDED
@@ -0,0 +1,8 @@
1
+ import embet from './embet.esm.js';
2
+
3
+ embet.init({
4
+ clientId: "pnODbVXg0UI80s0l2aH5Y7FOuGbftoAdSNqpdvo6",
5
+ endpoint: 'https://cf-blast-qa.livelikecdn.com/api/v1/'
6
+ }).then(profile => {
7
+ console.log('embet initialized');
8
+ })