@everymatrix/casino-games-category-section 0.0.258 → 0.0.261

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-games-category-section",
3
- "version": "0.0.258",
3
+ "version": "0.0.261",
4
4
  "main": "dist/casino-games-category-section.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": "29d9cee256c6fbdf17d95ed82bc3ebcc62241704"
39
+ "gitHead": "a93c0ae8104c039af7d54949a0889c11bca83acb"
40
40
  }
@@ -65,12 +65,8 @@
65
65
  let favoriteGames:Array<Object>;
66
66
  let showFavGamesCategory:boolean = false;
67
67
  let receivedFavoriteResults:Object;
68
- let activeCategory:String;
69
- let operatorConfig:any = window.widgetConfig;
70
- let favoredGamesCollection:Array<string> = [];
71
68
  let sessionId:string = '';
72
69
  let userId:string = '';
73
- let getFavoredGamesCache:any = undefined;
74
70
  let mostPlayedScreen:Boolean = false;
75
71
  let customStylingContainer:HTMLElement;
76
72
  let validObservers:boolean = false;
@@ -105,7 +101,7 @@
105
101
  }
106
102
 
107
103
  // IntersectionObserver used for loading more games
108
- let observer = new IntersectionObserver((entries, observerRef) => {
104
+ let observer = new IntersectionObserver((entries) => {
109
105
  entries.forEach(async (entry) => {
110
106
  let gameid = entry.target.gameid; // eslint-disable-line
111
107
  let index = entry.target.elems_index; // eslint-disable-line
@@ -336,8 +332,7 @@
336
332
  case 'UpdateCategoryFavoriteGames':
337
333
  if (e.data.receivedFavoriteResults) {
338
334
  favoriteGames = e.data.receivedFavoriteResults.items;
339
-
340
- if (e.data.triggerFactor && !showFavGamesCategory) {
335
+ if (!showFavGamesCategory) {
341
336
  window.postMessage({ type: 'FavoriteUpdate' }, window.location.href);
342
337
  } else if (!lobbyView && !mostPlayedScreen) {
343
338
  window.postMessage({ type: 'CategoryUpdate', itemId: categoryid }, window.location.href);
@@ -383,7 +378,7 @@
383
378
  }
384
379
  }
385
380
  }
386
-
381
+
387
382
  // @TODO categoryId type fix
388
383
  const loadMoreGames = (categoryId:any) => {
389
384
  limit += 1;
@@ -400,15 +395,6 @@
400
395
  }
401
396
  }
402
397
 
403
- // construct favorite array used to check if game id is not already present in fav list
404
- const getGamesIds = (favoritesArray:any) => {
405
- favoredGamesCollection = [];
406
- favoritesArray.items.forEach((fav:any) => {
407
- favoredGamesCollection.push(fav.id);
408
- });
409
- return favoredGamesCollection;
410
- }
411
-
412
398
  const checkFavorite = (gameId:string) => {
413
399
  if (favoriteGames) {
414
400
  if (favoriteGames.findIndex(obj => obj.id == gameId) !== -1) {
@@ -471,18 +457,14 @@
471
457
  }
472
458
  }
473
459
 
474
- // const setupVisibility = (customStylingContainer, dataloaded) => {
475
- // if (customStylingContainer && dataloaded && hidden) {
476
- // document.addEventListener(visibilityChange, handleVisibilityChange, false);
477
- // }
478
- // }
479
-
480
460
  onMount(() => {
461
+ window.addEventListener('visibilitychange', (e) => handleVisibilityChange())
481
462
  window.addEventListener('message', messageHandler, false);
482
463
  window.postMessage({ type: 'GetFavoredGame' }, window.location.href);
483
464
 
484
465
  return () => {
485
466
  window.removeEventListener('message', messageHandler);
467
+ window.removeEventListener('visibilitychange', messageHandler);
486
468
  }
487
469
  });
488
470
 
@@ -714,13 +696,6 @@
714
696
 
715
697
 
716
698
  <style lang="scss">
717
- //This function does a multiplication
718
- // in order to work with px the
719
- // same way as working with em
720
- @function ttp($value) {
721
- $multiplicator: 16px;
722
- @return $value * $multiplicator;
723
- }
724
699
 
725
700
  :host {
726
701
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
@@ -732,8 +707,8 @@
732
707
  box-sizing: border-box;
733
708
  }
734
709
 
735
- $grid-gap: ttp(1);
736
- $grid-cell-size: ttp(12);
710
+ $grid-gap: 16px;
711
+ $grid-cell-size: 192px;
737
712
 
738
713
  .CategoryName,
739
714
  .StatusText {
@@ -752,11 +727,11 @@
752
727
  text-align: center;
753
728
  width: 100%;
754
729
  padding-left: 5px;
755
- font-size: ttp(1);
730
+ font-size: 16px;
756
731
  }
757
732
 
758
733
  .NoRecentSearches {
759
- padding-bottom: ttp(1.875);
734
+ padding-bottom: 30px;
760
735
  }
761
736
 
762
737
  .NoRecentSearchesCenter {
@@ -765,7 +740,7 @@
765
740
 
766
741
  .NoFavoriteGames {
767
742
  color: var(--emfe-w-color-white, #FFFFFF);
768
- font-size: ttp(1);
743
+ font-size: 16px;
769
744
  display: flex;
770
745
  flex-direction: column;
771
746
  align-items: center;
@@ -793,7 +768,7 @@
793
768
  .SearchWaiting {
794
769
  grid-column: 1/-1;
795
770
  color: var(--emfe-w-color-white, #FFFFFF);
796
- font-size: ttp(.8);
771
+ font-size: 13px;
797
772
  text-align: center;
798
773
  }
799
774
 
@@ -802,8 +777,8 @@
802
777
  display: flex;
803
778
  align-items: center;
804
779
  justify-content: space-between;
805
- padding: ttp(0.5) ttp(0.3125) 0;
806
- margin-bottom: ttp(1);
780
+ padding: 8px 5px 0;
781
+ margin-bottom: 16px;
807
782
  .CategoryNameLink {
808
783
  display: block;
809
784
  cursor: pointer;
@@ -820,8 +795,8 @@
820
795
 
821
796
  .CasinoGamesContainer {
822
797
  width: 100%;
823
- margin-top: ttp(1.5);
824
- padding-bottom: ttp(1);
798
+ margin-top: 24px;
799
+ padding-bottom: 16px;
825
800
  }
826
801
 
827
802
  .CasinoGamesGrid {