@everymatrix/casino-page 0.0.290 → 0.0.293

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-page",
3
- "version": "0.0.290",
3
+ "version": "0.0.293",
4
4
  "main": "dist/casino-page.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": "88cef54931a3357b0ae9a20f4fa09091e1f8bb73"
39
+ "gitHead": "5b7aee827d2cbc67a99e15775c630c6f9ddfbf43"
40
40
  }
@@ -708,10 +708,6 @@
708
708
  }
709
709
  }
710
710
 
711
- const panicAction = ():void => {
712
- window.postMessage({type: 'PanicButtonClicked'}, window.location.href);
713
- }
714
-
715
711
  //
716
712
  // --- END of communication with other widgets
717
713
  //
@@ -855,6 +851,7 @@
855
851
  panicLoading = true;
856
852
 
857
853
  if (timer >= 3) {
854
+ window.postMessage({type: 'PanicButtonClicked'}, window.location.href);
858
855
  clearInterval(timerInterval)
859
856
  }
860
857
  }, 1000);
@@ -867,28 +864,34 @@
867
864
  clearInterval(timerInterval);
868
865
  }
869
866
 
870
- onMount(() => {
871
- window.addEventListener('scroll', scrollHandler, false);
872
- window.addEventListener('message', messageHandler, false);
873
- console.log("button here casino page ", panicButton);
867
+ const addEventsToDisplayedElements = () => {
874
868
  panicButton?.addEventListener("mousedown", startInterval, false);
875
- panicButton?.addEventListener('touchstart', startInterval, false)
869
+ panicButton?.addEventListener('touchstart', startInterval, false);
876
870
 
877
871
  // on mouseup stop interval count
878
872
  panicButton?.addEventListener("mouseup", endInterval, false);
879
873
  panicButton?.addEventListener("touchend", endInterval, false);
874
+ }
875
+
876
+ const removeEventsToDisplayedElements = ():void => {
877
+ panicLoading = false;
878
+ panicButton?.removeEventListener("mousedown", startInterval);
879
+ panicButton?.removeEventListener('touchstart', startInterval);
880
+
881
+ // on mouseup stop interval count
882
+ panicButton?.removeEventListener("mouseup", endInterval);
883
+ panicButton?.removeEventListener("touchend", endInterval);
884
+ }
885
+
886
+ onMount(() => {
887
+ window.addEventListener('scroll', scrollHandler, false);
888
+ window.addEventListener('message', messageHandler, false);
880
889
 
881
890
  return () => {
882
891
  window.removeEventListener('scroll', scrollHandler);
883
892
  window.removeEventListener('message', messageHandler);
884
893
 
885
- panicButton?.removeEventListener("mousedown", startInterval);
886
- panicButton?.removeEventListener('touchstart', startInterval)
887
-
888
- // on mouseup stop interval count
889
- panicButton?.removeEventListener("mouseup", endInterval);
890
- panicButton?.removeEventListener("touchend", endInterval);
891
-
894
+ removeEventsToDisplayedElements();
892
895
  }
893
896
  });
894
897
 
@@ -898,6 +901,7 @@
898
901
  $: lang && updateCategoriesLanguage();
899
902
  $: clientstyling && setClientStyling();
900
903
  $: clientstylingurl && setClientStylingURL();
904
+ $: panicButton && addEventsToDisplayedElements();
901
905
  </script>
902
906
 
903
907
  {#if hasErrors}
@@ -1145,13 +1149,9 @@
1145
1149
  {/if}
1146
1150
  {/if}
1147
1151
  {/if}
1148
- {#if isLoggedIn && haspanicbutton === "true"}
1152
+ {#if isLoggedIn && haspanicbutton == "true"}
1149
1153
  <div class="PanicSection {(getDevice(userAgent) !== 'PC') ? 'PanicSectionMobile' : ''}" part="PanicSection {(getDevice(userAgent) !== 'PC') ? 'PanicSectionMobile' : ''}">
1150
- <div class="PanicText" part="PanicText">
1151
- <svg class="w-1 h-1" part="w-1 h-1" fill="none" stroke="white" width="34px" height="34px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
1152
- <p>{$_('casinoPage.break')}</p>
1153
- </div>
1154
- <button class="PanicButton {(getDevice(userAgent) !== 'PC') ? 'PanicButtonMobile' : ''}" class:PanicButtonAnimation={panicLoading} part="PanicButton {(getDevice(userAgent) !== 'PC') ? 'PanicButtonMobile' : ''}" bind:this={panicButton} on:click={() => panicAction()}>{$_('casinoPage.breakButton')}</button>
1154
+ <button class="PanicButton {(getDevice(userAgent) !== 'PC') ? 'PanicButtonMobile ' : ''}" class:PanicButtonAnimation={panicLoading} part="PanicButton {(getDevice(userAgent) !== 'PC') ? 'PanicButtonMobile' : ''}" bind:this={panicButton} >{$_('casinoPage.breakButton')}</button>
1155
1155
  </div>
1156
1156
  {/if}
1157
1157
  </section>
@@ -1175,7 +1175,7 @@
1175
1175
 
1176
1176
  .PanicSectionMobile {
1177
1177
  flex-direction: column;
1178
- margin-bottom: 40px;
1178
+ margin: 20px 0;
1179
1179
  }
1180
1180
 
1181
1181
  .PanicSection {
@@ -1183,63 +1183,54 @@
1183
1183
  justify-content: center;
1184
1184
  align-items: center;
1185
1185
  gap: 10px;
1186
- }
1187
-
1188
- .PanicText {
1189
- display: flex;
1190
- justify-content: center;
1191
- align-items: center;
1192
- gap: 10px;
1193
- }
1194
-
1195
- p {
1196
- font-size: 16px;
1197
- color: var(--emfe-w-color-white, #FFFFFF);
1186
+ margin-top: 20px;
1198
1187
  }
1199
1188
 
1200
1189
  .PanicButton {
1201
1190
  border-radius: 5px;
1202
1191
  border: 1px solid var(--emfe-w-color-primary, #D0046C);
1203
1192
  background-color: var(--emfe-w-color-primary, #D0046C);
1204
- width: 380px;
1193
+ width: 280px;
1205
1194
  height: 48px;
1206
1195
  line-height: 18px;
1207
1196
  color: var(--emfe-w-color-white, #FFFFFF);
1208
1197
  cursor: pointer;
1209
1198
  }
1210
1199
 
1211
- .PanicButtonMobile {
1212
- width: 240px;
1213
- }
1214
-
1215
1200
  .PanicButtonAnimation {
1216
1201
  background: -webkit-linear-gradient(
1217
1202
  135deg,
1218
- #FD2839 5%, #D0046C 100%
1203
+ rgba(20, 20, 20, 0) 55%, rgba(20, 20, 20, 0.3) 100%
1219
1204
  );
1220
1205
 
1221
1206
  background: -moz-linear-gradient(
1222
1207
  135deg,
1223
- #FD2839 5%, #D0046C 100%
1208
+ rgba(20, 20, 20, 0) 55%, rgba(20, 20, 20, 0.3) 100%
1224
1209
  );
1225
1210
 
1226
1211
  background: -o-linear-gradient(
1227
1212
  135deg,
1228
- #FD2839 5%, #D0046C 100%
1213
+ rgba(20, 20, 20, 0) 55%, rgba(20, 20, 20, 0.3) 100%
1229
1214
  );
1230
1215
 
1231
- width: 240px;
1216
+ background-color: var(--emfe-w-color-primary, #D0046C);
1217
+ width: 280px;
1232
1218
  color: #fff;
1233
1219
 
1234
1220
  -webkit-animation: bar-animation 2s linear;
1235
1221
  }
1236
1222
 
1223
+ .PanicButtonMobile {
1224
+ width: 280px;
1225
+ padding: 0 5px;
1226
+ }
1227
+
1237
1228
  @-webkit-keyframes bar-animation {
1238
1229
  0% {
1239
1230
  background-position: 0;
1240
1231
  }
1241
1232
  100% {
1242
- background-position: 240px;
1233
+ background-position: 280px;
1243
1234
  }
1244
1235
  }
1245
1236