Skip to content

Commit f96df8f

Browse files
Add some changes
1 parent 5624536 commit f96df8f

File tree

11 files changed

+1466
-20
lines changed

11 files changed

+1466
-20
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ JS Slot Machine is a Progressive web app with a regular slot machine game that h
1414
- AutoSpin capability;
1515
- Free spinnings;
1616
- Bonus WildCards;
17-
- Big winning due to win amout multipliers;
17+
- Big winning due to win amount multipliers;
1818
- Special Symbols;
1919

2020
- ![image](https://user-images.githubusercontent.com/43031902/173920878-d7fe0088-e3c7-486e-a544-32e149eabd07.png)

craco.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ module.exports = {
55
alias: {
66
'@': path.resolve(__dirname, 'src'),
77
},
8+
module: {
9+
rules: [
10+
{
11+
test: /\.ts$/,
12+
use: 'ts-loader',
13+
exclude: /node_modules/,
14+
},
15+
],
16+
},
817
},
918
style: {
1019
sass: {

package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"test:e2e": "cypress open",
4141
"gen-scss-types": "typed-scss-modules src --additionalData \"@import './assets/styles/_index.scss';\" --nameFormat none --exportType default",
4242
"deploy": "gh-pages -d build",
43+
"worker": "webpack --watch",
4344
"eject": "react-scripts eject"
4445
},
4546
"eslintConfig": {
@@ -73,9 +74,13 @@
7374
"@types/react-dom": "^18.0.5",
7475
"@types/react-transition-group": "^4.4.4",
7576
"cypress": "^9.5.4",
76-
"sass": "^1.52.2",
77+
"sass": "^1.52.3",
78+
"sass-loader": "^13.0.0",
79+
"style-loader": "^3.3.1",
7780
"ts-jest": "^28.0.4",
78-
"typed-scss-modules": "^6.5.0"
81+
"ts-loader": "^9.3.0",
82+
"typed-scss-modules": "^6.5.0",
83+
"webpack-cli": "^4.10.0"
7984
},
8085
"cracoConfig": "craco.config.js",
8186
"jest": {

public/worker.js

+1,283
Large diffs are not rendered by default.

src/assets/svg/close.svg

-3
This file was deleted.

src/components/game/WinsDisplay/styles.module.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@
105105

106106
&:after {
107107
line-height: 2rem;
108-
font-size: 2rem;
108+
font-size: 1.7rem;
109109
color: $color-white;
110110
text-align: center;
111111
content: '\21BA';
112-
top: -0.2rem;
112+
top: -0.1rem;
113113
}
114114
}
115115
}

src/components/ui/Modal/styles.module.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
-o-border-radius: 0.25rem;
4747
color: var(--color-font);
4848
font-family: $font-primary;
49-
width: 90%;
49+
min-width: 90%;
5050
position: absolute;
5151
top: 0;
5252
bottom: 0;
@@ -110,6 +110,7 @@
110110
.modal {
111111
&__content {
112112
width: max-content;
113+
min-width: 20rem;
113114
}
114115
}
115116
}

src/locales/pt/translation.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"about": {
3-
"description": "JS Slots Machine é composto por 5 reels 8com mais de 30 símbolos cada) e 3 linhas. O jogo segue as regras dos jogos slot tradicionais, i.e, os símbolos do jogo rodam e depois o verifica-se se existem coombinações de 3 ou mais símbolos iguais numa das 9 linhas de pagamento existentes.",
3+
"description": "JS Slots Machine é composto por 5 reels (com mais de 30 símbolos cada) e 3 linhas. O jogo segue as regras dos jogos slot tradicionais, i.e, os símbolos do jogo rodam e depois o verifica-se se existem coombinações de 3 ou mais símbolos iguais numa das 9 linhas de pagamento existentes.",
44
"specialSymbols": "Símbolos especiais",
55
"explosive": "Explosivo",
6-
"explosiveDescription": "Símbolos Explosivos numa linha de 3 a 5 multiplica o ganhos por 3-5, respectivamente.",
6+
"explosiveDescription": "Símbolos Explosivos numa linha de 3 a 5 multiplicam os ganhos por 3-5, respectivamente.",
77
"scatter": "Scatter",
88
"scatterDescription": "Símbolos Scatter numa linha de 3 a 5 dão 10 rodadas grátis.",
99
"wildcard": "WildCard",

src/workers/shuffle-worker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { getRandomNumber } from '@/utils';
12
import { getShuffledReels } from '../game-utils';
23
import { Symbol } from '../types';
34

@@ -7,7 +8,6 @@ export type WorkerPostMessageData = {
78

89
/* eslint-disable-next-line no-restricted-globals */
910
self.onmessage = (event: MessageEvent) => {
10-
console.log(99999);
1111
const reels = getShuffledReels();
1212

1313
/* eslint-disable-next-line no-restricted-globals */

webpack.config.js

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
const path = require('path');
2+
const webpack = require('webpack');
3+
4+
const src = path.resolve(__dirname, './src');
5+
const build = path.resolve(__dirname, './public');
6+
const tsLoader = {
7+
loader: 'ts-loader',
8+
options: { compilerOptions: { module: 'esnext', noEmit: false } },
9+
};
10+
11+
module.exports = {
12+
mode: 'none',
13+
target: 'webworker',
14+
entry: './src/workers/shuffle-worker.ts',
15+
output: {
16+
filename: 'worker.js',
17+
path: build,
18+
},
19+
resolve: {
20+
modules: ['node_modules', src],
21+
extensions: ['.js', '.json', '.jsx', '.ts', '.tsx'],
22+
},
23+
alias: {
24+
'@': path.resolve(__dirname, 'src'),
25+
},
26+
plugins: [
27+
new webpack.HotModuleReplacementPlugin(),
28+
new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('development') }),
29+
],
30+
module: {
31+
rules: [
32+
{
33+
test: /\.ts?$/,
34+
use: [tsLoader],
35+
},
36+
{
37+
test: /\.s[ac]ss$/i,
38+
use: [
39+
'style-loader',
40+
'css-loader',
41+
{
42+
loader: 'sass-loader',
43+
options: {
44+
// Prefer `dart-sass`
45+
implementation: require('sass'),
46+
},
47+
},
48+
],
49+
},
50+
],
51+
},
52+
};

0 commit comments

Comments
 (0)