@everymatrix/casino-header-controller 1.37.2 → 1.37.3

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
@@ -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="false" 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.2",
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": "0a314fe46510038a31ea77b611f22f5429a56d49"
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
 
@@ -203,11 +206,32 @@
203
206
 
204
207
  case 'BalanceModalStatus':
205
208
  isBalanceOpened = e.data.status == 'open';
209
+ adaptDepositBackground(isBalanceOpened);
210
+ break;
211
+
212
+ case 'BalancedFetched':
213
+ setInitialStateForDepositBackground();
206
214
  break;
207
215
  }
208
216
  }
209
217
  }
210
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
+
211
235
  const setSession = (): void => {
212
236
  isLoggedIn = true;
213
237
  sessionID = session;
@@ -386,7 +410,6 @@
386
410
  window.addEventListener('message', messageHandler, false);
387
411
 
388
412
  mobileView = isMobile(userAgent);
389
- console.log('mobileView', mobileView)
390
413
 
391
414
  return () => {
392
415
  window.removeEventListener('message', messageHandler);
@@ -395,7 +418,7 @@
395
418
 
396
419
  $: activecategory && !isLoading && initializeMenu();
397
420
  $: session && setSession();
398
- $: isShortCashierEnabled = shortcashierenabled.toLocaleLowerCase() === 'true';
421
+ $: isShortCashierEnabled = shortcashierenabled.toLocaleLowerCase() == 'true';
399
422
  $: lang && setActiveLanguage();
400
423
  $: cmsendpoint && lang && languageslist && userroles && initialLoad();
401
424
  $: translationurl && setTranslationUrl();
@@ -444,11 +467,10 @@
444
467
  </nav>
445
468
  {#if isLoggedIn}
446
469
  <div class="BalanceDepositWrapper">
447
- <div class="Background {isBalanceOpened ? 'Open' : ''}"></div>
448
- <div class="Balance {isBalanceOpened ? 'Open' : ''}">
470
+ <div class="Balance {isBalanceOpened ? 'Open' : ''}" bind:this={balanceContainer}>
449
471
  <player-account-balance-modal {session} {userid} {endpoint} {lang} {clientstyling} {clientstylingurl} {customlocaleidentifier} {gmversion} {displaybalanceoption} {currencyseparator} {currencydecimal} {currencyprecision} />
450
472
  </div>
451
- <div class="Deposit {isBalanceOpened ? 'Open' : ''}">
473
+ <div class="Deposit {isBalanceOpened ? 'Open' : ''}" bind:this={depositContainer}>
452
474
  <!-- svelte-ignore a11y-click-events-have-key-events -->
453
475
  <div class="DepositButton" on:click={() => menuAction('deposit')}>
454
476
  <p>{$_('deposit')}</p>
@@ -461,8 +483,8 @@
461
483
  <div class="ShortCashierContainerMobile">
462
484
  <div class="ClosePopUpButtonShortCashier" on:click={(event) => closeShortCashier(event)}>
463
485
  <svg width="20" height="20" xmlns="http://www.w3.org/2000/svg">
464
- <line x1="2" y1="2" x2="18" y2="18" stroke="black" stroke-width="2"/>
465
- <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"/>
466
488
  </svg>
467
489
  </div>
468
490
  {#if gmversion === 'gmcore'}
@@ -501,6 +523,7 @@
501
523
  </div>
502
524
  {/if}
503
525
  </div>
526
+ <div class="Background {isBalanceOpened ? 'Open' : ''}" bind:this={backgroundContainer}></div>
504
527
  </div>
505
528
  <div class="Profile">
506
529
  <!-- svelte-ignore a11y-click-events-have-key-events -->
@@ -517,20 +540,19 @@
517
540
  {:else}
518
541
  <div class="AuthButtons">
519
542
  <!-- svelte-ignore a11y-click-events-have-key-events -->
520
- <div class="Item ItemLogin" on:click={()=>menuAction('login')}>
543
+ <div class="Item ItemLogin" on:click={() => menuAction('login')}>
521
544
  <p>{$_('login')}</p>
522
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>
523
546
  </div>
524
547
  <!-- svelte-ignore a11y-click-events-have-key-events -->
525
- <div class="Item ItemRegister" on:click={()=>menuAction('register')}>
548
+ <div class="Item ItemRegister" on:click={() => menuAction('register')}>
526
549
  <p>{$_('register')}</p>
527
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>
528
551
  </div>
529
552
  </div>
530
553
  {/if}
531
554
  <div class="Slot1">
532
- <slot name="slot1">
533
- </slot>
555
+ <slot name="slot1"></slot>
534
556
  </div>
535
557
  <div class="Slot2">
536
558
  <slot name="slot2"></slot>
@@ -1094,26 +1116,19 @@
1094
1116
  height: 34px;
1095
1117
  background-color: white;
1096
1118
  display: flex;
1119
+ position: relative;
1097
1120
  justify-content: center;
1098
1121
  align-items: center;
1099
1122
  border-radius: 30px;
1100
- padding: 0 0 0 10px;
1101
1123
 
1102
1124
  .Background {
1103
1125
  height: 34px;
1104
- width: 80px;
1105
1126
  position: absolute;
1106
- transform: translateX(36%);
1107
1127
  background: linear-gradient(0deg, rgba(35,178,78,1) 0%, rgba(26,205,80,1) 100%) padding-box,
1108
1128
  linear-gradient(180deg, rgba(35,178,78,.2) 0%, rgba(26,205,80,.2) 100%) border-box;
1109
1129
  border-radius: 30px;
1110
1130
  z-index: 3;
1111
- transition: all .3s ease-out;
1112
-
1113
- &.Open {
1114
- width: 75px;
1115
- transform: translateX(-56%);
1116
- }
1131
+ transition: all 0.3s ease;
1117
1132
  }
1118
1133
 
1119
1134
  .Deposit {
@@ -1121,13 +1136,13 @@
1121
1136
  align-items: center;
1122
1137
  cursor: pointer;
1123
1138
  justify-content: center;
1124
- margin: 0 10px;
1125
1139
  z-index: 4;
1126
1140
 
1127
1141
  .DepositButton {
1128
1142
  font-size: 14px;
1129
1143
  text-align: center;
1130
1144
  cursor: pointer;
1145
+ padding: 0 10px;
1131
1146
  transition: all .5s linear;
1132
1147
  display: flex;
1133
1148
  justify-content: center;
@@ -1135,6 +1150,15 @@
1135
1150
  p {
1136
1151
  text-transform: uppercase;
1137
1152
  color: white;
1153
+ transition: all .3s ease;
1154
+
1155
+ &:hover {
1156
+ text-shadow: 0px 1px 5px rgba(0, 0, 0, .2);
1157
+ }
1158
+
1159
+ &:active {
1160
+ color: black;
1161
+ }
1138
1162
  }
1139
1163
  }
1140
1164
 
@@ -1151,7 +1175,11 @@
1151
1175
  }
1152
1176
 
1153
1177
  .Balance {
1178
+ display: flex;
1154
1179
  z-index: 4;
1180
+ height: 100%;
1181
+ padding-left: 10px;
1182
+ align-items: center;
1155
1183
 
1156
1184
  &.Open {
1157
1185
  color: white;
@@ -1163,6 +1191,7 @@
1163
1191
  display: flex;
1164
1192
  justify-content: center;
1165
1193
  flex-direction: column;
1194
+ cursor: pointer;
1166
1195
 
1167
1196
  .ProfileWrapper {
1168
1197
  width: 30px;
@@ -1172,11 +1201,22 @@
1172
1201
  display: flex;
1173
1202
  justify-content: center;
1174
1203
  align-items: center;
1204
+ transition: all .3s ease;
1175
1205
 
1176
1206
  svg {
1177
1207
  width: 15px;
1178
1208
  height: 16px;
1179
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
+ }
1180
1220
  }
1181
1221
  }
1182
1222
  }