pixi-rainman-game-engine 0.1.19 → 0.1.21

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.
Files changed (72) hide show
  1. package/README.md +10 -16
  2. package/dist/SettingsUI/SystemSettings/SystemSettingsComponent.d.ts +0 -1
  3. package/dist/SettingsUI/SystemSettings/SystemSettingsComponent.jsx +7 -6
  4. package/dist/SettingsUI/components/AutoplaySettings/index.d.ts +0 -1
  5. package/dist/SettingsUI/components/AutoplaySettings/index.jsx +26 -38
  6. package/dist/SettingsUI/components/Bet/BetControls.d.ts +0 -1
  7. package/dist/SettingsUI/components/Bet/BetControls.jsx +9 -9
  8. package/dist/SettingsUI/components/Bet/index.d.ts +0 -1
  9. package/dist/SettingsUI/components/Bet/index.jsx +1 -3
  10. package/dist/SettingsUI/components/Button/index.d.ts +2 -0
  11. package/dist/SettingsUI/components/Button/index.jsx +6 -0
  12. package/dist/SettingsUI/components/BuyFreeSpins/index.d.ts +0 -1
  13. package/dist/SettingsUI/components/BuyFreeSpins/index.jsx +6 -6
  14. package/dist/SettingsUI/components/CloseModalButton/index.d.ts +0 -1
  15. package/dist/SettingsUI/components/CloseModalButton/index.jsx +3 -3
  16. package/dist/SettingsUI/components/GameRules/index.d.ts +0 -1
  17. package/dist/SettingsUI/components/GameRules/index.jsx +11 -13
  18. package/dist/SettingsUI/components/Modal/index.d.ts +10 -0
  19. package/dist/SettingsUI/components/Modal/index.jsx +24 -0
  20. package/dist/SettingsUI/components/OptionButton/index.jsx +1 -1
  21. package/dist/SettingsUI/components/RichLimitingSlider/index.d.ts +0 -1
  22. package/dist/SettingsUI/components/RichLimitingSlider/index.jsx +8 -8
  23. package/dist/SettingsUI/components/SlidingSwitch/index.d.ts +0 -1
  24. package/dist/SettingsUI/components/SlidingSwitch/index.jsx +4 -5
  25. package/dist/SettingsUI/components/SpeedSettingsPopup/index.d.ts +0 -1
  26. package/dist/SettingsUI/components/SpeedSettingsPopup/index.jsx +6 -6
  27. package/dist/SettingsUI/components/SpeedSwitchButton/index.jsx +6 -5
  28. package/dist/SettingsUI/components/SwitchWithHeader/index.d.ts +0 -1
  29. package/dist/SettingsUI/components/SwitchWithHeader/index.jsx +5 -6
  30. package/dist/SettingsUI/components/SymbolMultiplierPopup/index.d.ts +1 -2
  31. package/dist/SettingsUI/components/SymbolMultiplierPopup/index.jsx +17 -15
  32. package/dist/SettingsUI/components/UXSettings/index.d.ts +0 -1
  33. package/dist/SettingsUI/components/UXSettings/index.jsx +8 -21
  34. package/dist/SettingsUI/components/VolumeSettings/index.d.ts +0 -1
  35. package/dist/SettingsUI/components/VolumeSettings/index.jsx +4 -5
  36. package/dist/SettingsUI/hooks/index.d.ts +1 -0
  37. package/dist/SettingsUI/hooks/index.js +1 -0
  38. package/dist/SettingsUI/hooks/useClickOutside.d.ts +6 -0
  39. package/dist/SettingsUI/hooks/useClickOutside.js +20 -0
  40. package/dist/SettingsUI/index.css +46 -26
  41. package/dist/SettingsUI/index.d.ts +1 -1
  42. package/dist/SettingsUI/index.jsx +15 -14
  43. package/dist/SettingsUI/packedStyles.css +1617 -0
  44. package/dist/SettingsUI/utils/tw.d.ts +2 -0
  45. package/dist/SettingsUI/utils/tw.js +3 -0
  46. package/dist/application/ApiConfig/ApiConfig.d.ts +1 -1
  47. package/dist/application/ApiConfig/ApiConfig.js +2 -2
  48. package/dist/application/setup.js +1 -1
  49. package/dist/components/AbstractMainContainer/AbstractMainContainer.js +3 -2
  50. package/dist/components/dictionary/locales/en.json +2 -1
  51. package/dist/components/messageBox/MessageBox.js +10 -6
  52. package/dist/components/symbols/AbstractSymbolsColumn.js +3 -5
  53. package/dist/connectivity/serverData.d.ts +20 -0
  54. package/dist/controllers/AbstractController.d.ts +1 -0
  55. package/dist/controllers/AbstractController.js +12 -0
  56. package/dist/stores/SettingsStore.d.ts +5 -0
  57. package/dist/stores/SettingsStore.js +11 -0
  58. package/dist/utils/common/screenHelpers.js +1 -1
  59. package/package.json +9 -4
  60. package/dist/SettingsUI/SystemSettings/systemSettings.css +0 -41
  61. package/dist/SettingsUI/components/AutoplaySettings/autoplaySettings.css +0 -267
  62. package/dist/SettingsUI/components/Bet/bet.css +0 -104
  63. package/dist/SettingsUI/components/BuyFreeSpins/buyFreeSpin.css +0 -46
  64. package/dist/SettingsUI/components/CloseModalButton/closeModalButton.css +0 -20
  65. package/dist/SettingsUI/components/GameRules/gameRules.css +0 -96
  66. package/dist/SettingsUI/components/RichLimitingSlider/richLimitingSlider.css +0 -39
  67. package/dist/SettingsUI/components/SlidingSwitch/slidingSwitch.css +0 -126
  68. package/dist/SettingsUI/components/SpeedSettingsPopup/speedSettingsPopup.css +0 -119
  69. package/dist/SettingsUI/components/SwitchWithHeader/headerStyle.css +0 -28
  70. package/dist/SettingsUI/components/SymbolMultiplierPopup/symbolPopup.css +0 -101
  71. package/dist/SettingsUI/components/UXSettings/UXSettings.css +0 -28
  72. package/dist/SettingsUI/components/VolumeSettings/volume.css +0 -54
@@ -1,5 +1,4 @@
1
- import "./symbolPopup.css";
2
1
  import React from "react";
3
- export declare const SymbolMultiplierPopup: (() => React.JSX.Element) & {
2
+ export declare const SymbolMultiplierPopup: (() => React.JSX.Element | null) & {
4
3
  displayName: string;
5
4
  };
@@ -1,38 +1,40 @@
1
- import "./symbolPopup.css";
2
1
  import { observer } from "mobx-react-lite";
3
2
  import React from "react";
4
3
  import { MoneyText } from "../../../Money";
5
4
  import { RainMan } from "../../../Rainman";
6
5
  import { useStores } from "../../hooks";
6
+ import { cn } from "../../utils/tw";
7
7
  const getPaytableValueDetails = (paytableValue, bet) => {
8
8
  if (typeof paytableValue === "number") {
9
- return <div className="symbol-popup__value">{new MoneyText(paytableValue * bet).toString()}</div>;
9
+ return (<div className="whitespace-nowrap text-xs text-white sm:ml-5 sm:text-2xl">
10
+ {new MoneyText(paytableValue * bet).toString()}
11
+ </div>);
10
12
  }
11
13
  const min = Array.isArray(paytableValue) ? paytableValue[0] : paytableValue.min;
12
14
  const max = Array.isArray(paytableValue) ? paytableValue.at(-1) || 0 : paytableValue.max;
13
- return (<div className="symbol-popup__value--range">
14
- <div>{`min: ${new MoneyText(min * bet).toString()}`}</div>
15
- <div>{`max: ${new MoneyText(max * bet).toString()}`}</div>
15
+ return (<div className="text-md flex flex-col whitespace-nowrap sm:text-xs">
16
+ <div>min: {new MoneyText(min * bet).toString()}</div>
17
+ <div>max: {new MoneyText(max * bet).toString()}</div>
16
18
  </div>);
17
19
  };
18
20
  export const SymbolMultiplierPopup = observer(() => {
19
21
  const { settingStore } = useStores();
20
22
  const { popupPaytablePosition, popupPaytableData } = settingStore;
21
23
  if (popupPaytablePosition && popupPaytableData) {
22
- const arrowDirection = popupPaytablePosition.x > RainMan.app.screen.width / 2 ? "arrow-on-right" : "arrow-on-left";
23
- return (<div className={`symbol-multiplier-popup-modal modal-style ${arrowDirection}`} style={{
24
+ const arrowDirection = popupPaytablePosition.x > RainMan.app.screen.width / 2 ? "arrow-on-right" : "arrow-on-left ";
25
+ return (<div className={cn("text-md absolute flex h-fit flex-col items-center justify-center rounded-lg bg-zinc-800 p-2 shadow-lg sm:text-2xl", arrowDirection)} style={{
24
26
  left: popupPaytablePosition.x,
25
27
  top: popupPaytablePosition.y,
26
28
  }}>
27
- <div className={`symbol-popup ${arrowDirection}`}>
28
- {popupPaytableData.map((popupPaytableRow) => {
29
- return (<div key={popupPaytableRow.prefix} className="symbol-popup__row">
30
- <div className="symbol-popup__prefix">{popupPaytableRow.prefix}x</div>
31
- {getPaytableValueDetails(popupPaytableRow.value, settingStore.bet)}
32
- </div>);
33
- })}
29
+ <div className="flex h-full w-fit flex-col items-center justify-center sm:w-full">
30
+ {popupPaytableData.map((popupPaytableRow) => (<div key={popupPaytableRow.prefix} className="flex gap-1 text-xs sm:text-2xl">
31
+ <div className="text-xs font-bold text-primary-500 sm:text-2xl">
32
+ {popupPaytableRow.prefix}x
33
+ </div>
34
+ {getPaytableValueDetails(popupPaytableRow.value, settingStore.bet)}
35
+ </div>))}
34
36
  </div>
35
37
  </div>);
36
38
  }
37
- return <div></div>;
39
+ return null;
38
40
  });
@@ -1,4 +1,3 @@
1
- import "./UXSettings.css";
2
1
  import React from "react";
3
2
  export declare const UXSettings: (() => React.JSX.Element) & {
4
3
  displayName: string;
@@ -1,30 +1,17 @@
1
- import "./UXSettings.css";
2
1
  import { observer } from "mobx-react-lite";
3
2
  import React from "react";
4
3
  import { useStores } from "../../hooks";
5
4
  import { SpeedButtonWithHeader, SwitchWithHeader } from "../SwitchWithHeader";
6
5
  export const UXSettings = observer(() => {
7
6
  const { settingStore } = useStores();
8
- return (<div className="ux-settings">
9
- <div className="ux-settings__switch-container">
10
- <div className="ux-settings__switch">
11
- <SpeedButtonWithHeader header="Quick Spin" description="Play faster by reducing total spin time"/>
12
- </div>
13
- <div className="ux-settings__switch">
14
- <SwitchWithHeader header="Battery saver" description="Safe battery life by reducing animation speed" flag={settingStore.batterySaverFlag} setFlag={settingStore.setBatteryFlag}/>
15
- </div>
16
- <div className="ux-settings__switch">
17
- <SwitchWithHeader header="Ambient music" description="Turn on or off the game music" flag={settingStore.ambientMusicFlag} setFlag={settingStore.setAmbientMusicFlag}/>
18
- </div>
19
- <div className="ux-settings__switch">
20
- <SwitchWithHeader header="Sound fx" description="Turn on or off the game sounds" flag={settingStore.soundFxFlag} setFlag={settingStore.setSoundFxFlag}/>
21
- </div>
22
- <div className="ux-settings__switch">
23
- <SwitchWithHeader header="Full screen mode" description="Turn on or off game fullscreen" flag={settingStore.fullScreenFlag} setFlag={settingStore.setFullScreenFlag}/>
24
- </div>
25
- <div className="ux-settings__switch">
26
- <SwitchWithHeader header="HI resolution" description="Enable high resolution files" flag={settingStore.HiResolutionFlag} setFlag={settingStore.setHiResolutionFlag}/>
27
- </div>
7
+ return (<div className="flex w-full max-w-xl flex-col">
8
+ <div className="flex flex-col gap-4">
9
+ <SpeedButtonWithHeader header="Quick Spin" description="Play faster by reducing total spin time"/>
10
+ <SwitchWithHeader header="Battery saver" description="Safe battery life by reducing animation speed" flag={settingStore.batterySaverFlag} setFlag={settingStore.setBatteryFlag}/>
11
+ <SwitchWithHeader header="Ambient music" description="Turn on or off the game music" flag={settingStore.ambientMusicFlag} setFlag={settingStore.setAmbientMusicFlag}/>
12
+ <SwitchWithHeader header="Sound fx" description="Turn on or off the game sounds" flag={settingStore.soundFxFlag} setFlag={settingStore.setSoundFxFlag}/>
13
+ <SwitchWithHeader header="Full screen mode" description="Turn on or off game fullscreen" flag={settingStore.fullScreenFlag} setFlag={settingStore.setFullScreenFlag}/>
14
+ <SwitchWithHeader header="HI resolution" description="Enable high resolution files" flag={settingStore.HiResolutionFlag} setFlag={settingStore.setHiResolutionFlag}/>
28
15
  </div>
29
16
  </div>);
30
17
  });
@@ -1,5 +1,4 @@
1
1
  import "rc-slider/assets/index.css";
2
- import "./volume.css";
3
2
  import React from "react";
4
3
  export declare const VolumeSettings: (() => React.JSX.Element) & {
5
4
  displayName: string;
@@ -1,5 +1,4 @@
1
1
  import "rc-slider/assets/index.css";
2
- import "./volume.css";
3
2
  import { observer } from "mobx-react-lite";
4
3
  import Slider from "rc-slider";
5
4
  import React from "react";
@@ -12,9 +11,9 @@ const onChange = (newVolumeLevel) => {
12
11
  export const VolumeSettings = observer(() => {
13
12
  const { settingStore } = useStores();
14
13
  const COLOR = settingStore.isSoundEnabled() ? "#2FC408" : "#FA5F27";
15
- return (<div className="volume-control">
16
- <div className="volume-control__volume-icon"></div>
17
- <Slider className="volume-control__slider" step={1} min={0} max={100} value={settingStore.volumeLevel} handleStyle={{
14
+ return (<div className="relative -right-10 top-2 flex h-full w-4/5 items-center">
15
+ <div className="relative -left-5 bottom-2 h-[30px] w-[30px] bg-[url('/assets/settings/sound-icon.png')] bg-contain bg-center bg-no-repeat"/>
16
+ <Slider className="relative bottom-2" step={1} min={0} max={100} value={settingStore.volumeLevel} handleStyle={{
18
17
  backgroundColor: COLOR,
19
18
  borderColor: COLOR,
20
19
  width: "7px",
@@ -28,7 +27,7 @@ export const VolumeSettings = observer(() => {
28
27
  height: "5px",
29
28
  borderRadius: "1px",
30
29
  }} onChange={onChange}/>
31
- <p className="volume-control__text" style={{
30
+ <p className="text-md relative bottom-2 left-4 w-9 pl-2 font-bold" style={{
32
31
  color: COLOR,
33
32
  }}>
34
33
  {settingStore.volumeLevel}
@@ -1,3 +1,4 @@
1
1
  export * from "./useBuyFreeSpins";
2
+ export * from "./useClickOutside";
2
3
  export * from "./useDeviceOrientations";
3
4
  export * from "./useStore";
@@ -1,3 +1,4 @@
1
1
  export * from "./useBuyFreeSpins";
2
+ export * from "./useClickOutside";
2
3
  export * from "./useDeviceOrientations";
3
4
  export * from "./useStore";
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const useClickOutside: (handler: () => void, initialDisplay?: boolean) => {
3
+ ref: import("react").RefObject<HTMLDivElement>;
4
+ open: boolean;
5
+ setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
6
+ };
@@ -0,0 +1,20 @@
1
+ import { useEffect, useRef, useState } from "react";
2
+ export const useClickOutside = (handler, initialDisplay = false) => {
3
+ const ref = useRef(null);
4
+ const [open, setOpen] = useState(initialDisplay);
5
+ const handleClickOutside = (event) => {
6
+ if (ref.current && !ref.current.contains(event?.target) && open) {
7
+ handler();
8
+ setOpen(false);
9
+ }
10
+ };
11
+ useEffect(() => {
12
+ document.addEventListener("mousedown", handleClickOutside, true);
13
+ document.addEventListener("touchend", handleClickOutside, true);
14
+ return () => {
15
+ document.removeEventListener("mousedown", handleClickOutside, true);
16
+ document.removeEventListener("touchend", handleClickOutside, true);
17
+ };
18
+ }, [ref, handler]);
19
+ return { ref, open, setOpen };
20
+ };
@@ -1,3 +1,7 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
1
5
  html {
2
6
  height: 100vh;
3
7
  }
@@ -80,32 +84,6 @@ body {
80
84
  display: none;
81
85
  }
82
86
 
83
- .modal-style {
84
- display: flex;
85
- position: absolute;
86
- background-color: rgba(0, 0, 0, 0.85);
87
- border-radius: 20px;
88
- border: 2px #423f42;
89
- border-style: solid;
90
- box-shadow: 0px 0px 6px 1px white;
91
- }
92
-
93
- .modal {
94
- width: 80vw;
95
- height: 80vh;
96
- top: 5vh;
97
- left: 10vw;
98
- align-items: center;
99
- justify-content: center;
100
- }
101
-
102
- .flex-containers-stretched {
103
- display: flex;
104
- flex-direction: row;
105
- justify-content: space-between;
106
- align-items: center;
107
- }
108
-
109
87
  @keyframes iosAnimMove {
110
88
  0% {
111
89
  background-position-y: 75%;
@@ -152,3 +130,45 @@ html.is-locked .ios-scroller-animation {
152
130
  opacity: 0;
153
131
  z-index: -9999;
154
132
  }
133
+
134
+ .arrow-on-left {
135
+ transform: translate(75px, -50%);
136
+ }
137
+
138
+ .arrow-on-right {
139
+ transform: translate(calc(-100% - 75px), -50%);
140
+ }
141
+
142
+ .arrow-on-left::after {
143
+ content: "";
144
+ position: absolute;
145
+ display: block;
146
+ background: url("/assets/settings/symbol-pointer.png");
147
+ top: 50%;
148
+ right: 100%;
149
+ height: 25px;
150
+ width: 25px;
151
+ transform: translateY(-50%);
152
+ }
153
+
154
+ .arrow-on-right::after {
155
+ content: "";
156
+ position: absolute;
157
+ display: block;
158
+ background: url("/assets/settings/symbol-pointer.png");
159
+ top: 50%;
160
+ left: 100%;
161
+ height: 25px;
162
+ width: 25px;
163
+ transform: translate(0, -50%) rotate(180deg);
164
+ }
165
+
166
+ @media only screen and (max-width: 900px) {
167
+ .arrow-on-left {
168
+ transform: translate(50px, -50%);
169
+ }
170
+
171
+ .arrow-on-right {
172
+ transform: translate(calc(-100% - 50px), -50%);
173
+ }
174
+ }
@@ -1,3 +1,3 @@
1
- import "./index.css";
1
+ import "./packedStyles.css";
2
2
  import React from "react";
3
3
  export declare const SettingsUI: () => React.JSX.Element;
@@ -1,33 +1,34 @@
1
- import "./index.css";
1
+ import "./packedStyles.css";
2
2
  import React from "react";
3
3
  import { UI_ITEMS } from "../utils";
4
4
  import { AutoplaySettings, BetSettings, BuyFreeSpinModal, GameRules, SpeedSettingsPopup, SymbolMultiplierPopup, VolumeSettings, } from "./components";
5
+ import { Modal } from "./components/Modal";
5
6
  import { SystemSettingsComponent } from "./SystemSettings/SystemSettingsComponent";
6
7
  export const SettingsUI = () => {
7
8
  return (<>
8
- <div id={UI_ITEMS.settings} className="modal modal-style">
9
+ <Modal layerId={UI_ITEMS.settings}>
9
10
  <SystemSettingsComponent />
10
- </div>
11
- <div id={UI_ITEMS.gameRules} className="modal modal-style">
11
+ </Modal>
12
+ <Modal layerId={UI_ITEMS.gameRules}>
12
13
  <GameRules />
13
- </div>
14
- <div id={UI_ITEMS.volume} className="volume-modal modal-style">
14
+ </Modal>
15
+ <div id={UI_ITEMS.volume} className="absolute bottom-[5vh] left-[1vw] h-[50px] w-[40vh] rounded-xl bg-zinc-900 shadow shadow-primary-500/30">
15
16
  <VolumeSettings />
16
17
  </div>
17
- <div id={UI_ITEMS.autoplay} className="modal modal-style">
18
+ <Modal layerId={UI_ITEMS.autoplay}>
18
19
  <AutoplaySettings />
19
- </div>
20
- <div id={UI_ITEMS.speedSettings} className="speed-settings-modal modal-style">
20
+ </Modal>
21
+ <Modal layerId={UI_ITEMS.speedSettings} className="absolute flex h-fit items-center justify-center rounded-xl bg-zinc-900 p-4 shadow-primary-500/30 sm:left-auto sm:top-auto portrait:left-auto portrait:top-auto portrait:items-center">
21
22
  <SpeedSettingsPopup />
22
- </div>
23
+ </Modal>
23
24
  <div id={UI_ITEMS.symbolPayTable}>
24
25
  <SymbolMultiplierPopup />
25
26
  </div>
26
- <div id={UI_ITEMS.freeSpin} className="modal modal-style">
27
+ <Modal layerId={UI_ITEMS.freeSpin}>
27
28
  <BuyFreeSpinModal />
28
- </div>
29
- <div id={UI_ITEMS.bet} className="modal modal-style">
29
+ </Modal>
30
+ <Modal layerId={UI_ITEMS.bet}>
30
31
  <BetSettings />
31
- </div>
32
+ </Modal>
32
33
  </>);
33
34
  };