@everymatrix/casino-lobby 0.0.223 → 0.0.228

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 CHANGED
@@ -23,6 +23,7 @@
23
23
  registerevent="OpenLoginRegisterModal"
24
24
  depositevent="OpenDepositModal"
25
25
  favorites="true"
26
+ activecategory="LOBBY"
26
27
  mostplayed="true"
27
28
  mostplayedrounds="50"
28
29
  lobbyid="casino"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-lobby",
3
- "version": "0.0.223",
3
+ "version": "0.0.228",
4
4
  "main": "dist/casino-lobby.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "5372f53977f5b7ba141b1afe5dc2b85d2c0bc9e7"
39
+ "gitHead": "29054c0e1620b86e700d983b67e48278178a239d"
40
40
  }
@@ -21,7 +21,7 @@
21
21
  export let clientstyling:string = '';
22
22
  export let clientstylingurl:string = '';
23
23
  export let clockformat:string = '';
24
- export let lobbyid:string
24
+ export let lobbyid:string = '';
25
25
 
26
26
  export let loginurl:string = '';
27
27
  export let registerurl:string = '';
@@ -41,6 +41,9 @@
41
41
  export let containermaxwidth:string = '';
42
42
  export let haspanicbutton:string = 'false';
43
43
 
44
+ export let activecategory:string = 'LOBBY';
45
+ export let actionevent:string = '';
46
+
44
47
  let endpointURL:string;
45
48
  let DS:string;
46
49
  let language:string;
@@ -54,14 +57,14 @@
54
57
  let userAgent:string = window.navigator.userAgent;
55
58
  let isLoading:boolean = true;
56
59
 
57
- let headerPlaceholderSize:number = 0;
60
+ let headerPlaceholderSize:string = '0';
58
61
  let scrollReference:HTMLElement;
59
62
  let scrollTop:boolean = false;
60
63
  let customStylingContainer:HTMLElement;
61
64
 
62
65
  setupI18n({ withLocale: 'en', translations: {}});
63
66
 
64
- const messageHandler = (e:any) => {
67
+ const messageHandler = (e:any):void => {
65
68
  if (e.data) {
66
69
  switch(e.data.type) {
67
70
  case 'WidgetTopReference':
@@ -71,7 +74,7 @@
71
74
  if (!headerPlaceholderSize) {
72
75
  scrollReference.scrollIntoView();
73
76
  } else {
74
- window.scrollTo({ top: headerPlaceholderSize });
77
+ window.scrollTo({ top: parseInt(headerPlaceholderSize, 10) });
75
78
  }
76
79
  }
77
80
  break;
@@ -81,14 +84,14 @@
81
84
  playerID = e.data.userID;
82
85
  break;
83
86
 
84
- default:
85
- // do nothing
87
+ case 'CategoryChange':
88
+ activecategory = e.data.item.id;
86
89
  break;
87
90
  }
88
91
  }
89
92
  }
90
93
 
91
- const checkAttrs = () => {
94
+ const checkAttrs = ():boolean => {
92
95
  if (!endpoint) {
93
96
  error = "Endpoint is missing! Please provide a valid endpointURL.";
94
97
  hasErrors = true;
@@ -113,25 +116,22 @@
113
116
  return hasErrors;
114
117
  }
115
118
 
116
- let mostPlayed;
117
- let fav;
119
+ const setActiveLanguage = ():void => {
120
+ setLocale(lang);
121
+ }
118
122
 
119
- const initialSetup = () => {
123
+ const initialSetup = ():void => {
120
124
  checkAttrs();
121
125
 
122
- setLocale(lang);
123
126
  endpointURL = endpoint;
124
127
  DS = datasource;
125
128
  language = lang;
126
- mostPlayed = mostplayed;
127
- fav = favorites;
128
129
 
129
130
  hasErrors = false;
130
-
131
131
  isLoading = false;
132
132
  }
133
133
 
134
- const setSession = () => {
134
+ const setSession = ():void => {
135
135
  checkSession(endpoint, session).then((res:any) => {
136
136
  sessionID = res.Guid;
137
137
  playerID = res.UserID;
@@ -142,23 +142,24 @@
142
142
  });
143
143
  }
144
144
 
145
- const setOpSession = () => {
145
+ const setOpSession = ():void => {
146
146
  isLoggedIn = true;
147
147
  sessionID = opsession;
148
148
  }
149
149
 
150
- const setClientStyling = () => {
150
+ const setClientStyling = ():void => {
151
151
  let sheet = document.createElement('style');
152
152
  sheet.innerHTML = clientstyling;
153
153
  customStylingContainer.appendChild(sheet);
154
154
  }
155
155
 
156
- const setClientStylingURL = () => {
156
+ const setClientStylingURL = ():void => {
157
157
  displayNone = true;
158
158
 
159
+ let url:URL = new URL(clientstylingurl);
159
160
  let cssFile:HTMLElement = document.createElement('style');
160
161
 
161
- fetch(new URL(clientstylingurl))
162
+ fetch(url.href)
162
163
  .then((res:any) => res.text())
163
164
  .then((data:any) => {
164
165
  cssFile.innerHTML = data
@@ -180,6 +181,7 @@
180
181
  }
181
182
  });
182
183
 
184
+ $: lang && setActiveLanguage();
183
185
  $: session && userid && endpoint && setSession();
184
186
  $: endpoint && datasource && lang && mostplayed && favorites && initialSetup();
185
187
  $: opsession && setOpSession();
@@ -188,87 +190,91 @@
188
190
  </script>
189
191
 
190
192
  <div bind:this={customStylingContainer} class={displayNone ? 'DisplayNone' : ''}>
191
- {#if hasErrors}
192
- <p style="color:#fff">{error}</p>
193
- {:else}
194
- <div class="CasinoLobby">
195
- <div class="WidgetsSection">
196
- <div class="HeaderPlaceholder" style="height:{headerPlaceholderSize}px"></div>
197
- <div class="ScrollTop"></div>
198
- <casino-categories-slider
199
- endpoint={endpointURL}
200
- datasource={DS}
201
- lang={language}
202
- session={session}
203
- userid={userid}
204
- mostplayed={mostPlayed}
205
- {mostplayedrounds}
206
- favorites={fav}
207
- {clientstyling}
208
- {clientstylingurl}
209
- {containermaxwidth}
210
- ></casino-categories-slider>
211
- <casino-page
212
- session={session}
213
- userid={userid}
214
- endpoint={endpointURL}
215
- datasource={DS}
216
- lang={language}
217
- visiblegames="10"
218
- {alternativesearch}
219
- favorites={fav}
220
- mostplayed={mostPlayed}
221
- {clientstyling}
222
- {clientstylingurl}
223
- {lobbyid}
224
- {containermaxwidth}
225
- {haspanicbutton}
226
- ></casino-page>
227
- <casino-modal
228
- session={session}
229
- userid={userid}
230
- endpoint={endpointURL}
231
- datasource={DS}
232
- lang={language}
233
- {clientstyling}
234
- {clientstylingurl}
235
- ><casino-game-page
193
+ {#if hasErrors}
194
+ <p style="color:var(--emfe-w-color-white, #FFFFFF)">{error}</p>
195
+ {:else}
196
+ <div class="CasinoLobby">
197
+ <div class="WidgetsSection">
198
+ <div class="HeaderPlaceholder" style="height:{headerPlaceholderSize}px"></div>
199
+ <div class="ScrollTop"></div>
200
+ <casino-categories-slider
201
+ endpoint={endpointURL}
202
+ datasource={DS}
203
+ lang={language}
204
+ session={session}
205
+ userid={userid}
206
+ {actionevent}
207
+ {mostplayed}
208
+ {mostplayedrounds}
209
+ {favorites}
210
+ {activecategory}
211
+ {clientstyling}
212
+ {clientstylingurl}
213
+ {containermaxwidth}
214
+ ></casino-categories-slider>
215
+ <casino-page
236
216
  session={session}
237
217
  userid={userid}
238
218
  endpoint={endpointURL}
239
219
  datasource={DS}
240
220
  lang={language}
241
- loginevent={loginevent}
242
- favorites={fav}
243
- registerevent={registerevent}
244
- depositevent={depositevent}
221
+ visiblegames="10"
222
+ {activecategory}
223
+ {alternativesearch}
224
+ {favorites}
225
+ {mostplayedrounds}
226
+ {mostplayed}
245
227
  {clientstyling}
246
228
  {clientstylingurl}
247
- {clockformat}
229
+ {lobbyid}
230
+ {containermaxwidth}
248
231
  {haspanicbutton}
249
- />
250
- </casino-modal>
251
- <casino-filter-modal
252
- {clientstylingurl}
253
- session={session}
254
- userid={userid}
255
- endpoint={endpointURL}
256
- datasource={DS}
257
- lang={language}
258
- {clientstyling}>
259
- <casino-filter-page
232
+ ></casino-page>
233
+ <casino-modal
260
234
  session={session}
261
235
  userid={userid}
262
236
  endpoint={endpointURL}
263
237
  datasource={DS}
264
238
  lang={language}
239
+ {clientstyling}
265
240
  {clientstylingurl}
241
+ ><casino-game-page
242
+ session={session}
243
+ userid={userid}
244
+ endpoint={endpointURL}
245
+ datasource={DS}
246
+ lang={language}
247
+ loginevent={loginevent}
248
+ registerevent={registerevent}
249
+ depositevent={depositevent}
250
+ {favorites}
251
+ {clientstyling}
252
+ {clientstylingurl}
253
+ {clockformat}
254
+ {haspanicbutton}
255
+ />
256
+ </casino-modal>
257
+ <casino-filter-modal
258
+ {clientstylingurl}
259
+ session={session}
260
+ userid={userid}
261
+ endpoint={endpointURL}
262
+ datasource={DS}
263
+ lang={language}
266
264
  {clientstyling}>
267
- </casino-filter-page>
268
- </casino-filter-modal>
265
+ <casino-filter-page
266
+ session={session}
267
+ userid={userid}
268
+ endpoint={endpointURL}
269
+ datasource={DS}
270
+ lang={language}
271
+ {clientstylingurl}
272
+ {clientstyling}>
273
+ </casino-filter-page>
274
+ </casino-filter-modal>
275
+ </div>
269
276
  </div>
270
- </div>
271
- {/if}
277
+ {/if}
272
278
  </div>
273
279
 
274
280
  <style lang="scss">
@@ -284,7 +290,7 @@
284
290
  }
285
291
 
286
292
  .CasinoLobby {
287
- background-color: #07072A;
293
+ background-color: var(--emfe-w-color-contrast, #07072A);
288
294
  width: 100%;
289
295
  margin: 0 auto;
290
296
  min-height: 100vh;