pixi-rainman-game-engine 0.1.0 → 0.1.1

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 (44) hide show
  1. package/dist/SettingsUI/SystemSettings/SystemSettingsComponent.d.ts +2 -1
  2. package/dist/SettingsUI/SystemSettings/SystemSettingsComponent.jsx +17 -0
  3. package/dist/SettingsUI/components/AutoplaySettings/index.d.ts +2 -1
  4. package/dist/SettingsUI/components/AutoplaySettings/index.jsx +121 -0
  5. package/dist/SettingsUI/components/Bet/index.d.ts +2 -1
  6. package/dist/SettingsUI/components/Bet/index.jsx +21 -0
  7. package/dist/SettingsUI/components/BuyFreeSpins/index.jsx +25 -0
  8. package/dist/SettingsUI/components/CloseModalButton/{index.js → index.jsx} +4 -2
  9. package/dist/SettingsUI/components/GameRules/index.d.ts +2 -1
  10. package/dist/SettingsUI/components/GameRules/index.jsx +41 -0
  11. package/dist/SettingsUI/components/OptionButton/{index.js → index.jsx} +9 -2
  12. package/dist/SettingsUI/components/RichLimitingSlider/index.d.ts +2 -1
  13. package/dist/SettingsUI/components/RichLimitingSlider/index.jsx +26 -0
  14. package/dist/SettingsUI/components/SlidingSwitch/index.d.ts +2 -1
  15. package/dist/SettingsUI/components/SlidingSwitch/index.jsx +10 -0
  16. package/dist/SettingsUI/components/SpeedSettingsPopup/index.d.ts +2 -1
  17. package/dist/SettingsUI/components/SpeedSettingsPopup/index.jsx +27 -0
  18. package/dist/SettingsUI/components/SpeedSwitchButton/index.d.ts +2 -1
  19. package/dist/SettingsUI/components/SpeedSwitchButton/index.jsx +19 -0
  20. package/dist/SettingsUI/components/SwitchWithHeader/index.d.ts +4 -3
  21. package/dist/SettingsUI/components/SwitchWithHeader/index.jsx +23 -0
  22. package/dist/SettingsUI/components/SymbolMultiplierPopup/index.d.ts +2 -1
  23. package/dist/SettingsUI/components/SymbolMultiplierPopup/{index.js → index.jsx} +18 -8
  24. package/dist/SettingsUI/components/UXSettings/index.d.ts +2 -1
  25. package/dist/SettingsUI/components/UXSettings/index.jsx +30 -0
  26. package/dist/SettingsUI/components/VolumeSettings/index.d.ts +2 -1
  27. package/dist/SettingsUI/components/VolumeSettings/index.jsx +46 -0
  28. package/dist/SettingsUI/index.d.ts +2 -1
  29. package/dist/SettingsUI/index.jsx +30 -0
  30. package/package.json +1 -1
  31. package/dist/SettingsUI/SystemSettings/SystemSettingsComponent.js +0 -8
  32. package/dist/SettingsUI/components/AutoplaySettings/index.js +0 -76
  33. package/dist/SettingsUI/components/Bet/index.js +0 -8
  34. package/dist/SettingsUI/components/BuyFreeSpins/index.js +0 -15
  35. package/dist/SettingsUI/components/GameRules/index.js +0 -26
  36. package/dist/SettingsUI/components/RichLimitingSlider/index.js +0 -20
  37. package/dist/SettingsUI/components/SlidingSwitch/index.js +0 -6
  38. package/dist/SettingsUI/components/SpeedSettingsPopup/index.js +0 -19
  39. package/dist/SettingsUI/components/SpeedSwitchButton/index.js +0 -13
  40. package/dist/SettingsUI/components/SwitchWithHeader/index.js +0 -14
  41. package/dist/SettingsUI/components/UXSettings/index.js +0 -9
  42. package/dist/SettingsUI/components/VolumeSettings/index.js +0 -40
  43. package/dist/SettingsUI/index.js +0 -8
  44. /package/dist/SettingsUI/components/{index.js → index.jsx} +0 -0
@@ -1,2 +1,3 @@
1
1
  import "./systemSettings.css";
2
- export declare const SystemSettingsComponent: () => import("react/jsx-runtime").JSX.Element;
2
+ import React from "react";
3
+ export declare const SystemSettingsComponent: () => React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ import "./systemSettings.css";
2
+ import i18next from "i18next";
3
+ import React from "react";
4
+ import { UI_ITEMS } from "../../utils";
5
+ import { BetComponent, CloseModalButton, UXSettings } from "../components";
6
+ export const SystemSettingsComponent = () => {
7
+ return (<div className="settings">
8
+ <div className="settings__title">
9
+ <h2>{i18next.t("systemSettings")}</h2>
10
+ </div>
11
+ <CloseModalButton layerId={UI_ITEMS.settings}/>
12
+ <div className="settings__column">
13
+ <BetComponent />
14
+ <UXSettings />
15
+ </div>
16
+ </div>);
17
+ };
@@ -1,5 +1,6 @@
1
1
  import "react-custom-scroll/dist/customScroll.css";
2
2
  import "./autoplaySettings.css";
3
- export declare const AutoplaySettings: (() => import("react/jsx-runtime").JSX.Element) & {
3
+ import React from "react";
4
+ export declare const AutoplaySettings: (() => React.JSX.Element) & {
4
5
  displayName: string;
5
6
  };
@@ -0,0 +1,121 @@
1
+ import "react-custom-scroll/dist/customScroll.css";
2
+ import "./autoplaySettings.css";
3
+ import i18next from "i18next";
4
+ import { observer } from "mobx-react-lite";
5
+ import React, { useEffect, useState } from "react";
6
+ import { COMPONENTS } from "../../../components";
7
+ import { UI_ITEMS } from "../../../utils";
8
+ import { useStores } from "../../hooks";
9
+ import { closeModal, CloseModalButton } from "../CloseModalButton";
10
+ import { RichLimitingSlider } from "../RichLimitingSlider";
11
+ import { SpeedButtonWithHeader, SwitchWithHeader } from "../SwitchWithHeader";
12
+ export const AutoplaySettings = observer(() => {
13
+ const [limit_numbers, setLimitNumbers] = useState([0]);
14
+ const initialAutoSpinCount = 50;
15
+ const availableAutoSpinLimits = [10, 20, 50, 100, 150, 200, 250, 300, 350, 400, 500, 600, 700, 800, 900, 1000];
16
+ const { settingStore } = useStores();
17
+ const calculateLimitBounds = (indexOfSelectedLimit) => {
18
+ let bottomLimitIndex = indexOfSelectedLimit - 2;
19
+ let topLimitIndex = indexOfSelectedLimit + 1;
20
+ if (bottomLimitIndex < 0) {
21
+ bottomLimitIndex = availableAutoSpinLimits.length - -bottomLimitIndex;
22
+ }
23
+ if (topLimitIndex === availableAutoSpinLimits.length) {
24
+ topLimitIndex = 0;
25
+ }
26
+ return {
27
+ bottomLimitIndex,
28
+ topLimitIndex,
29
+ };
30
+ };
31
+ const updateLimitsBounds = (newLimit) => {
32
+ setAutoSpinsCount(newLimit);
33
+ const indexOfSelectedSpinsLimit = availableAutoSpinLimits.findIndex((limitCount) => limitCount === newLimit);
34
+ if (indexOfSelectedSpinsLimit === -1) {
35
+ }
36
+ const { bottomLimitIndex, topLimitIndex } = calculateLimitBounds(indexOfSelectedSpinsLimit);
37
+ const limitNumbersIndexes = [];
38
+ for (let index = bottomLimitIndex; index !== topLimitIndex + 1; index++) {
39
+ if (index === availableAutoSpinLimits.length) {
40
+ index = 0;
41
+ }
42
+ limitNumbersIndexes.push(availableAutoSpinLimits[index]);
43
+ if (limitNumbersIndexes.length === 4) {
44
+ break;
45
+ }
46
+ }
47
+ setLimitNumbers(limitNumbersIndexes);
48
+ };
49
+ useEffect(() => {
50
+ updateLimitsBounds(initialAutoSpinCount);
51
+ }, []);
52
+ const { singleWinExceeds, balancedIncreased, balancedDecreased, howManyAutoSpinsLeft, infinitySpinsEnabled, setSingleWinExceeds, setBalancedIncreased, setBalancedDecreased, setAutoSpinsCount, flipInfinitySpinsFlag, resetAutoplaySettings, } = settingStore;
53
+ return (<div className="autoplay-settings">
54
+ <CloseModalButton layerId={UI_ITEMS.autoplay}/>
55
+ <div className="autoplay-settings__title">
56
+ <h2>{i18next.t("autoPlay")}</h2>
57
+ </div>
58
+ <div className="autoplay-settings__stop-limits">
59
+ <div className={`autoplay-settings__limit left ${infinitySpinsEnabled ? "autoplay-settings__limit--infinity" : ""}`} onClick={() => {
60
+ let indexOfSelectedSpinsLimit = availableAutoSpinLimits.findIndex((limitCount) => limitCount === howManyAutoSpinsLeft);
61
+ indexOfSelectedSpinsLimit -= 1;
62
+ if (indexOfSelectedSpinsLimit === -1) {
63
+ indexOfSelectedSpinsLimit = availableAutoSpinLimits.length - 1;
64
+ }
65
+ updateLimitsBounds(availableAutoSpinLimits[indexOfSelectedSpinsLimit]);
66
+ }}>
67
+ <p>-</p>
68
+ </div>
69
+ {limit_numbers.map((limiter, index) => {
70
+ return (<button key={`${limiter}${index}`} value={limiter} className={`autoplay-settings__limit ${limiter === howManyAutoSpinsLeft ? "autoplay-settings__limit--active" : ""} middle ${infinitySpinsEnabled ? "autoplay-settings__limit--infinity" : ""}`} onClick={(event) => updateLimitsBounds(Number(event.currentTarget.value))}>
71
+ <p>{limiter}</p>
72
+ </button>);
73
+ })}
74
+ <div className={`autoplay-settings__limit right ${infinitySpinsEnabled ? "autoplay-settings__limit--infinity" : ""}`} onClick={() => {
75
+ let indexOfSelectedSpinsLimit = availableAutoSpinLimits.findIndex((limitCount) => limitCount === howManyAutoSpinsLeft);
76
+ indexOfSelectedSpinsLimit += 1;
77
+ if (indexOfSelectedSpinsLimit === availableAutoSpinLimits.length) {
78
+ indexOfSelectedSpinsLimit = 0;
79
+ }
80
+ const newAutoSpinsLimitNumber = availableAutoSpinLimits[indexOfSelectedSpinsLimit];
81
+ updateLimitsBounds(newAutoSpinsLimitNumber);
82
+ }}>
83
+ <p>+</p>
84
+ </div>
85
+ <div className={`autoplay-settings__limit circle ${infinitySpinsEnabled ? "autoplay-settings__limit--active" : ""}`} onClick={() => flipInfinitySpinsFlag()}>
86
+ <p>∞</p>
87
+ </div>
88
+ </div>
89
+
90
+ <div className="autoplay-settings__title">
91
+ <h2>{i18next.t("stopAutoPlay")}</h2>
92
+ </div>
93
+ <div className="autoplay-settings__sliders">
94
+ <RichLimitingSlider value={singleWinExceeds} setValue={setSingleWinExceeds} maxValue={Number(i18next.t("ifSingleWinExceedsMax"))} description={i18next.t("ifSingleWinExceedsMaxDescription")}/>
95
+ <RichLimitingSlider value={balancedIncreased} setValue={setBalancedIncreased} maxValue={Number(i18next.t("ifBalanceIncreasesBy"))} description={i18next.t("ifBalanceIncreasesByDescription")}/>
96
+ <RichLimitingSlider value={balancedDecreased} setValue={setBalancedDecreased} maxValue={Number(i18next.t("ifSingleWinExceedsMax"))} description={i18next.t("ifBalanceDecreaseByDescription")}/>
97
+ </div>
98
+
99
+ <div className="autoplay-settings__switches">
100
+ <div className="autoplay-settings__switch">
101
+ <SwitchWithHeader header={i18next.t("onAnyWin")} flag={settingStore.onAnyWin} setFlag={settingStore.setOnAnyWin}/>
102
+ </div>
103
+ <div className="autoplay-settings__switch">
104
+ <SpeedButtonWithHeader header={i18next.t("speedButtonHeader")} description={i18next.t("speedButtonDescription")}/>
105
+ </div>
106
+ </div>
107
+
108
+ <div className="autoplay-settings__confirmation">
109
+ <div className="autoplay-settings__confirmation-button" onClick={() => {
110
+ resetAutoplaySettings();
111
+ updateLimitsBounds(initialAutoSpinCount);
112
+ closeModal(UI_ITEMS.autoplay);
113
+ }}>
114
+ <p>{i18next.t("cancel")}</p>
115
+ </div>
116
+ <div id={COMPONENTS.autoSpinConfirm} className="autoplay-settings__confirmation-button" onClick={() => closeModal(UI_ITEMS.autoplay)}>
117
+ <p>{i18next.t("confirm")}</p>
118
+ </div>
119
+ </div>
120
+ </div>);
121
+ });
@@ -1,4 +1,5 @@
1
1
  import "./bet.css";
2
- export declare const BetComponent: (() => import("react/jsx-runtime").JSX.Element) & {
2
+ import React from "react";
3
+ export declare const BetComponent: (() => React.JSX.Element) & {
3
4
  displayName: string;
4
5
  };
@@ -0,0 +1,21 @@
1
+ import "./bet.css";
2
+ import { observer } from "mobx-react-lite";
3
+ import React from "react";
4
+ import { useStores } from "../../hooks";
5
+ export const BetComponent = observer(() => {
6
+ const { settingStore } = useStores();
7
+ return (<div className="bet-container">
8
+ <h2>Total bet</h2>
9
+ <div className="bet-container__controls">
10
+ <button name="bet-minus" className="bet-container__button">
11
+ -
12
+ </button>
13
+ <div className="bet-container__value">
14
+ <p>{settingStore.betText}</p>
15
+ </div>
16
+ <button name="bet-plus" className="bet-container__button">
17
+ +
18
+ </button>
19
+ </div>
20
+ </div>);
21
+ });
@@ -0,0 +1,25 @@
1
+ import "./buyFreeSpin.css";
2
+ import React, { useState } from "react";
3
+ import { Currencies } from "ts-money";
4
+ import { UI_ITEMS } from "../../../utils";
5
+ import { useBuyFreeSpinOptions } from "../../hooks";
6
+ import { CloseModalButton } from "../CloseModalButton";
7
+ import { OptionButton } from "../OptionButton";
8
+ export const BuyFreeSpinModal = () => {
9
+ const [errorMessage, setErrorMessage] = useState("");
10
+ const freeSpinOptions = useBuyFreeSpinOptions();
11
+ const currency = Currencies[localStorage.getItem("currency")]?.symbol_native || "$";
12
+ const clearErrorMessage = () => setErrorMessage("");
13
+ return (<div className="buyFreeSpins__container">
14
+ <CloseModalButton layerId={UI_ITEMS.freeSpin} afterClose={clearErrorMessage}/>
15
+ <div className="buyFreeSpins__title-container">
16
+ <h1>Buy Free Spins</h1>
17
+ </div>
18
+ <div className="buyFreeSpins__buttons-container">
19
+ {freeSpinOptions.map((option) => (<OptionButton key={option.amount} setMessage={setErrorMessage} option={option} currency={currency}/>))}
20
+ </div>
21
+ {errorMessage ? (<div>
22
+ <p className="buyFreeSpins__error-message">{errorMessage}</p>
23
+ </div>) : null}
24
+ </div>);
25
+ };
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  import "./closeModalButton.css";
2
+ import React from "react";
3
3
  export const closeModal = (modalID, afterCloseCallBack) => {
4
4
  const gameRulesModal = window.document.getElementById(modalID);
5
5
  if (gameRulesModal !== null)
@@ -7,5 +7,7 @@ export const closeModal = (modalID, afterCloseCallBack) => {
7
7
  afterCloseCallBack && afterCloseCallBack();
8
8
  };
9
9
  export const CloseModalButton = ({ layerId, afterClose }) => {
10
- return (_jsx("button", { className: "close-modal-button", onClick: () => closeModal(layerId, afterClose), children: "x" }));
10
+ return (<button className="close-modal-button" onClick={() => closeModal(layerId, afterClose)}>
11
+ x
12
+ </button>);
11
13
  };
@@ -1,5 +1,6 @@
1
1
  import "react-custom-scroll/dist/customScroll.css";
2
2
  import "./gameRules.css";
3
- export declare const GameRules: (() => import("react/jsx-runtime").JSX.Element) & {
3
+ import React from "react";
4
+ export declare const GameRules: (() => React.JSX.Element) & {
4
5
  displayName: string;
5
6
  };
@@ -0,0 +1,41 @@
1
+ import "react-custom-scroll/dist/customScroll.css";
2
+ import "./gameRules.css";
3
+ import i18next from "i18next";
4
+ import { observer } from "mobx-react-lite";
5
+ import React, { useState } from "react";
6
+ import CustomScroll from "react-custom-scroll";
7
+ import { UI_ITEMS } from "../../../utils";
8
+ import { closeModal, CloseModalButton } from "../CloseModalButton";
9
+ import { gameRulesContent } from "./data";
10
+ export const GameRules = observer(() => {
11
+ const [pageNumber, setPageNumber] = useState(0);
12
+ const changePage = (incrementor) => {
13
+ const numberOfPages = gameRulesContent.pages.length;
14
+ if (pageNumber + incrementor === numberOfPages) {
15
+ setPageNumber(0);
16
+ return;
17
+ }
18
+ if (pageNumber + incrementor === -1) {
19
+ setPageNumber(numberOfPages - 1);
20
+ return;
21
+ }
22
+ setPageNumber(pageNumber + incrementor);
23
+ };
24
+ return (<div className="game-rules">
25
+ <div className="settings__title">
26
+ <h2>{i18next.t("gameRules")}</h2>
27
+ </div>
28
+ <CloseModalButton layerId={UI_ITEMS.gameRules}/>
29
+
30
+ <div className="game-rules__container custom-scroll">
31
+ <CustomScroll className="game-rules__scroll" allowOuterScroll={true}>
32
+ <div className="game-rules__content">{gameRulesContent.pages[pageNumber]}</div>
33
+ </CustomScroll>
34
+ </div>
35
+ <div className="game-rules__page-control">
36
+ <div className="page-left" onClick={() => changePage(-1)}></div>
37
+ <div className="page-middle" onClick={() => closeModal(UI_ITEMS.gameRules)}></div>
38
+ <div className="page-right" onClick={() => changePage(1)}></div>
39
+ </div>
40
+ </div>);
41
+ });
@@ -1,6 +1,6 @@
1
- import { jsxs as _jsxs } from "react/jsx-runtime";
2
1
  import i18next from "i18next";
3
2
  import { upperFirst } from "lodash";
3
+ import React from "react";
4
4
  import { UI_ITEMS } from "../../../utils";
5
5
  import { useStores } from "../../hooks";
6
6
  import { closeModal } from "../CloseModalButton";
@@ -29,5 +29,12 @@ export const OptionButton = ({ option, currency, setMessage }) => {
29
29
  settingStore.setIsFreeSpinBought(false);
30
30
  }
31
31
  };
32
- return (_jsxs("div", { className: "optionButton", onClick: async () => await onButtonClick(option), children: [_jsxs("p", { children: [i18next.t("amount"), ": ", option.amount] }), _jsxs("p", { children: [option.price, " ", currency] })] }, option.amount));
32
+ return (<div className="optionButton" key={option.amount} onClick={async () => await onButtonClick(option)}>
33
+ <p>
34
+ {i18next.t("amount")}: {option.amount}
35
+ </p>
36
+ <p>
37
+ {option.price} {currency}
38
+ </p>
39
+ </div>);
33
40
  };
@@ -1,12 +1,13 @@
1
1
  import "rc-slider/assets/index.css";
2
2
  import "./richLimitingSlider.css";
3
+ import React from "react";
3
4
  type RichLimitingSliderProps = {
4
5
  value: number;
5
6
  setValue: (value: number) => void;
6
7
  maxValue: number;
7
8
  description: string;
8
9
  };
9
- export declare const RichLimitingSlider: (({ value, setValue, maxValue, description }: RichLimitingSliderProps) => import("react/jsx-runtime").JSX.Element) & {
10
+ export declare const RichLimitingSlider: (({ value, setValue, maxValue, description }: RichLimitingSliderProps) => React.JSX.Element) & {
10
11
  displayName: string;
11
12
  };
12
13
  export {};
@@ -0,0 +1,26 @@
1
+ import "rc-slider/assets/index.css";
2
+ import "./richLimitingSlider.css";
3
+ import { observer } from "mobx-react-lite";
4
+ import Slider from "rc-slider";
5
+ import React from "react";
6
+ export const RichLimitingSlider = observer(({ value, setValue, maxValue, description }) => {
7
+ return (<div className="rich-slider">
8
+ {/* @ts-expect-error type error in library */}
9
+ <Slider className="rich-slider__slider" step={1} min={0} max={maxValue} defaultValue={value} value={value} handleStyle={{
10
+ backgroundColor: "#fdf425",
11
+ borderColor: "#fdf425",
12
+ width: "20px",
13
+ height: "20px",
14
+ bottom: "-4px",
15
+ }} railStyle={{
16
+ backgroundColor: "#fff",
17
+ }} trackStyle={{
18
+ backgroundColor: "#fdf425",
19
+ }} dotStyle={{
20
+ borderColor: "#fdf425",
21
+ }} onChange={(value) => setValue(value)}>
22
+ <p className="rich-slider__description">{description}</p>
23
+ </Slider>
24
+ <div className="rich-slider__number">{value}</div>
25
+ </div>);
26
+ });
@@ -1,9 +1,10 @@
1
1
  import "./slidingSwitch.css";
2
+ import React from "react";
2
3
  type SlidingSwitchProps = {
3
4
  flag: boolean;
4
5
  setFlag: (flag: boolean) => void;
5
6
  };
6
- export declare const SlidingSwitch: (({ flag, setFlag }: SlidingSwitchProps) => import("react/jsx-runtime").JSX.Element) & {
7
+ export declare const SlidingSwitch: (({ flag, setFlag }: SlidingSwitchProps) => React.JSX.Element) & {
7
8
  displayName: string;
8
9
  };
9
10
  export {};
@@ -0,0 +1,10 @@
1
+ import "./slidingSwitch.css";
2
+ import { observer } from "mobx-react-lite";
3
+ import React from "react";
4
+ export const SlidingSwitch = observer(({ flag, setFlag }) => {
5
+ return (<label className="switch">
6
+ <span className={`switch-round-box round ${flag ? "switch-round-box--active" : ""}`}/>
7
+ <input type="checkbox" defaultChecked={flag} onChange={(event) => setFlag(event.target.checked)}/>
8
+ <p className={`switch__text ${flag ? "switch__text--active" : ""}`}>{flag ? "ON" : "OFF"}</p>
9
+ </label>);
10
+ });
@@ -1,6 +1,7 @@
1
1
  import "react-custom-scroll/dist/customScroll.css";
2
2
  import "./speedSettingsPopup.css";
3
+ import React from "react";
3
4
  export declare const SPEED_PREFIX = "speed-";
4
- export declare const SpeedSettingsPopup: (() => import("react/jsx-runtime").JSX.Element) & {
5
+ export declare const SpeedSettingsPopup: (() => React.JSX.Element) & {
5
6
  displayName: string;
6
7
  };
@@ -0,0 +1,27 @@
1
+ import "react-custom-scroll/dist/customScroll.css";
2
+ import "./speedSettingsPopup.css";
3
+ import i18next from "i18next";
4
+ import { observer } from "mobx-react-lite";
5
+ import React from "react";
6
+ import { SPEED_LEVELS } from "../../../application";
7
+ import { UI_ITEMS } from "../../../utils";
8
+ import { useStores } from "../../hooks";
9
+ import { CloseModalButton } from "../CloseModalButton";
10
+ export const SPEED_PREFIX = "speed-";
11
+ export const SpeedSettingsPopup = observer(() => {
12
+ const speedLevelMapper = {
13
+ slow: SPEED_LEVELS.slow,
14
+ normal: SPEED_LEVELS.normal,
15
+ fast: SPEED_LEVELS.fast,
16
+ };
17
+ const { settingStore } = useStores();
18
+ return (<div className="speed-settings-popup">
19
+ <CloseModalButton layerId={UI_ITEMS.speedSettings}/>
20
+ <div className="speed-settings-popup__title">{i18next.t("howDoYouWantToPlay")}</div>
21
+ <div className="speed-settings-popup__speed-options">
22
+ {Object.keys(speedLevelMapper).map((speedLevelKey) => (<div id={`${SPEED_PREFIX}${speedLevelKey}`} key={`${SPEED_PREFIX}${speedLevelKey}`} className={`speed-settings-popup__option ${speedLevelKey === settingStore.currentSpeed ? "speed-settings-popup_option--active" : ""}`}>
23
+ <img className={`speed-settings-popup__icon ${speedLevelMapper[speedLevelKey]}`} src={`../../../assets/settings/speedPopup/speed-${speedLevelMapper[speedLevelKey]}.png`}/>
24
+ </div>))}
25
+ </div>
26
+ </div>);
27
+ });
@@ -1,3 +1,4 @@
1
- export declare const SpeedButtonSwitch: (() => import("react/jsx-runtime").JSX.Element) & {
1
+ import React from "react";
2
+ export declare const SpeedButtonSwitch: (() => React.JSX.Element) & {
2
3
  displayName: string;
3
4
  };
@@ -0,0 +1,19 @@
1
+ import { observer } from "mobx-react-lite";
2
+ import React from "react";
3
+ import { useStores } from "../../hooks";
4
+ export const SpeedButtonSwitch = observer(() => {
5
+ const speedLevelMapper = {
6
+ slow: "turtle",
7
+ normal: "rabbit",
8
+ fast: "cheetah",
9
+ };
10
+ const { settingStore } = useStores();
11
+ const { currentSpeed } = settingStore;
12
+ return (<label className="switch turtle-switch speed-level-id">
13
+ <span className="turtle-switch-round-box"/>
14
+ <img className="turtle-switch__icon" src={`assets/settings/speed-${speedLevelMapper[currentSpeed]}.png`}/>
15
+ <div className="dot-container">
16
+ {Array.from({ length: 3 }).map((_, i) => (<div key={i} className={`white-dot ${i < settingStore.indexOfSpeedLevel ? "white-dot--active" : ""}`}/>))}
17
+ </div>
18
+ </label>);
19
+ });
@@ -1,9 +1,10 @@
1
1
  import "./headerStyle.css";
2
+ import React from "react";
2
3
  import { HeaderWithDescriptionProps, SpeedButtonWithHeaderProps, SwitchHeaderProps } from "./types";
3
- export declare const HeaderWithDescription: ({ header, description }: HeaderWithDescriptionProps) => import("react/jsx-runtime").JSX.Element;
4
- export declare const SwitchWithHeader: (({ header, description, flag, setFlag }: SwitchHeaderProps) => import("react/jsx-runtime").JSX.Element) & {
4
+ export declare const HeaderWithDescription: ({ header, description }: HeaderWithDescriptionProps) => React.JSX.Element;
5
+ export declare const SwitchWithHeader: (({ header, description, flag, setFlag }: SwitchHeaderProps) => React.JSX.Element) & {
5
6
  displayName: string;
6
7
  };
7
- export declare const SpeedButtonWithHeader: (({ header, description }: SpeedButtonWithHeaderProps) => import("react/jsx-runtime").JSX.Element) & {
8
+ export declare const SpeedButtonWithHeader: (({ header, description }: SpeedButtonWithHeaderProps) => React.JSX.Element) & {
8
9
  displayName: string;
9
10
  };
@@ -0,0 +1,23 @@
1
+ import "./headerStyle.css";
2
+ import { observer } from "mobx-react-lite";
3
+ import React from "react";
4
+ import { SlidingSwitch } from "../SlidingSwitch";
5
+ import { SpeedButtonSwitch } from "../SpeedSwitchButton";
6
+ export const HeaderWithDescription = ({ header, description }) => {
7
+ return (<div className="header-description">
8
+ <h2 className="header-description__title">{header}</h2>
9
+ {description && <h6 className="header-description__text">{description}</h6>}
10
+ </div>);
11
+ };
12
+ export const SwitchWithHeader = observer(({ header, description, flag, setFlag }) => {
13
+ return (<div className="flex-containers-stretched">
14
+ <HeaderWithDescription header={header} description={description}/>
15
+ <SlidingSwitch flag={flag} setFlag={setFlag}/>
16
+ </div>);
17
+ });
18
+ export const SpeedButtonWithHeader = observer(({ header, description }) => {
19
+ return (<div className="flex-containers-stretched">
20
+ <HeaderWithDescription header={header} description={description}/>
21
+ <SpeedButtonSwitch />
22
+ </div>);
23
+ });
@@ -1,4 +1,5 @@
1
1
  import "./symbolPopup.css";
2
- export declare const SymbolMultiplierPopup: (() => import("react/jsx-runtime").JSX.Element) & {
2
+ import React from "react";
3
+ export declare const SymbolMultiplierPopup: (() => React.JSX.Element) & {
3
4
  displayName: string;
4
5
  };
@@ -1,17 +1,20 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
1
  import "./symbolPopup.css";
3
2
  import { observer } from "mobx-react-lite";
3
+ import React from "react";
4
4
  import { MoneyText } from "../../../Money";
5
5
  import { RainMan } from "../../../Rainman";
6
6
  import { getDeviceOrientation } from "../../../utils";
7
7
  import { useStores } from "../../hooks";
8
8
  const getPaytableValueDetails = (paytableValue, bet) => {
9
9
  if (typeof paytableValue === "number") {
10
- return _jsx("div", { className: "symbol-popup__value", children: new MoneyText(paytableValue * bet).toString() });
10
+ return <div className="symbol-popup__value">{new MoneyText(paytableValue * bet).toString()}</div>;
11
11
  }
12
12
  const min = Array.isArray(paytableValue) ? paytableValue[0] : paytableValue.min;
13
13
  const max = Array.isArray(paytableValue) ? paytableValue.at(-1) || 0 : paytableValue.max;
14
- return (_jsxs("div", { className: "symbol-popup__value--range", children: [_jsx("div", { children: `min: ${new MoneyText(min * bet).toString()}` }), _jsx("div", { children: `max: ${new MoneyText(max * bet).toString()}` })] }));
14
+ return (<div className="symbol-popup__value--range">
15
+ <div>{`min: ${new MoneyText(min * bet).toString()}`}</div>
16
+ <div>{`max: ${new MoneyText(max * bet).toString()}`}</div>
17
+ </div>);
15
18
  };
16
19
  export const SymbolMultiplierPopup = observer(() => {
17
20
  const { settingStore } = useStores();
@@ -37,12 +40,19 @@ export const SymbolMultiplierPopup = observer(() => {
37
40
  default:
38
41
  break;
39
42
  }
40
- return (_jsx("div", { className: "symbol-multiplier-popup-modal modal-style", style: {
43
+ return (<div className="symbol-multiplier-popup-modal modal-style" style={{
41
44
  left: destinationX,
42
45
  top: destinationY,
43
- }, children: _jsx("div", { className: `symbol-popup ${arrowDirection}`, children: popupPaytableData.map((popupPaytableRow) => {
44
- return (_jsxs("div", { className: "symbol-popup__row", children: [_jsxs("div", { className: "symbol-popup__prefix", children: [popupPaytableRow.prefix, "x"] }), getPaytableValueDetails(popupPaytableRow.value, settingStore.bet)] }, popupPaytableRow.prefix));
45
- }) }) }));
46
+ }}>
47
+ <div className={`symbol-popup ${arrowDirection}`}>
48
+ {popupPaytableData.map((popupPaytableRow) => {
49
+ return (<div key={popupPaytableRow.prefix} className="symbol-popup__row">
50
+ <div className="symbol-popup__prefix">{popupPaytableRow.prefix}x</div>
51
+ {getPaytableValueDetails(popupPaytableRow.value, settingStore.bet)}
52
+ </div>);
53
+ })}
54
+ </div>
55
+ </div>);
46
56
  }
47
- return _jsx("div", {});
57
+ return <div></div>;
48
58
  });
@@ -1,4 +1,5 @@
1
1
  import "./uxsettings.css";
2
- export declare const UXSettings: (() => import("react/jsx-runtime").JSX.Element) & {
2
+ import React from "react";
3
+ export declare const UXSettings: (() => React.JSX.Element) & {
3
4
  displayName: string;
4
5
  };
@@ -0,0 +1,30 @@
1
+ import "./uxsettings.css";
2
+ import { observer } from "mobx-react-lite";
3
+ import React from "react";
4
+ import { useStores } from "../../hooks";
5
+ import { SpeedButtonWithHeader, SwitchWithHeader } from "../SwitchWithHeader";
6
+ export const UXSettings = observer(() => {
7
+ 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>
28
+ </div>
29
+ </div>);
30
+ });
@@ -1,5 +1,6 @@
1
1
  import "rc-slider/assets/index.css";
2
2
  import "./volume.css";
3
- export declare const VolumeSettings: (() => import("react/jsx-runtime").JSX.Element) & {
3
+ import React from "react";
4
+ export declare const VolumeSettings: (() => React.JSX.Element) & {
4
5
  displayName: string;
5
6
  };
@@ -0,0 +1,46 @@
1
+ import "rc-slider/assets/index.css";
2
+ import "./volume.css";
3
+ import { observer } from "mobx-react-lite";
4
+ import Slider from "rc-slider";
5
+ import React from "react";
6
+ import { RainMan } from "../../../Rainman";
7
+ import { useStores } from "../../hooks";
8
+ const handleStyle = { width: "7px", height: "24px", bottom: "-6px", borderRadius: "4px" };
9
+ const onChange = (newVolumeLevel) => {
10
+ RainMan.settingsStore.setVolumeLevel(newVolumeLevel);
11
+ RainMan.settingsStore.setIsSoundEnabled(newVolumeLevel > 0 && !RainMan.settingsStore.isSoundEnabled);
12
+ };
13
+ export const VolumeSettings = observer(() => {
14
+ const { settingStore } = useStores();
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={settingStore.volumeLevel === 0
18
+ ? {
19
+ backgroundColor: "#FA5F27",
20
+ borderColor: "#FA5F27",
21
+ ...handleStyle,
22
+ }
23
+ : {
24
+ backgroundColor: "#2FC408",
25
+ borderColor: "#2FC408",
26
+ ...handleStyle,
27
+ }} railStyle={{
28
+ backgroundColor: "#fff",
29
+ }} trackStyle={{
30
+ backgroundColor: "#fff",
31
+ height: "5px",
32
+ borderRadius: "1px",
33
+ }} dotStyle={{
34
+ borderColor: "#2FC408",
35
+ }} onChange={onChange}/>
36
+ <p className="volume-control__text" style={settingStore.volumeLevel === 0
37
+ ? {
38
+ color: "#FA5F27",
39
+ }
40
+ : {
41
+ color: "#2FC408",
42
+ }}>
43
+ {settingStore.volumeLevel}
44
+ </p>
45
+ </div>);
46
+ });
@@ -1,2 +1,3 @@
1
1
  import "./index.css";
2
- export declare const SettingsUI: () => import("react/jsx-runtime").JSX.Element;
2
+ import React from "react";
3
+ export declare const SettingsUI: () => React.JSX.Element;
@@ -0,0 +1,30 @@
1
+ import "./index.css";
2
+ import React from "react";
3
+ import { UI_ITEMS } from "../utils";
4
+ import { AutoplaySettings, BuyFreeSpinModal, GameRules, SpeedSettingsPopup, SymbolMultiplierPopup, VolumeSettings, } from "./components";
5
+ import { SystemSettingsComponent } from "./SystemSettings/SystemSettingsComponent";
6
+ export const SettingsUI = () => {
7
+ return (<>
8
+ <div id={UI_ITEMS.settings} className="modal modal-style">
9
+ <SystemSettingsComponent />
10
+ </div>
11
+ <div id={UI_ITEMS.gameRules} className="modal modal-style">
12
+ <GameRules />
13
+ </div>
14
+ <div id={UI_ITEMS.volume} className="volume-modal modal-style">
15
+ <VolumeSettings />
16
+ </div>
17
+ <div id={UI_ITEMS.autoplay} className="modal modal-style">
18
+ <AutoplaySettings />
19
+ </div>
20
+ <div id={UI_ITEMS.speedSettings} className="speed-settings-modal modal-style">
21
+ <SpeedSettingsPopup />
22
+ </div>
23
+ <div id={UI_ITEMS.symbolPayTable}>
24
+ <SymbolMultiplierPopup />
25
+ </div>
26
+ <div id={UI_ITEMS.freeSpin} className="modal modal-style">
27
+ <BuyFreeSpinModal />
28
+ </div>
29
+ </>);
30
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "This repository contains all of the mechanics that used in rainman games.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "./systemSettings.css";
3
- import i18next from "i18next";
4
- import { UI_ITEMS } from "../../utils";
5
- import { BetComponent, CloseModalButton, UXSettings } from "../components";
6
- export const SystemSettingsComponent = () => {
7
- return (_jsxs("div", { className: "settings", children: [_jsx("div", { className: "settings__title", children: _jsx("h2", { children: i18next.t("systemSettings") }) }), _jsx(CloseModalButton, { layerId: UI_ITEMS.settings }), _jsxs("div", { className: "settings__column", children: [_jsx(BetComponent, {}), _jsx(UXSettings, {})] })] }));
8
- };
@@ -1,76 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "react-custom-scroll/dist/customScroll.css";
3
- import "./autoplaySettings.css";
4
- import i18next from "i18next";
5
- import { observer } from "mobx-react-lite";
6
- import { useEffect, useState } from "react";
7
- import { COMPONENTS } from "../../../components";
8
- import { UI_ITEMS } from "../../../utils";
9
- import { useStores } from "../../hooks";
10
- import { closeModal, CloseModalButton } from "../CloseModalButton";
11
- import { RichLimitingSlider } from "../RichLimitingSlider";
12
- import { SpeedButtonWithHeader, SwitchWithHeader } from "../SwitchWithHeader";
13
- export const AutoplaySettings = observer(() => {
14
- const [limit_numbers, setLimitNumbers] = useState([0]);
15
- const initialAutoSpinCount = 50;
16
- const availableAutoSpinLimits = [10, 20, 50, 100, 150, 200, 250, 300, 350, 400, 500, 600, 700, 800, 900, 1000];
17
- const { settingStore } = useStores();
18
- const calculateLimitBounds = (indexOfSelectedLimit) => {
19
- let bottomLimitIndex = indexOfSelectedLimit - 2;
20
- let topLimitIndex = indexOfSelectedLimit + 1;
21
- if (bottomLimitIndex < 0) {
22
- bottomLimitIndex = availableAutoSpinLimits.length - -bottomLimitIndex;
23
- }
24
- if (topLimitIndex === availableAutoSpinLimits.length) {
25
- topLimitIndex = 0;
26
- }
27
- return {
28
- bottomLimitIndex,
29
- topLimitIndex,
30
- };
31
- };
32
- const updateLimitsBounds = (newLimit) => {
33
- setAutoSpinsCount(newLimit);
34
- const indexOfSelectedSpinsLimit = availableAutoSpinLimits.findIndex((limitCount) => limitCount === newLimit);
35
- if (indexOfSelectedSpinsLimit === -1) {
36
- }
37
- const { bottomLimitIndex, topLimitIndex } = calculateLimitBounds(indexOfSelectedSpinsLimit);
38
- const limitNumbersIndexes = [];
39
- for (let index = bottomLimitIndex; index !== topLimitIndex + 1; index++) {
40
- if (index === availableAutoSpinLimits.length) {
41
- index = 0;
42
- }
43
- limitNumbersIndexes.push(availableAutoSpinLimits[index]);
44
- if (limitNumbersIndexes.length === 4) {
45
- break;
46
- }
47
- }
48
- setLimitNumbers(limitNumbersIndexes);
49
- };
50
- useEffect(() => {
51
- updateLimitsBounds(initialAutoSpinCount);
52
- }, []);
53
- const { singleWinExceeds, balancedIncreased, balancedDecreased, howManyAutoSpinsLeft, infinitySpinsEnabled, setSingleWinExceeds, setBalancedIncreased, setBalancedDecreased, setAutoSpinsCount, flipInfinitySpinsFlag, resetAutoplaySettings, } = settingStore;
54
- return (_jsxs("div", { className: "autoplay-settings", children: [_jsx(CloseModalButton, { layerId: UI_ITEMS.autoplay }), _jsx("div", { className: "autoplay-settings__title", children: _jsx("h2", { children: i18next.t("autoPlay") }) }), _jsxs("div", { className: "autoplay-settings__stop-limits", children: [_jsx("div", { className: `autoplay-settings__limit left ${infinitySpinsEnabled ? "autoplay-settings__limit--infinity" : ""}`, onClick: () => {
55
- let indexOfSelectedSpinsLimit = availableAutoSpinLimits.findIndex((limitCount) => limitCount === howManyAutoSpinsLeft);
56
- indexOfSelectedSpinsLimit -= 1;
57
- if (indexOfSelectedSpinsLimit === -1) {
58
- indexOfSelectedSpinsLimit = availableAutoSpinLimits.length - 1;
59
- }
60
- updateLimitsBounds(availableAutoSpinLimits[indexOfSelectedSpinsLimit]);
61
- }, children: _jsx("p", { children: "-" }) }), limit_numbers.map((limiter, index) => {
62
- return (_jsx("button", { value: limiter, className: `autoplay-settings__limit ${limiter === howManyAutoSpinsLeft ? "autoplay-settings__limit--active" : ""} middle ${infinitySpinsEnabled ? "autoplay-settings__limit--infinity" : ""}`, onClick: (event) => updateLimitsBounds(Number(event.currentTarget.value)), children: _jsx("p", { children: limiter }) }, `${limiter}${index}`));
63
- }), _jsx("div", { className: `autoplay-settings__limit right ${infinitySpinsEnabled ? "autoplay-settings__limit--infinity" : ""}`, onClick: () => {
64
- let indexOfSelectedSpinsLimit = availableAutoSpinLimits.findIndex((limitCount) => limitCount === howManyAutoSpinsLeft);
65
- indexOfSelectedSpinsLimit += 1;
66
- if (indexOfSelectedSpinsLimit === availableAutoSpinLimits.length) {
67
- indexOfSelectedSpinsLimit = 0;
68
- }
69
- const newAutoSpinsLimitNumber = availableAutoSpinLimits[indexOfSelectedSpinsLimit];
70
- updateLimitsBounds(newAutoSpinsLimitNumber);
71
- }, children: _jsx("p", { children: "+" }) }), _jsx("div", { className: `autoplay-settings__limit circle ${infinitySpinsEnabled ? "autoplay-settings__limit--active" : ""}`, onClick: () => flipInfinitySpinsFlag(), children: _jsx("p", { children: "\u221E" }) })] }), _jsx("div", { className: "autoplay-settings__title", children: _jsx("h2", { children: i18next.t("stopAutoPlay") }) }), _jsxs("div", { className: "autoplay-settings__sliders", children: [_jsx(RichLimitingSlider, { value: singleWinExceeds, setValue: setSingleWinExceeds, maxValue: Number(i18next.t("ifSingleWinExceedsMax")), description: i18next.t("ifSingleWinExceedsMaxDescription") }), _jsx(RichLimitingSlider, { value: balancedIncreased, setValue: setBalancedIncreased, maxValue: Number(i18next.t("ifBalanceIncreasesBy")), description: i18next.t("ifBalanceIncreasesByDescription") }), _jsx(RichLimitingSlider, { value: balancedDecreased, setValue: setBalancedDecreased, maxValue: Number(i18next.t("ifSingleWinExceedsMax")), description: i18next.t("ifBalanceDecreaseByDescription") })] }), _jsxs("div", { className: "autoplay-settings__switches", children: [_jsx("div", { className: "autoplay-settings__switch", children: _jsx(SwitchWithHeader, { header: i18next.t("onAnyWin"), flag: settingStore.onAnyWin, setFlag: settingStore.setOnAnyWin }) }), _jsx("div", { className: "autoplay-settings__switch", children: _jsx(SpeedButtonWithHeader, { header: i18next.t("speedButtonHeader"), description: i18next.t("speedButtonDescription") }) })] }), _jsxs("div", { className: "autoplay-settings__confirmation", children: [_jsx("div", { className: "autoplay-settings__confirmation-button", onClick: () => {
72
- resetAutoplaySettings();
73
- updateLimitsBounds(initialAutoSpinCount);
74
- closeModal(UI_ITEMS.autoplay);
75
- }, children: _jsx("p", { children: i18next.t("cancel") }) }), _jsx("div", { id: COMPONENTS.autoSpinConfirm, className: "autoplay-settings__confirmation-button", onClick: () => closeModal(UI_ITEMS.autoplay), children: _jsx("p", { children: i18next.t("confirm") }) })] })] }));
76
- });
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "./bet.css";
3
- import { observer } from "mobx-react-lite";
4
- import { useStores } from "../../hooks";
5
- export const BetComponent = observer(() => {
6
- const { settingStore } = useStores();
7
- return (_jsxs("div", { className: "bet-container", children: [_jsx("h2", { children: "Total bet" }), _jsxs("div", { className: "bet-container__controls", children: [_jsx("button", { name: "bet-minus", className: "bet-container__button", children: "-" }), _jsx("div", { className: "bet-container__value", children: _jsx("p", { children: settingStore.betText }) }), _jsx("button", { name: "bet-plus", className: "bet-container__button", children: "+" })] })] }));
8
- });
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "./buyFreeSpin.css";
3
- import { useState } from "react";
4
- import { Currencies } from "ts-money";
5
- import { UI_ITEMS } from "../../../utils";
6
- import { useBuyFreeSpinOptions } from "../../hooks";
7
- import { CloseModalButton } from "../CloseModalButton";
8
- import { OptionButton } from "../OptionButton";
9
- export const BuyFreeSpinModal = () => {
10
- const [errorMessage, setErrorMessage] = useState("");
11
- const freeSpinOptions = useBuyFreeSpinOptions();
12
- const currency = Currencies[localStorage.getItem("currency")]?.symbol_native || "$";
13
- const clearErrorMessage = () => setErrorMessage("");
14
- return (_jsxs("div", { className: "buyFreeSpins__container", children: [_jsx(CloseModalButton, { layerId: UI_ITEMS.freeSpin, afterClose: clearErrorMessage }), _jsx("div", { className: "buyFreeSpins__title-container", children: _jsx("h1", { children: "Buy Free Spins" }) }), _jsx("div", { className: "buyFreeSpins__buttons-container", children: freeSpinOptions.map((option) => (_jsx(OptionButton, { setMessage: setErrorMessage, option: option, currency: currency }, option.amount))) }), errorMessage ? (_jsx("div", { children: _jsx("p", { className: "buyFreeSpins__error-message", children: errorMessage }) })) : null] }));
15
- };
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "react-custom-scroll/dist/customScroll.css";
3
- import "./gameRules.css";
4
- import i18next from "i18next";
5
- import { observer } from "mobx-react-lite";
6
- import { useState } from "react";
7
- import CustomScroll from "react-custom-scroll";
8
- import { UI_ITEMS } from "../../../utils";
9
- import { closeModal, CloseModalButton } from "../CloseModalButton";
10
- import { gameRulesContent } from "./data";
11
- export const GameRules = observer(() => {
12
- const [pageNumber, setPageNumber] = useState(0);
13
- const changePage = (incrementor) => {
14
- const numberOfPages = gameRulesContent.pages.length;
15
- if (pageNumber + incrementor === numberOfPages) {
16
- setPageNumber(0);
17
- return;
18
- }
19
- if (pageNumber + incrementor === -1) {
20
- setPageNumber(numberOfPages - 1);
21
- return;
22
- }
23
- setPageNumber(pageNumber + incrementor);
24
- };
25
- return (_jsxs("div", { className: "game-rules", children: [_jsx("div", { className: "settings__title", children: _jsx("h2", { children: i18next.t("gameRules") }) }), _jsx(CloseModalButton, { layerId: UI_ITEMS.gameRules }), _jsx("div", { className: "game-rules__container custom-scroll", children: _jsx(CustomScroll, { className: "game-rules__scroll", allowOuterScroll: true, children: _jsx("div", { className: "game-rules__content", children: gameRulesContent.pages[pageNumber] }) }) }), _jsxs("div", { className: "game-rules__page-control", children: [_jsx("div", { className: "page-left", onClick: () => changePage(-1) }), _jsx("div", { className: "page-middle", onClick: () => closeModal(UI_ITEMS.gameRules) }), _jsx("div", { className: "page-right", onClick: () => changePage(1) })] })] }));
26
- });
@@ -1,20 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "rc-slider/assets/index.css";
3
- import "./richLimitingSlider.css";
4
- import { observer } from "mobx-react-lite";
5
- import Slider from "rc-slider";
6
- export const RichLimitingSlider = observer(({ value, setValue, maxValue, description }) => {
7
- return (_jsxs("div", { className: "rich-slider", children: [_jsx(Slider, { className: "rich-slider__slider", step: 1, min: 0, max: maxValue, defaultValue: value, value: value, handleStyle: {
8
- backgroundColor: "#fdf425",
9
- borderColor: "#fdf425",
10
- width: "20px",
11
- height: "20px",
12
- bottom: "-4px",
13
- }, railStyle: {
14
- backgroundColor: "#fff",
15
- }, trackStyle: {
16
- backgroundColor: "#fdf425",
17
- }, dotStyle: {
18
- borderColor: "#fdf425",
19
- }, onChange: (value) => setValue(value), children: _jsx("p", { className: "rich-slider__description", children: description }) }), _jsx("div", { className: "rich-slider__number", children: value })] }));
20
- });
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "./slidingSwitch.css";
3
- import { observer } from "mobx-react-lite";
4
- export const SlidingSwitch = observer(({ flag, setFlag }) => {
5
- return (_jsxs("label", { className: "switch", children: [_jsx("span", { className: `switch-round-box round ${flag ? "switch-round-box--active" : ""}` }), _jsx("input", { type: "checkbox", defaultChecked: flag, onChange: (event) => setFlag(event.target.checked) }), _jsx("p", { className: `switch__text ${flag ? "switch__text--active" : ""}`, children: flag ? "ON" : "OFF" })] }));
6
- });
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "react-custom-scroll/dist/customScroll.css";
3
- import "./speedSettingsPopup.css";
4
- import i18next from "i18next";
5
- import { observer } from "mobx-react-lite";
6
- import { SPEED_LEVELS } from "../../../application";
7
- import { UI_ITEMS } from "../../../utils";
8
- import { useStores } from "../../hooks";
9
- import { CloseModalButton } from "../CloseModalButton";
10
- export const SPEED_PREFIX = "speed-";
11
- export const SpeedSettingsPopup = observer(() => {
12
- const speedLevelMapper = {
13
- slow: SPEED_LEVELS.slow,
14
- normal: SPEED_LEVELS.normal,
15
- fast: SPEED_LEVELS.fast,
16
- };
17
- const { settingStore } = useStores();
18
- return (_jsxs("div", { className: "speed-settings-popup", children: [_jsx(CloseModalButton, { layerId: UI_ITEMS.speedSettings }), _jsx("div", { className: "speed-settings-popup__title", children: i18next.t("howDoYouWantToPlay") }), _jsx("div", { className: "speed-settings-popup__speed-options", children: Object.keys(speedLevelMapper).map((speedLevelKey) => (_jsx("div", { id: `${SPEED_PREFIX}${speedLevelKey}`, className: `speed-settings-popup__option ${speedLevelKey === settingStore.currentSpeed ? "speed-settings-popup_option--active" : ""}`, children: _jsx("img", { className: `speed-settings-popup__icon ${speedLevelMapper[speedLevelKey]}`, src: `../../../assets/settings/speedPopup/speed-${speedLevelMapper[speedLevelKey]}.png` }) }, `${SPEED_PREFIX}${speedLevelKey}`))) })] }));
19
- });
@@ -1,13 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { observer } from "mobx-react-lite";
3
- import { useStores } from "../../hooks";
4
- export const SpeedButtonSwitch = observer(() => {
5
- const speedLevelMapper = {
6
- slow: "turtle",
7
- normal: "rabbit",
8
- fast: "cheetah",
9
- };
10
- const { settingStore } = useStores();
11
- const { currentSpeed } = settingStore;
12
- return (_jsxs("label", { className: "switch turtle-switch speed-level-id", children: [_jsx("span", { className: "turtle-switch-round-box" }), _jsx("img", { className: "turtle-switch__icon", src: `assets/settings/speed-${speedLevelMapper[currentSpeed]}.png` }), _jsx("div", { className: "dot-container", children: Array.from({ length: 3 }).map((_, i) => (_jsx("div", { className: `white-dot ${i < settingStore.indexOfSpeedLevel ? "white-dot--active" : ""}` }, i))) })] }));
13
- });
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "./headerStyle.css";
3
- import { observer } from "mobx-react-lite";
4
- import { SlidingSwitch } from "../SlidingSwitch";
5
- import { SpeedButtonSwitch } from "../SpeedSwitchButton";
6
- export const HeaderWithDescription = ({ header, description }) => {
7
- return (_jsxs("div", { className: "header-description", children: [_jsx("h2", { className: "header-description__title", children: header }), description && _jsx("h6", { className: "header-description__text", children: description })] }));
8
- };
9
- export const SwitchWithHeader = observer(({ header, description, flag, setFlag }) => {
10
- return (_jsxs("div", { className: "flex-containers-stretched", children: [_jsx(HeaderWithDescription, { header: header, description: description }), _jsx(SlidingSwitch, { flag: flag, setFlag: setFlag })] }));
11
- });
12
- export const SpeedButtonWithHeader = observer(({ header, description }) => {
13
- return (_jsxs("div", { className: "flex-containers-stretched", children: [_jsx(HeaderWithDescription, { header: header, description: description }), _jsx(SpeedButtonSwitch, {})] }));
14
- });
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "./uxsettings.css";
3
- import { observer } from "mobx-react-lite";
4
- import { useStores } from "../../hooks";
5
- import { SpeedButtonWithHeader, SwitchWithHeader } from "../SwitchWithHeader";
6
- export const UXSettings = observer(() => {
7
- const { settingStore } = useStores();
8
- return (_jsx("div", { className: "ux-settings", children: _jsxs("div", { className: "ux-settings__switch-container", children: [_jsx("div", { className: "ux-settings__switch", children: _jsx(SpeedButtonWithHeader, { header: "Quick Spin", description: "Play faster by reducing total spin time" }) }), _jsx("div", { className: "ux-settings__switch", children: _jsx(SwitchWithHeader, { header: "Battery saver", description: "Safe battery life by reducing animation speed", flag: settingStore.batterySaverFlag, setFlag: settingStore.setBatteryFlag }) }), _jsx("div", { className: "ux-settings__switch", children: _jsx(SwitchWithHeader, { header: "Ambient music", description: "Turn on or off the game music", flag: settingStore.ambientMusicFlag, setFlag: settingStore.setAmbientMusicFlag }) }), _jsx("div", { className: "ux-settings__switch", children: _jsx(SwitchWithHeader, { header: "Sound fx", description: "Turn on or off the game sounds", flag: settingStore.soundFxFlag, setFlag: settingStore.setSoundFxFlag }) }), _jsx("div", { className: "ux-settings__switch", children: _jsx(SwitchWithHeader, { header: "Full screen mode", description: "Turn on or off game fullscreen", flag: settingStore.fullScreenFlag, setFlag: settingStore.setFullScreenFlag }) }), _jsx("div", { className: "ux-settings__switch", children: _jsx(SwitchWithHeader, { header: "HI resolution", description: "Enable high resolution files", flag: settingStore.HiResolutionFlag, setFlag: settingStore.setHiResolutionFlag }) })] }) }));
9
- });
@@ -1,40 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "rc-slider/assets/index.css";
3
- import "./volume.css";
4
- import { observer } from "mobx-react-lite";
5
- import Slider from "rc-slider";
6
- import { RainMan } from "../../../Rainman";
7
- import { useStores } from "../../hooks";
8
- const handleStyle = { width: "7px", height: "24px", bottom: "-6px", borderRadius: "4px" };
9
- const onChange = (newVolumeLevel) => {
10
- RainMan.settingsStore.setVolumeLevel(newVolumeLevel);
11
- RainMan.settingsStore.setIsSoundEnabled(newVolumeLevel > 0 && !RainMan.settingsStore.isSoundEnabled);
12
- };
13
- export const VolumeSettings = observer(() => {
14
- const { settingStore } = useStores();
15
- return (_jsxs("div", { className: "volume-control", children: [_jsx("div", { className: "volume-control__volume-icon" }), _jsx(Slider, { className: "volume-control__slider", step: 1, min: 0, max: 100, value: settingStore.volumeLevel, handleStyle: settingStore.volumeLevel === 0
16
- ? {
17
- backgroundColor: "#FA5F27",
18
- borderColor: "#FA5F27",
19
- ...handleStyle,
20
- }
21
- : {
22
- backgroundColor: "#2FC408",
23
- borderColor: "#2FC408",
24
- ...handleStyle,
25
- }, railStyle: {
26
- backgroundColor: "#fff",
27
- }, trackStyle: {
28
- backgroundColor: "#fff",
29
- height: "5px",
30
- borderRadius: "1px",
31
- }, dotStyle: {
32
- borderColor: "#2FC408",
33
- }, onChange: onChange }), _jsx("p", { className: "volume-control__text", style: settingStore.volumeLevel === 0
34
- ? {
35
- color: "#FA5F27",
36
- }
37
- : {
38
- color: "#2FC408",
39
- }, children: settingStore.volumeLevel })] }));
40
- });
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "./index.css";
3
- import { UI_ITEMS } from "../utils";
4
- import { AutoplaySettings, BuyFreeSpinModal, GameRules, SpeedSettingsPopup, SymbolMultiplierPopup, VolumeSettings, } from "./components";
5
- import { SystemSettingsComponent } from "./SystemSettings/SystemSettingsComponent";
6
- export const SettingsUI = () => {
7
- return (_jsxs(_Fragment, { children: [_jsx("div", { id: UI_ITEMS.settings, className: "modal modal-style", children: _jsx(SystemSettingsComponent, {}) }), _jsx("div", { id: UI_ITEMS.gameRules, className: "modal modal-style", children: _jsx(GameRules, {}) }), _jsx("div", { id: UI_ITEMS.volume, className: "volume-modal modal-style", children: _jsx(VolumeSettings, {}) }), _jsx("div", { id: UI_ITEMS.autoplay, className: "modal modal-style", children: _jsx(AutoplaySettings, {}) }), _jsx("div", { id: UI_ITEMS.speedSettings, className: "speed-settings-modal modal-style", children: _jsx(SpeedSettingsPopup, {}) }), _jsx("div", { id: UI_ITEMS.symbolPayTable, children: _jsx(SymbolMultiplierPopup, {}) }), _jsx("div", { id: UI_ITEMS.freeSpin, className: "modal modal-style", children: _jsx(BuyFreeSpinModal, {}) })] }));
8
- };