@everymatrix/casino-random-game 0.0.272 → 0.0.275

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
@@ -32,7 +32,7 @@
32
32
  <div class="webcomponent">
33
33
  <casino-random-game
34
34
  endpoint="https://demo-api.stage.norway.everymatrix.com/v1"
35
- datasource="RNG"
35
+ datasource="livecasino"
36
36
  gameevent="ShowGameModal"
37
37
  ></casino-random-game>
38
38
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-random-game",
3
- "version": "0.0.272",
3
+ "version": "0.0.275",
4
4
  "main": "dist/casino-random-game.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": "2251ff7ad156e5d687da1a0ce2f71e526ca4eac5"
39
+ "gitHead": "6b4c5e75ec17a99271b51d6cd70f107340dd5dab"
40
40
  }
@@ -20,13 +20,14 @@
20
20
 
21
21
  let userAgent:string = window.navigator.userAgent;
22
22
 
23
- // setupI18n({ withLocale: 'en', translations: {}});
23
+ setupI18n({ withLocale: 'en', translations: {}});
24
24
 
25
25
  Object.keys(CasinoRandomGameTranslations).forEach((item:any) => {
26
26
  addNewMessages(item, CasinoRandomGameTranslations[item]);
27
27
  });
28
28
 
29
29
  const getRandomGame = ():void => {
30
+ gamesToShow = shuffle(gamesToShow);
30
31
  offset = 0;
31
32
  count = 0;
32
33
  slotDone = false;
@@ -44,8 +45,21 @@
44
45
  }, 100);
45
46
  }
46
47
 
48
+ const shuffle = (array):Array<any> => {
49
+ let currentIndex = array.length, randomIndex;
50
+
51
+ while (currentIndex != 0) {
52
+ randomIndex = Math.floor(Math.random() * currentIndex);
53
+ currentIndex--;
54
+
55
+ [array[currentIndex], array[randomIndex]] = [array[randomIndex], array[currentIndex]];
56
+ }
57
+
58
+ return array;
59
+ }
60
+
47
61
  const playGame = ():void => {
48
- window.postMessage({ type: gameevent, gameId: randomGame.gId }, window.location.href);
62
+ window.postMessage({ type: gameevent, gameId: randomGame.gId || randomGame.id }, window.location.href);
49
63
  show = false;
50
64
  }
51
65
 
@@ -58,7 +72,7 @@
58
72
 
59
73
  url.searchParams.append('platform', getDevice(userAgent));
60
74
  url.searchParams.append('datasource', datasource);
61
- url.searchParams.append('fields', 'gId,href,thumbnail,name,vendor')
75
+ url.searchParams.append('fields', 'gId,id,href,thumbnail,name,vendor')
62
76
  url.searchParams.append('expand', 'vendor');
63
77
  url.searchParams.append('pagination', 'offset=0,limit=1000');
64
78
 
@@ -67,15 +81,15 @@
67
81
  .then((data:any) => {
68
82
  games = data.items;
69
83
  gamesToShow = games.slice(0, 19);
70
- })
84
+ });
71
85
  }
72
86
 
73
- const initialLoad = () => {
87
+ const setActiveLanguage = () => {
74
88
  setLocale(lang);
75
89
  }
76
90
 
77
- $: lang && initialLoad();
78
- $:endpoint && datasource && fetchGameList();
91
+ $: lang && setActiveLanguage();
92
+ $: endpoint && datasource && fetchGameList();
79
93
  </script>
80
94
 
81
95
  <div part="CustomStylingContainer">
@@ -236,6 +250,8 @@
236
250
  gap: 5px;
237
251
  transition: transform 0.3s ease-in-out;
238
252
  transform: translateY(0px);
253
+ -webkit-transform-style: preserve-3d;
254
+ -webkit-backface-visibility: hidden;
239
255
  }
240
256
 
241
257
  .RandomGameLoading {
@@ -246,6 +262,8 @@
246
262
  width: 256px;
247
263
  height: 170px;
248
264
  border-radius: 5px;
265
+ -webkit-transform-style: preserve-3d;
266
+ -webkit-backface-visibility: hidden;
249
267
  }
250
268
 
251
269
  .RandomTryAgain {
@@ -268,6 +286,7 @@
268
286
 
269
287
  .item {
270
288
  position: relative;
289
+ -webkit-backface-visibility: hidden;
271
290
  }
272
291
 
273
292
  .RandomGameDetails {