@everymatrix/casino-header-controller 1.37.1 → 1.37.3

Sign up to get free protection for your applications and to get access to all the features.
package/index.html CHANGED
@@ -29,14 +29,23 @@
29
29
 
30
30
  <div class="webcomponent">
31
31
  <casino-header-controller
32
- session="df7edc00-c01a-4a98-b215-a0d207d58010" userid="3856617"
32
+ session="31124550-3b07-4687-a92d-55919f1caa41" userid="3856617"
33
33
  userroles="everyone,loggedIn,TestDemoCosmin" cmsendpoint="https://wt1-stage.everymatrix.com/apijson" env="stage"
34
34
  lang="en" languageslist="es,en,ro,pl,bg,hk"
35
- shortcashierenabled="true"
35
+ shortcashierenabled="false"
36
36
  endpoint="https://demo-api.stage.norway.everymatrix.com"
37
- actionevent="HeaderMenuItemClicked" activecategory="/en/casino" clientstyling="
38
- " currencyseparator="." currencydecimal="," currencyprecision="2" gmversion="gmcore"
39
- countryflagheader="true" countryflaghamburger='true'customlocaleidentifier=""></casino-header-controller>
37
+ actionevent="HeaderMenuItemClicked"
38
+ activecategory="/en/casino"
39
+ clientstyling=""
40
+ currencyseparator="."
41
+ currencydecimal=","
42
+ currencyprecision="2"
43
+ gmversion="gmcore"
44
+ countryflagheader="true"
45
+ shortcashierenabled='true'
46
+ countryflaghamburger='true'
47
+ customlocaleidentifier="">
48
+ </casino-header-controller>
40
49
 
41
50
  </div>
42
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-header-controller",
3
- "version": "1.37.1",
3
+ "version": "1.37.3",
4
4
  "main": "dist/casino-header-controller.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "b66537a86537df76760b0975a3104240112ad072"
45
+ "gitHead": "df31cbe8e6b206c5aed27f8036ab50826359872e"
46
46
  }
@@ -58,6 +58,9 @@
58
58
 
59
59
  let activeIndex: number;
60
60
  let customStylingContainer: HTMLElement;
61
+ let balanceContainer: HTMLElement;
62
+ let depositContainer: HTMLElement;
63
+ let backgroundContainer: HTMLElement;
61
64
 
62
65
  setupI18n({ withLocale: 'en', translations: {}});
63
66
 
@@ -97,6 +100,7 @@
97
100
  let hamburgerMenuActive: boolean = false;
98
101
  let logoPath: string = '';
99
102
  let shortCashierActivated: boolean = false;
103
+ let isBalanceOpened: boolean = false;
100
104
 
101
105
  const gtagCall = (eventName: string): void => {
102
106
  // @ts-ignore
@@ -108,8 +112,8 @@
108
112
  }
109
113
  }
110
114
 
111
- const menuAction = (data: any): void => {
112
- switch (data) {
115
+ const menuAction = (type: string, data?: any): void => {
116
+ switch (type) {
113
117
  case 'login':
114
118
  window.postMessage({ type: 'OpenLoginRegisterModal', transition: 'Login' }, window.location.href);
115
119
 
@@ -148,6 +152,10 @@
148
152
  case 'language':
149
153
  window.postMessage({ type: 'LanguageChanged', selectedLanguage }, window.location.href);
150
154
  break;
155
+
156
+ case 'page':
157
+ window.postMessage({ type: 'NavigateTo', item: data, path: data.path });
158
+ break;
151
159
  }
152
160
  }
153
161
 
@@ -177,6 +185,9 @@
177
185
  break;
178
186
 
179
187
  case 'LanguageChanged':
188
+ if (e.data.selectedLanguage.toLowerCase() != lang) {
189
+ primaryMenuLoading = true;
190
+ }
180
191
  createCMSUrls();
181
192
  getHeaderMenusData(headerURL);
182
193
  break;
@@ -192,10 +203,35 @@
192
203
  case 'RequestHeaderHeight':
193
204
  window.postMessage({ type: 'HeaderHeight', headerHeight: customStylingContainer.clientHeight }, window.location.href);
194
205
  break;
206
+
207
+ case 'BalanceModalStatus':
208
+ isBalanceOpened = e.data.status == 'open';
209
+ adaptDepositBackground(isBalanceOpened);
210
+ break;
211
+
212
+ case 'BalancedFetched':
213
+ setInitialStateForDepositBackground();
214
+ break;
195
215
  }
196
216
  }
197
217
  }
198
218
 
219
+ const setInitialStateForDepositBackground = (): void => {
220
+ let width = depositContainer.getBoundingClientRect().width;
221
+ backgroundContainer.style.width = `${width}px`;
222
+ backgroundContainer.style.left = `${balanceContainer.getBoundingClientRect().width}px`;
223
+ }
224
+
225
+ const adaptDepositBackground = (isBalanceOpened): void => {
226
+ if (isBalanceOpened) {
227
+ let width = balanceContainer.getBoundingClientRect().width;
228
+ backgroundContainer.style.width = `${width}px`;
229
+ backgroundContainer.style.left = `0px`;
230
+ } else {
231
+ setInitialStateForDepositBackground();
232
+ }
233
+ }
234
+
199
235
  const setSession = (): void => {
200
236
  isLoggedIn = true;
201
237
  sessionID = session;
@@ -374,7 +410,6 @@
374
410
  window.addEventListener('message', messageHandler, false);
375
411
 
376
412
  mobileView = isMobile(userAgent);
377
- console.log('mobileView', mobileView)
378
413
 
379
414
  return () => {
380
415
  window.removeEventListener('message', messageHandler);
@@ -383,7 +418,7 @@
383
418
 
384
419
  $: activecategory && !isLoading && initializeMenu();
385
420
  $: session && setSession();
386
- $: isShortCashierEnabled = shortcashierenabled.toLocaleLowerCase() === 'true';
421
+ $: isShortCashierEnabled = shortcashierenabled.toLocaleLowerCase() == 'true';
387
422
  $: lang && setActiveLanguage();
388
423
  $: cmsendpoint && lang && languageslist && userroles && initialLoad();
389
424
  $: translationurl && setTranslationUrl();
@@ -421,7 +456,8 @@
421
456
  {/each}
422
457
  {:else}
423
458
  {#each mainMenuArray as menuItem}
424
- <div class="ItemMenu {menuItem.id == activeIndex ? 'Active' : ''}">
459
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
460
+ <div class="ItemMenu {menuItem.id == activeIndex ? 'Active' : ''}" on:click={() => menuAction('page', menuItem)}>
425
461
  <p>{menuItem.label}</p>
426
462
  <div class="MenuHover"></div>
427
463
  </div>
@@ -431,12 +467,13 @@
431
467
  </nav>
432
468
  {#if isLoggedIn}
433
469
  <div class="BalanceDepositWrapper">
434
- <div class="Balance">
470
+ <div class="Balance {isBalanceOpened ? 'Open' : ''}" bind:this={balanceContainer}>
435
471
  <player-account-balance-modal {session} {userid} {endpoint} {lang} {clientstyling} {clientstylingurl} {customlocaleidentifier} {gmversion} {displaybalanceoption} {currencyseparator} {currencydecimal} {currencyprecision} />
436
472
  </div>
437
- <div class="Deposit">
438
- <div class="DepositButton">
439
- <p>Deposit</p>
473
+ <div class="Deposit {isBalanceOpened ? 'Open' : ''}" bind:this={depositContainer}>
474
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
475
+ <div class="DepositButton" on:click={() => menuAction('deposit')}>
476
+ <p>{$_('deposit')}</p>
440
477
  </div>
441
478
  {#if shortCashierActivated}
442
479
  <!-- svelte-ignore a11y-click-events-have-key-events -->
@@ -446,8 +483,8 @@
446
483
  <div class="ShortCashierContainerMobile">
447
484
  <div class="ClosePopUpButtonShortCashier" on:click={(event) => closeShortCashier(event)}>
448
485
  <svg width="20" height="20" xmlns="http://www.w3.org/2000/svg">
449
- <line x1="2" y1="2" x2="18" y2="18" stroke="black" stroke-width="2"/>
450
- <line x1="18" y1="2" x2="2" y2="18" stroke="black" stroke-width="2"/>
486
+ <line x1="2" y1="2" x2="18" y2="18" stroke-width="2"/>
487
+ <line x1="18" y1="2" x2="2" y2="18" stroke-width="2"/>
451
488
  </svg>
452
489
  </div>
453
490
  {#if gmversion === 'gmcore'}
@@ -486,6 +523,7 @@
486
523
  </div>
487
524
  {/if}
488
525
  </div>
526
+ <div class="Background {isBalanceOpened ? 'Open' : ''}" bind:this={backgroundContainer}></div>
489
527
  </div>
490
528
  <div class="Profile">
491
529
  <!-- svelte-ignore a11y-click-events-have-key-events -->
@@ -502,20 +540,19 @@
502
540
  {:else}
503
541
  <div class="AuthButtons">
504
542
  <!-- svelte-ignore a11y-click-events-have-key-events -->
505
- <div class="Item ItemLogin" on:click={()=>menuAction('login')}>
543
+ <div class="Item ItemLogin" on:click={() => menuAction('login')}>
506
544
  <p>{$_('login')}</p>
507
545
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M144 144v48H304V144c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192V144C80 64.5 144.5 0 224 0s144 64.5 144 144v48h16c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V256c0-35.3 28.7-64 64-64H80z"/></svg>
508
546
  </div>
509
547
  <!-- svelte-ignore a11y-click-events-have-key-events -->
510
- <div class="Item ItemRegister" on:click={()=>menuAction('register')}>
548
+ <div class="Item ItemRegister" on:click={() => menuAction('register')}>
511
549
  <p>{$_('register')}</p>
512
550
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/></svg>
513
551
  </div>
514
552
  </div>
515
553
  {/if}
516
554
  <div class="Slot1">
517
- <slot name="slot1">
518
- </slot>
555
+ <slot name="slot1"></slot>
519
556
  </div>
520
557
  <div class="Slot2">
521
558
  <slot name="slot2"></slot>
@@ -526,36 +563,34 @@
526
563
  {#if !mobileView}
527
564
  <div class="LanguageSelector">
528
565
  {#if (languagesArray.length > 1) }
529
- {#if countryflagheader !== 'true'}
530
- <select bind:value={selectedLanguage} class="Item ItemLanguage NoFlag" on:change={()=>menuAction('language')}>
531
- {#each languagesArray as operatorLanguage}
532
- <option value={operatorLanguage} selected>{operatorLanguage.slice(-2)}</option>
533
- {/each}
534
- </select>
535
- {:else}
536
- <div class="LanguageDropdown">
537
- <!-- svelte-ignore a11y-click-events-have-key-events -->
538
- <div class="SelectedOption" on:click={() => toggleLanguageDropdown()}>
566
+ <div class="LanguageDropdown">
567
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
568
+ <div class="SelectedOption" on:click={() => toggleLanguageDropdown()}>
569
+ {#if countryflagheader == 'true' }
539
570
  <span class="LanguageName">{@html countryFlags[determineFlag()]}</span>
540
- <span class=" {isOptionsListVisible ? 'TriangleActive' : 'TriangleInactive'}">
541
- <svg xmlns="http://www.w3.org/2000/svg" width="14" height="6.835" viewBox="0 0 14 6.835">
542
- <path id="arrow" d="M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z" transform="translate(-274.511 -441.088)" fill="#d1d1d1"/>
543
- </svg>
544
- </span>
545
- </div>
571
+ {:else}
572
+ <span class="LanguageName">{determineFlag()}</span>
573
+ {/if}
574
+ <span class=" {isOptionsListVisible ? 'TriangleActive' : 'TriangleInactive'}">
575
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="6.835" viewBox="0 0 14 6.835">
576
+ <path id="arrow" d="M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z" transform="translate(-274.511 -441.088)" fill="#d1d1d1"/>
577
+ </svg>
578
+ </span>
546
579
  </div>
547
- <div class="OptionList {isOptionsListVisible ? 'Active' : ''}">
548
- {#each languagesArray as operatorLanguage}
549
- <!-- svelte-ignore a11y-click-events-have-key-events -->
550
- <div class="LanguageOption" on:click={() => selectLanguage(operatorLanguage)}>
580
+ </div>
581
+ <div class="OptionList {isOptionsListVisible ? 'Active' : ''}">
582
+ {#each languagesArray as operatorLanguage}
583
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
584
+ <div class="LanguageOption" on:click={() => selectLanguage(operatorLanguage)}>
585
+ {#if countryflagheader == 'true' }
551
586
  <span class="FlagIcon">
552
587
  {@html countryFlags[determineFlag(operatorLanguage)]}
553
588
  </span>
554
- <span class="LanguageName">{operatorLanguage.slice(-2)}</span>
555
- </div>
556
- {/each}
557
- </div>
558
- {/if}
589
+ {/if}
590
+ <span class="LanguageName">{operatorLanguage.slice(-2)}</span>
591
+ </div>
592
+ {/each}
593
+ </div>
559
594
  {/if}
560
595
  </div>
561
596
  {/if}
@@ -902,7 +937,7 @@
902
937
  {/if}
903
938
  -->
904
939
 
905
- <casino-hamburger-menu menuitemsurl={hamburgerURL} {activecategory} {lang} {countryflaghamburger} {customlocaleidentifier} {languageslist} {clientstyling} {clientstylingurl}></casino-hamburger-menu>
940
+ <casino-hamburger-menu {cmsendpoint} {cmsenv} {userroles} {activecategory} {lang} {countryflaghamburger} {customlocaleidentifier} {languageslist} {clientstyling} {clientstylingurl}></casino-hamburger-menu>
906
941
 
907
942
  <style lang="scss">
908
943
  *,
@@ -963,10 +998,6 @@
963
998
  top: 18px;
964
999
  }
965
1000
 
966
- &.Open {
967
- // animation: growWidth 1s forwards;
968
- }
969
-
970
1001
  &.Open span:nth-child(1) {
971
1002
  top: 9px;
972
1003
  width: 100%;
@@ -990,18 +1021,37 @@
990
1021
  }
991
1022
  }
992
1023
 
993
-
994
-
995
1024
  .Skeleton {
996
- animation: skeleton-loading 1s linear infinite alternate;
1025
+ animation: skeleton-loading .6s linear infinite alternate;
997
1026
  }
998
1027
 
999
1028
  @keyframes skeleton-loading {
1000
1029
  0% {
1001
- background-color: hsl(192, 2%, 45%);
1030
+ background: linear-gradient(90deg, rgba(35, 178, 78, .2) 0%, rgba(0, 61, 93, .2) 100%);
1031
+ }
1032
+ 12% {
1033
+ background: linear-gradient(90deg, rgba(35, 178, 78, .225) 0%, rgba(0, 61, 93, .225) 100%);
1034
+ }
1035
+ 25% {
1036
+ background: linear-gradient(90deg, rgba(35, 178, 78, .25) 0%, rgba(0, 61, 93, .25) 100%);
1037
+ }
1038
+ 33% {
1039
+ background: linear-gradient(90deg, rgba(35, 178, 78, .275) 0%, rgba(0, 61, 93, .275) 100%);
1040
+ }
1041
+ 50% {
1042
+ background: linear-gradient(90deg, rgba(35, 178, 78, .3) 0%, rgba(0, 61, 93, .3) 100%);
1043
+ }
1044
+ 63% {
1045
+ background: linear-gradient(90deg, rgba(35, 178, 78, .325) 0%, rgba(0, 61, 93, .325) 100%);
1046
+ }
1047
+ 75% {
1048
+ background: linear-gradient(90deg, rgba(35, 178, 78, .35) 0%, rgba(0, 61, 93, .35) 100%);
1049
+ }
1050
+ 88% {
1051
+ background: linear-gradient(90deg, rgba(35, 178, 78, .375) 0%, rgba(0, 61, 93, .375) 100%);
1002
1052
  }
1003
1053
  100% {
1004
- background-color: hsl(200, 20%, 95%);
1054
+ background: linear-gradient(90deg, rgba(35, 178, 78, .4) 0%, rgba(0, 61, 93, .4) 100%);
1005
1055
  }
1006
1056
  }
1007
1057
 
@@ -1016,6 +1066,7 @@
1016
1066
  .HeaderContainer {
1017
1067
  position: fixed;
1018
1068
  width: 100%;
1069
+ z-index: 999;
1019
1070
  background-color: var(--emw-header-color-background, var(--emw-color-background, #000000));
1020
1071
  display: flex;
1021
1072
  flex-direction: column;
@@ -1065,26 +1116,33 @@
1065
1116
  height: 34px;
1066
1117
  background-color: white;
1067
1118
  display: flex;
1119
+ position: relative;
1068
1120
  justify-content: center;
1069
1121
  align-items: center;
1070
1122
  border-radius: 30px;
1071
- padding: 0 0 0 10px;
1123
+
1124
+ .Background {
1125
+ height: 34px;
1126
+ position: absolute;
1127
+ background: linear-gradient(0deg, rgba(35,178,78,1) 0%, rgba(26,205,80,1) 100%) padding-box,
1128
+ linear-gradient(180deg, rgba(35,178,78,.2) 0%, rgba(26,205,80,.2) 100%) border-box;
1129
+ border-radius: 30px;
1130
+ z-index: 3;
1131
+ transition: all 0.3s ease;
1132
+ }
1072
1133
 
1073
1134
  .Deposit {
1074
1135
  display: flex;
1075
1136
  align-items: center;
1076
1137
  cursor: pointer;
1077
1138
  justify-content: center;
1139
+ z-index: 4;
1078
1140
 
1079
1141
  .DepositButton {
1080
- border-radius: 30px;
1081
- height: 34px;
1082
- width: 100px;
1083
- background: linear-gradient(0deg, rgba(35,178,78,1) 0%, rgba(26,205,80,1) 100%) padding-box,
1084
- linear-gradient(180deg, rgba(35,178,78,.2) 0%, rgba(26,205,80,.2) 100%) border-box;
1085
1142
  font-size: 14px;
1086
1143
  text-align: center;
1087
1144
  cursor: pointer;
1145
+ padding: 0 10px;
1088
1146
  transition: all .5s linear;
1089
1147
  display: flex;
1090
1148
  justify-content: center;
@@ -1092,21 +1150,40 @@
1092
1150
  p {
1093
1151
  text-transform: uppercase;
1094
1152
  color: white;
1095
- }
1153
+ transition: all .3s ease;
1096
1154
 
1097
- &:hover {
1098
- background: linear-gradient(180deg, rgba(35,178,78,1) 0%, rgba(26,205,80,1) 100%) padding-box,
1099
- linear-gradient(0deg, rgba(35,178,78,.2) 0%, rgba(26,205,80,.2) 100%) border-box;
1155
+ &:hover {
1156
+ text-shadow: 0px 1px 5px rgba(0, 0, 0, .2);
1157
+ }
1158
+
1159
+ &:active {
1160
+ color: black;
1161
+ }
1100
1162
  }
1163
+ }
1101
1164
 
1102
- &:active {
1103
- background: linear-gradient(0deg, rgba(35,178,78,1) 0%, rgba(26,205,80,1) 100%) padding-box,
1104
- linear-gradient(180deg, rgba(35,178,78,.2) 0%, rgba(26,205,80,.2) 100%) border-box;
1165
+ &.Open {
1166
+ .DepositButton {
1167
+ p {
1168
+ transition: all .5s linear;
1169
+ color: black;
1170
+ opacity: .5;
1171
+ }
1105
1172
  }
1173
+
1106
1174
  }
1107
1175
  }
1108
1176
 
1109
1177
  .Balance {
1178
+ display: flex;
1179
+ z-index: 4;
1180
+ height: 100%;
1181
+ padding-left: 10px;
1182
+ align-items: center;
1183
+
1184
+ &.Open {
1185
+ color: white;
1186
+ }
1110
1187
  }
1111
1188
  }
1112
1189
 
@@ -1114,6 +1191,7 @@
1114
1191
  display: flex;
1115
1192
  justify-content: center;
1116
1193
  flex-direction: column;
1194
+ cursor: pointer;
1117
1195
 
1118
1196
  .ProfileWrapper {
1119
1197
  width: 30px;
@@ -1123,11 +1201,22 @@
1123
1201
  display: flex;
1124
1202
  justify-content: center;
1125
1203
  align-items: center;
1204
+ transition: all .3s ease;
1126
1205
 
1127
1206
  svg {
1128
1207
  width: 15px;
1129
1208
  height: 16px;
1130
1209
  fill: var(--emw-color-white, #FFFFFF)
1210
+
1211
+ }
1212
+ &:hover {
1213
+ box-shadow: 0px 0px 4px white;
1214
+ }
1215
+
1216
+ &:active {
1217
+ svg {
1218
+ fill: var(--emw-color-black, #000000)
1219
+ }
1131
1220
  }
1132
1221
  }
1133
1222
  }
@@ -1268,6 +1357,7 @@
1268
1357
  height: 100%;
1269
1358
  cursor: pointer;
1270
1359
  transform: all .3s linear;
1360
+ color: white;
1271
1361
 
1272
1362
  .SelectedOption {
1273
1363
  display: flex;
@@ -1276,7 +1366,6 @@
1276
1366
 
1277
1367
  .TriangleActive, .TriangleInactive {
1278
1368
  display: block;
1279
- color: currentColor;
1280
1369
  margin: 0 0 0 10px;
1281
1370
  transition: all .2s;
1282
1371
  &:hover {
@@ -1323,7 +1412,7 @@
1323
1412
  z-index: 6;
1324
1413
  right: 5px;
1325
1414
  color: var(--emw-header-typography, var(--emw-color-white, #FFFFFF));
1326
- background: var(--emw-header-color-secondary-menu-bg, var(--emw-color-background-secondary, #050518));
1415
+ background: linear-gradient(90deg, rgba(42,79,55,1) 0%, rgba(0,61,92,1) 100%);
1327
1416
 
1328
1417
  &.Active {
1329
1418
  opacity: 1;
@@ -1342,14 +1431,15 @@
1342
1431
  align-items: center;
1343
1432
  transform: scale(1.1);
1344
1433
  gap: 3px;
1345
- background: black;
1346
1434
  padding: 7px;
1347
1435
 
1348
1436
  &:hover {
1349
- transition: all .5s;
1350
- color: black;
1351
- background-color: var(--emw-header-color-primary, var(--emw-color-primary, #22B04F));
1437
+ transition: all 0.2s;
1438
+ color: var(--emw-color-primary);
1439
+ background: var(--emw-color-primary) transparent;
1440
+ box-shadow: inset 0px 0px 0px 2px var(--emw-color-primary);
1352
1441
  border-radius: 20px;
1442
+ box-sizing: border-box;
1353
1443
  }
1354
1444
  }
1355
1445
  }