Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
21_22-J 38
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
21_22-J 38
21_22-J 38
Commits
73d032b1
Commit
73d032b1
authored
Apr 30, 2022
by
Neranga K.T.
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'it18256888' into 'master'
It18256888 See merge request
!166
parents
e38c0128
7712c073
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
287 additions
and
360 deletions
+287
-360
backend/IT18256888/app.py
backend/IT18256888/app.py
+8
-7
frontend/package-lock.json
frontend/package-lock.json
+24
-144
frontend/src/constants/Countdown.js
frontend/src/constants/Countdown.js
+5
-0
frontend/src/constants/endpoint.js
frontend/src/constants/endpoint.js
+1
-0
frontend/src/memory/data/elementry-level.js
frontend/src/memory/data/elementry-level.js
+67
-0
frontend/src/memory/models/gamedataone.js
frontend/src/memory/models/gamedataone.js
+10
-0
frontend/src/router/router.js
frontend/src/router/router.js
+1
-1
frontend/src/screen/memory/GameOverScreen.js
frontend/src/screen/memory/GameOverScreen.js
+3
-2
frontend/src/screen/memory/elementry/GameScreenFive.js
frontend/src/screen/memory/elementry/GameScreenFive.js
+2
-1
frontend/src/screen/memory/elementry/GameScreenFiveAll.js
frontend/src/screen/memory/elementry/GameScreenFiveAll.js
+26
-33
frontend/src/screen/memory/elementry/GameScreenFour.js
frontend/src/screen/memory/elementry/GameScreenFour.js
+2
-1
frontend/src/screen/memory/elementry/GameScreenFourAll.js
frontend/src/screen/memory/elementry/GameScreenFourAll.js
+26
-33
frontend/src/screen/memory/elementry/GameScreenOne.js
frontend/src/screen/memory/elementry/GameScreenOne.js
+2
-1
frontend/src/screen/memory/elementry/GameScreenOneAll.js
frontend/src/screen/memory/elementry/GameScreenOneAll.js
+26
-35
frontend/src/screen/memory/elementry/GameScreenSix.js
frontend/src/screen/memory/elementry/GameScreenSix.js
+2
-1
frontend/src/screen/memory/elementry/GameScreenSixAll.js
frontend/src/screen/memory/elementry/GameScreenSixAll.js
+26
-33
frontend/src/screen/memory/elementry/GameScreenThree.js
frontend/src/screen/memory/elementry/GameScreenThree.js
+2
-1
frontend/src/screen/memory/elementry/GameScreenThreeAll.js
frontend/src/screen/memory/elementry/GameScreenThreeAll.js
+26
-33
frontend/src/screen/memory/elementry/GameScreenTwo.js
frontend/src/screen/memory/elementry/GameScreenTwo.js
+2
-1
frontend/src/screen/memory/elementry/GameScreenTwoAll.js
frontend/src/screen/memory/elementry/GameScreenTwoAll.js
+26
-33
No files found.
backend/IT18256888/app.py
View file @
73d032b1
...
@@ -60,13 +60,14 @@ def get_level():
...
@@ -60,13 +60,14 @@ def get_level():
results
=
[{
"level"
:
float
(
result
)}]
results
=
[{
"level"
:
float
(
result
)}]
return
(
jsonify
(
results
=
results
))
return
(
jsonify
(
results
=
results
))
userpass
=
'mysql://root:''@'
# userpass = 'mysql://root:''@'
basedir
=
'127.0.0.1'
# basedir = '127.0.0.1'
dbname
=
'/helply'
# dbname = '/helply'
socket
=
'?unix_socket=/opt/lampp/var/mysql/mysql.sock'
# socket = '?unix_socket=/opt/lampp/var/mysql/mysql.sock'
dbname
=
dbname
+
socket
# dbname = dbname + socket
app
.
config
[
'SQLALCHEMY_DATABASE_URI'
]
=
userpass
+
basedir
+
dbname
# app.config['SQLALCHEMY_DATABASE_URI'] = userpass + basedir + dbname
app
.
config
[
'SQLALCHEMY_DATABASE_URI'
]
=
'mysql://sql5488870:UylH12yrME@sql5.freesqldatabase.com/sql5488870'
app
.
config
[
'SQLALCHEMY_TRACK_MODIFICATIONS'
]
=
False
app
.
config
[
'SQLALCHEMY_TRACK_MODIFICATIONS'
]
=
False
#DB Connection
#DB Connection
...
...
frontend/package-lock.json
View file @
73d032b1
{
{
"name": "firstapp",
"name": "firstapp",
"version": "0.0.1",
"version": "0.0.1",
"lockfileVersion":
2
,
"lockfileVersion":
1
,
"requires": true,
"requires": true,
"packages": {
"packages": {
"": {
"": {
...
@@ -18387,8 +18387,7 @@
...
@@ -18387,8 +18387,7 @@
"version": "22.4.1",
"version": "22.4.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.4.1.tgz",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.4.1.tgz",
"integrity": "sha512-gcLfn6P2PrFAVx3AobaOzlIEevpAEf9chTpFZz7bYfc7pz8XRv7vuKTIE4hxPKZSha6XWKKplDQ0x9Pq8xX2mg==",
"integrity": "sha512-gcLfn6P2PrFAVx3AobaOzlIEevpAEf9chTpFZz7bYfc7pz8XRv7vuKTIE4hxPKZSha6XWKKplDQ0x9Pq8xX2mg==",
"dev": true,
"dev": true
"requires": {}
},
},
"eslint-plugin-prettier": {
"eslint-plugin-prettier": {
"version": "3.1.2",
"version": "3.1.2",
...
@@ -18437,8 +18436,7 @@
...
@@ -18437,8 +18436,7 @@
"version": "4.2.0",
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz",
"resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz",
"integrity": "sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==",
"integrity": "sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==",
"dev": true,
"dev": true
"requires": {}
},
},
"eslint-plugin-react-native": {
"eslint-plugin-react-native": {
"version": "3.11.0",
"version": "3.11.0",
...
@@ -18479,8 +18477,7 @@
...
@@ -18479,8 +18477,7 @@
"@react-native-community/netinfo": {
"@react-native-community/netinfo": {
"version": "7.1.12",
"version": "7.1.12",
"resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-7.1.12.tgz",
"resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-7.1.12.tgz",
"integrity": "sha512-fkCRkOgzfdD0sr8JTasDgm716l8bJPkCNjXIyllG8K+UyixVa68lroQmgW9pewE5G5p43I9MWPtGZR/kVowBzg==",
"integrity": "sha512-fkCRkOgzfdD0sr8JTasDgm716l8bJPkCNjXIyllG8K+UyixVa68lroQmgW9pewE5G5p43I9MWPtGZR/kVowBzg=="
"requires": {}
},
},
"@react-native-voice/voice": {
"@react-native-voice/voice": {
"version": "3.2.3",
"version": "3.2.3",
...
@@ -18543,8 +18540,7 @@
...
@@ -18543,8 +18540,7 @@
"@react-navigation/elements": {
"@react-navigation/elements": {
"version": "1.2.1",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-1.2.1.tgz",
"resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-1.2.1.tgz",
"integrity": "sha512-EnmAbKMsptrliRKf95rdgS6BhMjML+mIns06+G1Vdih6BrEo7/0iytThUv3WBf99AI76dyEq/cqLUwHPiFzXWg==",
"integrity": "sha512-EnmAbKMsptrliRKf95rdgS6BhMjML+mIns06+G1Vdih6BrEo7/0iytThUv3WBf99AI76dyEq/cqLUwHPiFzXWg=="
"requires": {}
},
},
"@react-navigation/native": {
"@react-navigation/native": {
"version": "6.0.6",
"version": "6.0.6",
...
@@ -18833,8 +18829,7 @@
...
@@ -18833,8 +18829,7 @@
"@react-types/shared": {
"@react-types/shared": {
"version": "3.9.0",
"version": "3.9.0",
"resolved": "https://registry.npmjs.org/@react-types/shared/-/shared-3.9.0.tgz",
"resolved": "https://registry.npmjs.org/@react-types/shared/-/shared-3.9.0.tgz",
"integrity": "sha512-YYksINfR6q92P10AhPEGo47Hd7oz1hrnZ6Vx8Gsrq62IbqDdv1XOTzPBaj17Z1ymNY2pitLUSEXsLmozt4wxxQ==",
"integrity": "sha512-YYksINfR6q92P10AhPEGo47Hd7oz1hrnZ6Vx8Gsrq62IbqDdv1XOTzPBaj17Z1ymNY2pitLUSEXsLmozt4wxxQ=="
"requires": {}
},
},
"@react-types/slider": {
"@react-types/slider": {
"version": "3.0.2",
"version": "3.0.2",
...
@@ -19203,8 +19198,7 @@
...
@@ -19203,8 +19198,7 @@
"version": "5.3.2",
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
"integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
"integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
"dev": true,
"dev": true
"requires": {}
},
},
"acorn-walk": {
"acorn-walk": {
"version": "7.2.0",
"version": "7.2.0",
...
@@ -19435,8 +19429,7 @@
...
@@ -19435,8 +19429,7 @@
"babel-core": {
"babel-core": {
"version": "7.0.0-bridge.0",
"version": "7.0.0-bridge.0",
"resolved": "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz",
"resolved": "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz",
"integrity": "sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==",
"integrity": "sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg=="
"requires": {}
},
},
"babel-jest": {
"babel-jest": {
"version": "26.6.3",
"version": "26.6.3",
...
@@ -19673,12 +19666,6 @@
...
@@ -19673,12 +19666,6 @@
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.50.tgz",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.50.tgz",
"integrity": "sha512-+O2uoQWFRo8ysZNo/rjtri2jIwjr3XfeAgRjAUADRqGG+ZITvyn8J1kvXLTaKVr3hhGXk+f23tKfdzmklVM9vQ=="
"integrity": "sha512-+O2uoQWFRo8ysZNo/rjtri2jIwjr3XfeAgRjAUADRqGG+ZITvyn8J1kvXLTaKVr3hhGXk+f23tKfdzmklVM9vQ=="
},
},
"boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
"peer": true
},
"bplist-creator": {
"bplist-creator": {
"version": "0.1.0",
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz",
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz",
...
@@ -20230,43 +20217,6 @@
...
@@ -20230,43 +20217,6 @@
"which": "^2.0.1"
"which": "^2.0.1"
}
}
},
},
"css-select": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz",
"integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==",
"peer": true,
"requires": {
"boolbase": "^1.0.0",
"css-what": "^6.0.1",
"domhandler": "^4.3.1",
"domutils": "^2.8.0",
"nth-check": "^2.0.1"
}
},
"css-tree": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
"integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==",
"peer": true,
"requires": {
"mdn-data": "2.0.14",
"source-map": "^0.6.1"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"peer": true
}
}
},
"css-what": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz",
"integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==",
"peer": true
},
"cssom": {
"cssom": {
"version": "0.4.4",
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz",
...
@@ -20421,23 +20371,6 @@
...
@@ -20421,23 +20371,6 @@
"@babel/runtime": "^7.1.2"
"@babel/runtime": "^7.1.2"
}
}
},
},
"dom-serializer": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz",
"integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==",
"peer": true,
"requires": {
"domelementtype": "^2.0.1",
"domhandler": "^4.2.0",
"entities": "^2.0.0"
}
},
"domelementtype": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
"integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
"peer": true
},
"domexception": {
"domexception": {
"version": "2.0.1",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz",
"resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz",
...
@@ -20455,26 +20388,6 @@
...
@@ -20455,26 +20388,6 @@
}
}
}
}
},
},
"domhandler": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz",
"integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==",
"peer": true,
"requires": {
"domelementtype": "^2.2.0"
}
},
"domutils": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
"integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==",
"peer": true,
"requires": {
"dom-serializer": "^1.0.1",
"domelementtype": "^2.2.0",
"domhandler": "^4.2.0"
}
},
"ee-first": {
"ee-first": {
"version": "1.1.1",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
...
@@ -20519,12 +20432,6 @@
...
@@ -20519,12 +20432,6 @@
"ansi-colors": "^4.1.1"
"ansi-colors": "^4.1.1"
}
}
},
},
"entities": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
"integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
"peer": true
},
"envinfo": {
"envinfo": {
"version": "7.8.1",
"version": "7.8.1",
"resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz",
"resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz",
...
@@ -22711,8 +22618,7 @@
...
@@ -22711,8 +22618,7 @@
"version": "1.2.2",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz",
"resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz",
"integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==",
"integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==",
"dev": true,
"dev": true
"requires": {}
},
},
"jest-regex-util": {
"jest-regex-util": {
"version": "26.0.0",
"version": "26.0.0",
...
@@ -24624,15 +24530,6 @@
...
@@ -24624,15 +24530,6 @@
"path-key": "^3.0.0"
"path-key": "^3.0.0"
}
}
},
},
"nth-check": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.1.tgz",
"integrity": "sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==",
"peer": true,
"requires": {
"boolbase": "^1.0.0"
}
},
"nullthrows": {
"nullthrows": {
"version": "1.1.1",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz",
...
@@ -25189,8 +25086,7 @@
...
@@ -25189,8 +25086,7 @@
"react-freeze": {
"react-freeze": {
"version": "1.0.0",
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/react-freeze/-/react-freeze-1.0.0.tgz",
"resolved": "https://registry.npmjs.org/react-freeze/-/react-freeze-1.0.0.tgz",
"integrity": "sha512-yQaiOqDmoKqks56LN9MTgY06O0qQHgV4FUrikH357DydArSZHQhl0BJFqGKIZoTqi8JizF9Dxhuk1FIZD6qCaw==",
"integrity": "sha512-yQaiOqDmoKqks56LN9MTgY06O0qQHgV4FUrikH357DydArSZHQhl0BJFqGKIZoTqi8JizF9Dxhuk1FIZD6qCaw=="
"requires": {}
},
},
"react-is": {
"react-is": {
"version": "17.0.2",
"version": "17.0.2",
...
@@ -25271,8 +25167,7 @@
...
@@ -25271,8 +25167,7 @@
"react-native-countdown-circle-timer": {
"react-native-countdown-circle-timer": {
"version": "3.0.9",
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/react-native-countdown-circle-timer/-/react-native-countdown-circle-timer-3.0.9.tgz",
"resolved": "https://registry.npmjs.org/react-native-countdown-circle-timer/-/react-native-countdown-circle-timer-3.0.9.tgz",
"integrity": "sha512-7djFk+2QQS9FAhfIUhwQoc+P/7Vkn9EJApr6zUWK9B5QvHP07UlqIWfhIPqqeMa4kP6y5Y2S3YL+xeRsq2tNfg==",
"integrity": "sha512-7djFk+2QQS9FAhfIUhwQoc+P/7Vkn9EJApr6zUWK9B5QvHP07UlqIWfhIPqqeMa4kP6y5Y2S3YL+xeRsq2tNfg=="
"requires": {}
},
},
"react-native-countdown-component": {
"react-native-countdown-component": {
"version": "2.7.1",
"version": "2.7.1",
...
@@ -25326,14 +25221,12 @@
...
@@ -25326,14 +25221,12 @@
"react-native-orientation-locker": {
"react-native-orientation-locker": {
"version": "1.4.0",
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/react-native-orientation-locker/-/react-native-orientation-locker-1.4.0.tgz",
"resolved": "https://registry.npmjs.org/react-native-orientation-locker/-/react-native-orientation-locker-1.4.0.tgz",
"integrity": "sha512-O/Ki7uw1lltKiTZLcTuLcSh4EzLFqXKKo2J4cLKvyG52YiEawbn/ipsZriZlWzK0mhX4dSe79CoRS4IsyUs1fw==",
"integrity": "sha512-O/Ki7uw1lltKiTZLcTuLcSh4EzLFqXKKo2J4cLKvyG52YiEawbn/ipsZriZlWzK0mhX4dSe79CoRS4IsyUs1fw=="
"requires": {}
},
},
"react-native-permissions": {
"react-native-permissions": {
"version": "3.2.0",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-3.2.0.tgz",
"resolved": "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-3.2.0.tgz",
"integrity": "sha512-UPXxf2twjYL9vPI4HP2kT15AOTY489MhsNuyAgp+wJM2IRkkSVW6rO3k4WuSRL9ZmPhwkWb9bYjf8EEwRzZcXg==",
"integrity": "sha512-UPXxf2twjYL9vPI4HP2kT15AOTY489MhsNuyAgp+wJM2IRkkSVW6rO3k4WuSRL9ZmPhwkWb9bYjf8EEwRzZcXg=="
"requires": {}
},
},
"react-native-ratings": {
"react-native-ratings": {
"version": "8.0.4",
"version": "8.0.4",
...
@@ -25357,8 +25250,7 @@
...
@@ -25357,8 +25250,7 @@
"react-native-safe-area-context": {
"react-native-safe-area-context": {
"version": "3.3.2",
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-3.3.2.tgz",
"resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-3.3.2.tgz",
"integrity": "sha512-yOwiiPJ1rk+/nfK13eafbpW6sKW0jOnsRem2C1LPJjM3tfTof6hlvV5eWHATye3XOpu2cJ7N+HdkUvUDGwFD2Q==",
"integrity": "sha512-yOwiiPJ1rk+/nfK13eafbpW6sKW0jOnsRem2C1LPJjM3tfTof6hlvV5eWHATye3XOpu2cJ7N+HdkUvUDGwFD2Q=="
"requires": {}
},
},
"react-native-screens": {
"react-native-screens": {
"version": "3.9.0",
"version": "3.9.0",
...
@@ -25372,18 +25264,7 @@
...
@@ -25372,18 +25264,7 @@
"react-native-size-matters": {
"react-native-size-matters": {
"version": "0.3.1",
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/react-native-size-matters/-/react-native-size-matters-0.3.1.tgz",
"resolved": "https://registry.npmjs.org/react-native-size-matters/-/react-native-size-matters-0.3.1.tgz",
"integrity": "sha512-mKOfBLIBFBcs9br1rlZDvxD5+mAl8Gfr5CounwJtxI6Z82rGrMO+Kgl9EIg3RMVf3G855a85YVqHJL2f5EDRlw==",
"integrity": "sha512-mKOfBLIBFBcs9br1rlZDvxD5+mAl8Gfr5CounwJtxI6Z82rGrMO+Kgl9EIg3RMVf3G855a85YVqHJL2f5EDRlw=="
"requires": {}
},
"react-native-svg": {
"version": "12.3.0",
"resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-12.3.0.tgz",
"integrity": "sha512-ESG1g1j7/WLD7X3XRFTQHVv0r6DpbHNNcdusngAODIxG88wpTWUZkhcM3A2HJTb+BbXTFDamHv7FwtRKWQ/ALg==",
"peer": true,
"requires": {
"css-select": "^4.2.1",
"css-tree": "^1.0.0-alpha.39"
}
},
},
"react-native-table-component": {
"react-native-table-component": {
"version": "1.2.2",
"version": "1.2.2",
...
@@ -26628,14 +26509,6 @@
...
@@ -26628,14 +26509,6 @@
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz",
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz",
"integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY="
"integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY="
},
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
},
"string-hash-64": {
"string-hash-64": {
"version": "1.0.3",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string-hash-64/-/string-hash-64-1.0.3.tgz",
"resolved": "https://registry.npmjs.org/string-hash-64/-/string-hash-64-1.0.3.tgz",
...
@@ -26715,6 +26588,14 @@
...
@@ -26715,6 +26588,14 @@
"define-properties": "^1.1.3"
"define-properties": "^1.1.3"
}
}
},
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
},
"strip-ansi": {
"strip-ansi": {
"version": "6.0.1",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
...
@@ -27401,8 +27282,7 @@
...
@@ -27401,8 +27282,7 @@
"ws": {
"ws": {
"version": "7.5.5",
"version": "7.5.5",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w=="
"requires": {}
},
},
"xcode": {
"xcode": {
"version": "2.1.0",
"version": "2.1.0",
frontend/src/constants/Countdown.js
0 → 100644
View file @
73d032b1
export
default
{
elementry
:
5
,
average
:
3
,
hard
:
3
}
\ No newline at end of file
frontend/src/constants/endpoint.js
0 → 100644
View file @
73d032b1
export
default
api
=
'
http://192.168.8.170:5000
'
\ No newline at end of file
frontend/src/memory/data/elementry-level.js
0 → 100644
View file @
73d032b1
import
Gamedataone
from
'
../models/gamedataone
'
;
export
const
SCREEN1
=
[
new
Gamedataone
(
1
,
'
q1
'
,
0
,
require
(
'
../../memory/images/elementry/1/el1.jpg
'
)),
new
Gamedataone
(
2
,
'
q1
'
,
0
,
require
(
'
../../memory/images/elementry/1/el2.jpg
'
)),
new
Gamedataone
(
3
,
'
q1
'
,
0
,
require
(
'
../../memory/images/elementry/1/el4.jpg
'
)),
new
Gamedataone
(
4
,
'
q1
'
,
0
,
require
(
'
../../memory/images/elementry/1/el5.jpg
'
)),
new
Gamedataone
(
5
,
'
q1
'
,
0
,
require
(
'
../../memory/images/elementry/1/el6.jpg
'
)),
new
Gamedataone
(
6
,
'
q1
'
,
1
,
require
(
'
../../memory/images/elementry/1/elmain.jpeg
'
)),
new
Gamedataone
(
7
,
'
q1
'
,
0
,
require
(
'
../../memory/images/elementry/1/el7.jpg
'
)),
new
Gamedataone
(
8
,
'
q1
'
,
0
,
require
(
'
../../memory/images/elementry/1/el3.jpg
'
)),
];
export
const
SCREEN2
=
[
new
Gamedataone
(
1
,
'
q2
'
,
0
,
require
(
'
../../memory/images/elementry/2/el-ball8.jpg
'
)),
new
Gamedataone
(
2
,
'
q2
'
,
0
,
require
(
'
../../memory/images/elementry/2/el-ball2.jpg
'
)),
new
Gamedataone
(
3
,
'
q2
'
,
0
,
require
(
'
../../memory/images/elementry/2/el-ball3.jpg
'
)),
new
Gamedataone
(
4
,
'
q2
'
,
1
,
require
(
'
../../memory/images/elementry/2/el-ball1-main.jpg
'
)),
new
Gamedataone
(
5
,
'
q2
'
,
0
,
require
(
'
../../memory/images/elementry/2/el-ball4.jpg
'
)),
new
Gamedataone
(
6
,
'
q2
'
,
0
,
require
(
'
../../memory/images/elementry/2/el-ball5.jpg
'
)),
new
Gamedataone
(
7
,
'
q2
'
,
0
,
require
(
'
../../memory/images/elementry/2/el-ball6.jpg
'
)),
new
Gamedataone
(
8
,
'
q2
'
,
0
,
require
(
'
../../memory/images/elementry/2/el-ball7.jpg
'
)),
];
export
const
SCREEN3
=
[
new
Gamedataone
(
1
,
'
q3
'
,
0
,
require
(
'
../../memory/images/elementry/3/el-flo8.jpg
'
)),
new
Gamedataone
(
2
,
'
q3
'
,
0
,
require
(
'
../../memory/images/elementry/3/el-flo2.jpg
'
)),
new
Gamedataone
(
3
,
'
q3
'
,
1
,
require
(
'
../../memory/images/elementry/3/el-flo1-main.jpg
'
)),
new
Gamedataone
(
4
,
'
q3
'
,
0
,
require
(
'
../../memory/images/elementry/3/el-flo3.jpg
'
)),
new
Gamedataone
(
5
,
'
q3
'
,
0
,
require
(
'
../../memory/images/elementry/3/el-flo4.jpg
'
)),
new
Gamedataone
(
6
,
'
q3
'
,
0
,
require
(
'
../../memory/images/elementry/3/el-flo5.jpg
'
)),
new
Gamedataone
(
7
,
'
q3
'
,
0
,
require
(
'
../../memory/images/elementry/3/el-flo6.jpg
'
)),
new
Gamedataone
(
8
,
'
q3
'
,
0
,
require
(
'
../../memory/images/elementry/3/el-flo7.jpg
'
)),
];
export
const
SCREEN4
=
[
new
Gamedataone
(
1
,
'
q4
'
,
0
,
require
(
'
../../memory/images/elementry/4/el-car8.jpg
'
)),
new
Gamedataone
(
2
,
'
q4
'
,
0
,
require
(
'
../../memory/images/elementry/4/el-car2.jpg
'
)),
new
Gamedataone
(
3
,
'
q4
'
,
0
,
require
(
'
../../memory/images/elementry/4/el-car3.jpg
'
)),
new
Gamedataone
(
4
,
'
q4
'
,
0
,
require
(
'
../../memory/images/elementry/4/el-car4.jpg
'
)),
new
Gamedataone
(
5
,
'
q4
'
,
0
,
require
(
'
../../memory/images/elementry/4/el-car5.jpg
'
)),
new
Gamedataone
(
6
,
'
q4
'
,
0
,
require
(
'
../../memory/images/elementry/4/el-car6.jpg
'
)),
new
Gamedataone
(
7
,
'
q4
'
,
1
,
require
(
'
../../memory/images/elementry/4/el-car1-main.jpg
'
)),
new
Gamedataone
(
8
,
'
q4
'
,
0
,
require
(
'
../../memory/images/elementry/4/el-car7.jpg
'
)),
];
export
const
SCREEN5
=
[
new
Gamedataone
(
1
,
'
q5
'
,
0
,
require
(
'
../../memory/images/elementry/5/el-fish8.jpg
'
)),
new
Gamedataone
(
2
,
'
q5
'
,
0
,
require
(
'
../../memory/images/elementry/5/el-fish2.jpg
'
)),
new
Gamedataone
(
3
,
'
q5
'
,
0
,
require
(
'
../../memory/images/elementry/5/el-fish3.jpg
'
)),
new
Gamedataone
(
4
,
'
q5
'
,
0
,
require
(
'
../../memory/images/elementry/5/el-fish4.jpg
'
)),
new
Gamedataone
(
5
,
'
q5
'
,
0
,
require
(
'
../../memory/images/elementry/5/el-fish5.jpg
'
)),
new
Gamedataone
(
6
,
'
q5
'
,
0
,
require
(
'
../../memory/images/elementry/5/el-fish6.jpg
'
)),
new
Gamedataone
(
7
,
'
q5
'
,
0
,
require
(
'
../../memory/images/elementry/5/el-fish7.jpg
'
)),
new
Gamedataone
(
8
,
'
q5
'
,
1
,
require
(
'
../../memory/images/elementry/5/el-fish1-main.jpg
'
)),
];
export
const
SCREEN6
=
[
new
Gamedataone
(
1
,
'
q6
'
,
0
,
require
(
'
../../memory/images/elementry/6/el-kite6.jpg
'
)),
new
Gamedataone
(
2
,
'
q6
'
,
0
,
require
(
'
../../memory/images/elementry/6/el-kite2.jpg
'
)),
new
Gamedataone
(
3
,
'
q6
'
,
0
,
require
(
'
../../memory/images/elementry/6/el-kite3.jpg
'
)),
new
Gamedataone
(
4
,
'
q6
'
,
0
,
require
(
'
../../memory/images/elementry/6/el-kite4.jpg
'
)),
new
Gamedataone
(
5
,
'
q6
'
,
0
,
require
(
'
../../memory/images/elementry/6/el-kite5.jpg
'
)),
new
Gamedataone
(
6
,
'
q6
'
,
1
,
require
(
'
../../memory/images/elementry/6/el-kite1-main.jpg
'
)),
new
Gamedataone
(
7
,
'
q6
'
,
0
,
require
(
'
../../memory/images/elementry/6/el-kite7.jpg
'
)),
new
Gamedataone
(
8
,
'
q6
'
,
0
,
require
(
'
../../memory/images/elementry/6/el-kite8.jpg
'
)),
];
\ No newline at end of file
frontend/src/memory/models/gamedataone.js
0 → 100644
View file @
73d032b1
class
Gamedataone
{
constructor
(
id
,
question
,
answer
,
source
){
this
.
id
=
id
,
this
.
question
=
question
,
this
.
answer
=
answer
,
this
.
source
=
source
}
}
export
default
Gamedataone
;
\ No newline at end of file
frontend/src/router/router.js
View file @
73d032b1
...
@@ -7,7 +7,7 @@ import Home from '../screen/home';
...
@@ -7,7 +7,7 @@ import Home from '../screen/home';
import
Start
from
'
../screen/Start
'
;
import
Start
from
'
../screen/Start
'
;
import
Register
from
'
../screen/auth/Register
'
;
import
Register
from
'
../screen/auth/Register
'
;
import
Login
from
'
../screen/auth/Login
'
;
import
Login
from
'
../screen/auth/Login
'
;
import
Splash
from
'
../screen/splash/
S
plash
'
;
import
Splash
from
'
../screen/splash/
s
plash
'
;
import
Color
from
'
../screen/Color
'
;
import
Color
from
'
../screen/Color
'
;
import
Blue
from
'
../screen/activity/Blue
'
;
import
Blue
from
'
../screen/activity/Blue
'
;
import
Blue2
from
'
../screen/activity/Blue2
'
;
import
Blue2
from
'
../screen/activity/Blue2
'
;
...
...
frontend/src/screen/memory/GameOverScreen.js
View file @
73d032b1
...
@@ -3,6 +3,7 @@ import {View, Text, StyleSheet, Button, Image} from 'react-native';
...
@@ -3,6 +3,7 @@ import {View, Text, StyleSheet, Button, Image} from 'react-native';
import
Colors
from
'
../../constants/Colors
'
;
import
Colors
from
'
../../constants/Colors
'
;
import
{
useDispatch
,
useSelector
}
from
'
react-redux
'
;
import
{
useDispatch
,
useSelector
}
from
'
react-redux
'
;
import
*
as
memoryActions
from
'
../../store/actions/memory
'
;
import
*
as
memoryActions
from
'
../../store/actions/memory
'
;
import
endpoint
from
'
../../constants/endpoint
'
;
const
GameOverScreen
=
({
navigation
})
=>
{
const
GameOverScreen
=
({
navigation
})
=>
{
...
@@ -47,7 +48,7 @@ const GameOverScreen = ({navigation}) => {
...
@@ -47,7 +48,7 @@ const GameOverScreen = ({navigation}) => {
}
}
const
sendData
=
()
=>
{
const
sendData
=
()
=>
{
fetch
(
`
http://192.168.8.170:5000
/get_level?q1=
${
encodeURIComponent
(
gameData
.
q1
)}
&q2=
${
encodeURIComponent
(
gameData
.
q2
)}
&q3=
${
encodeURIComponent
(
gameData
.
q3
)}
&q4=
${
encodeURIComponent
(
gameData
.
q4
)}
&q5=
${
encodeURIComponent
(
gameData
.
q5
)}
&q6=
${
encodeURIComponent
(
gameData
.
q6
)}
&time=
${
encodeURIComponent
(
gameData
.
time
)}
`
,{
fetch
(
`
${
endpoint
}
/get_level?q1=
${
encodeURIComponent
(
gameData
.
q1
)}
&q2=
${
encodeURIComponent
(
gameData
.
q2
)}
&q3=
${
encodeURIComponent
(
gameData
.
q3
)}
&q4=
${
encodeURIComponent
(
gameData
.
q4
)}
&q5=
${
encodeURIComponent
(
gameData
.
q5
)}
&q6=
${
encodeURIComponent
(
gameData
.
q6
)}
&time=
${
encodeURIComponent
(
gameData
.
time
)}
`
,{
method
:
'
GET
'
method
:
'
GET
'
})
})
.
then
(
resp
=>
resp
.
json
())
.
then
(
resp
=>
resp
.
json
())
...
@@ -68,7 +69,7 @@ const GameOverScreen = ({navigation}) => {
...
@@ -68,7 +69,7 @@ const GameOverScreen = ({navigation}) => {
}
}
const
insertData
=
()
=>
{
const
insertData
=
()
=>
{
fetch
(
'
http://192.168.8.170:5000/add
'
,
{
fetch
(
`
${
endpoint
}
/add`
,
{
method
:
'
POST
'
,
method
:
'
POST
'
,
headers
:
{
headers
:
{
'
Content-Type
'
:
'
application/json
'
'
Content-Type
'
:
'
application/json
'
...
...
frontend/src/screen/memory/elementry/GameScreenFive.js
View file @
73d032b1
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
}
from
'
react-native
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
Countdown
from
'
../../../constants/Countdown
'
;
const
GameScreenFive
=
({
navigation
})
=>
{
const
GameScreenFive
=
({
navigation
})
=>
{
...
@@ -15,7 +16,7 @@ const GameScreenFive = ({navigation}) => {
...
@@ -15,7 +16,7 @@ const GameScreenFive = ({navigation}) => {
<
/View
>
<
/View
>
<
CountDown
<
CountDown
size
=
{
40
}
size
=
{
40
}
until
=
{
5
}
until
=
{
Countdown
.
elementry
}
// onFinish={() => alert('Finished')}
// onFinish={() => alert('Finished')}
onFinish
=
{()
=>
navigation
.
navigate
(
'
GameScreenFiveAll
'
)}
onFinish
=
{()
=>
navigation
.
navigate
(
'
GameScreenFiveAll
'
)}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
#1CC625
'
}}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
#1CC625
'
}}
...
...
frontend/src/screen/memory/elementry/GameScreenFiveAll.js
View file @
73d032b1
import
React
,{
useState
,
useEffect
}
from
'
react
'
;
import
React
,{
useState
,
useEffect
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
,
TouchableOpacity
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
,
TouchableOpacity
,
FlatList
}
from
'
react-native
'
;
import
{
useDispatch
}
from
'
react-redux
'
;
import
{
useDispatch
}
from
'
react-redux
'
;
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
import
{
SCREEN5
}
from
'
../../../memory/data/elementry-level
'
;
let
gameData
=
SCREEN5
.
sort
((
item
)
=>
Math
.
random
(
item
.
id
)
-
0.5
);
const
GameScreenFiveAll
=
({
navigation
})
=>
{
const
GameScreenFiveAll
=
({
navigation
})
=>
{
const
shuffle
=
()
=>
{
gameData
=
SCREEN5
.
sort
((
item
)
=>
Math
.
random
(
item
.
id
)
-
0.5
);
};
if
(
gameData
.
length
==
0
){
shuffle
();
}
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
[
time
,
setTime
]
=
useState
(
0
);
const
[
time
,
setTime
]
=
useState
(
0
);
...
@@ -25,40 +36,22 @@ const GameScreenFiveAll = ({navigation}) => {
...
@@ -25,40 +36,22 @@ const GameScreenFiveAll = ({navigation}) => {
},[
timerOn
]);
},[
timerOn
]);
const
renderImageItem
=
(
itemData
)
=>
{
return
(
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
itemData
.
item
.
question
,
answer
:
itemData
.
item
.
answer
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
itemData
.
item
.
question
,
time
:
time
}));
gameData
=
[];
navigation
.
navigate
(
'
GameScreenSix
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
itemData
.
item
.
source
}
/
>
<
/TouchableOpacity
>
)
}
return
(
return
(
<
View
style
=
{
styles
.
screen
}
>
<
View
style
=
{
styles
.
screen
}
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
FlatList
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q5
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q5
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenSix
'
)}}
>
keyExtractor
=
{(
item
,
data
)
=>
item
.
id
}
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/5/el-fish8.jpg
'
)}
/
>
data
=
{
gameData
}
<
/TouchableOpacity
>
renderItem
=
{
renderImageItem
}
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q5
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q5
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenSix
'
)}}
>
numColumns
=
{
2
}
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/5/el-fish2.jpg
'
)}
/
>
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q5
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q5
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenSix
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/5/el-fish3.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q5
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q5
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenSix
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/5/el-fish4.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q5
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q5
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenSix
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/5/el-fish5.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q5
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q5
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenSix
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/5/el-fish6.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q5
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q5
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenSix
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/5/el-fish7.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q5
'
,
answer
:
1
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q5
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenSix
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/5/el-fish1-main.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
);
);
}
}
...
...
frontend/src/screen/memory/elementry/GameScreenFour.js
View file @
73d032b1
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
}
from
'
react-native
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
Countdown
from
'
../../../constants/Countdown
'
;
const
GameScreenFour
=
({
navigation
})
=>
{
const
GameScreenFour
=
({
navigation
})
=>
{
...
@@ -22,7 +23,7 @@ const GameScreenFour = ({navigation}) => {
...
@@ -22,7 +23,7 @@ const GameScreenFour = ({navigation}) => {
<
Text
style
=
{
styles
.
imageText
}
>
Car
-
කාරය
<
/Text
>
<
Text
style
=
{
styles
.
imageText
}
>
Car
-
කාරය
<
/Text
>
<
CountDown
<
CountDown
size
=
{
40
}
size
=
{
40
}
until
=
{
5
}
until
=
{
Countdown
.
elementry
}
// onFinish={() => alert('Finished')}
// onFinish={() => alert('Finished')}
onFinish
=
{()
=>
navigation
.
navigate
(
'
GameScreenFourAll
'
)}
onFinish
=
{()
=>
navigation
.
navigate
(
'
GameScreenFourAll
'
)}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
#1CC625
'
}}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
#1CC625
'
}}
...
...
frontend/src/screen/memory/elementry/GameScreenFourAll.js
View file @
73d032b1
import
React
,{
useState
,
useEffect
}
from
'
react
'
;
import
React
,{
useState
,
useEffect
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
,
TouchableOpacity
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
,
TouchableOpacity
,
FlatList
}
from
'
react-native
'
;
import
{
useDispatch
}
from
'
react-redux
'
;
import
{
useDispatch
}
from
'
react-redux
'
;
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
import
{
SCREEN4
}
from
'
../../../memory/data/elementry-level
'
;
let
gameData
=
SCREEN4
.
sort
((
item
)
=>
Math
.
random
(
item
.
id
)
-
0.5
);
const
GameScreenFourAll
=
({
navigation
})
=>
{
const
GameScreenFourAll
=
({
navigation
})
=>
{
const
shuffle
=
()
=>
{
gameData
=
SCREEN4
.
sort
((
item
)
=>
Math
.
random
(
item
.
id
)
-
0.5
);
};
if
(
gameData
.
length
==
0
){
shuffle
();
}
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
[
time
,
setTime
]
=
useState
(
0
);
const
[
time
,
setTime
]
=
useState
(
0
);
...
@@ -25,40 +36,22 @@ const GameScreenFourAll = ({navigation}) => {
...
@@ -25,40 +36,22 @@ const GameScreenFourAll = ({navigation}) => {
},[
timerOn
]);
},[
timerOn
]);
const
renderImageItem
=
(
itemData
)
=>
{
return
(
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
itemData
.
item
.
question
,
answer
:
itemData
.
item
.
answer
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
itemData
.
item
.
question
,
time
:
time
}));
gameData
=
[];
navigation
.
navigate
(
'
GameScreenFive
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
itemData
.
item
.
source
}
/
>
<
/TouchableOpacity
>
)
}
return
(
return
(
<
View
style
=
{
styles
.
screen
}
>
<
View
style
=
{
styles
.
screen
}
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
FlatList
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q4
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q4
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFive
'
)}}
>
keyExtractor
=
{(
item
,
data
)
=>
item
.
id
}
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/4/el-car8.jpg
'
)}
/
>
data
=
{
gameData
}
<
/TouchableOpacity
>
renderItem
=
{
renderImageItem
}
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q4
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q4
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFive
'
)}}
>
numColumns
=
{
2
}
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/4/el-car2.jpg
'
)}
/
>
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q4
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q4
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFive
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/4/el-car3.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q4
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q4
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFive
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/4/el-car4.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q4
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q4
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFive
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/4/el-car5.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q4
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q4
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFive
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/4/el-car6.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q4
'
,
answer
:
1
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q4
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFive
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/4/el-car1-main.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q4
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q4
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFive
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/4/el-car7.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
);
);
}
}
...
...
frontend/src/screen/memory/elementry/GameScreenOne.js
View file @
73d032b1
...
@@ -5,6 +5,7 @@ import CountDown from 'react-native-countdown-component';
...
@@ -5,6 +5,7 @@ import CountDown from 'react-native-countdown-component';
import
{
useDispatch
}
from
'
react-redux
'
;
import
{
useDispatch
}
from
'
react-redux
'
;
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
;
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
;
import
Levels
from
'
../../../constants/Levels
'
;
import
Levels
from
'
../../../constants/Levels
'
;
import
Countdown
from
'
../../../constants/Countdown
'
;
const
GameScreenOne
=
({
navigation
})
=>
{
const
GameScreenOne
=
({
navigation
})
=>
{
...
@@ -31,7 +32,7 @@ const GameScreenOne = ({navigation}) => {
...
@@ -31,7 +32,7 @@ const GameScreenOne = ({navigation}) => {
<
Text
style
=
{
styles
.
imageText
}
>
Pencil
-
පැන්සල
<
/Text
>
<
Text
style
=
{
styles
.
imageText
}
>
Pencil
-
පැන්සල
<
/Text
>
<
CountDown
<
CountDown
size
=
{
40
}
size
=
{
40
}
until
=
{
5
}
until
=
{
Countdown
.
elementry
}
// onFinish={() => alert('Finished')}
// onFinish={() => alert('Finished')}
onFinish
=
{()
=>
navigation
.
navigate
(
'
GameScreenOneAll
'
)}
onFinish
=
{()
=>
navigation
.
navigate
(
'
GameScreenOneAll
'
)}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
#1CC625
'
}}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
#1CC625
'
}}
...
...
frontend/src/screen/memory/elementry/GameScreenOneAll.js
View file @
73d032b1
import
React
,{
useEffect
,
useState
}
from
'
react
'
;
import
React
,{
useEffect
,
useState
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
,
TouchableOpacity
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
,
TouchableOpacity
,
FlatList
}
from
'
react-native
'
;
import
{
useSelector
,
useDispatch
}
from
'
react-redux
'
;
import
{
useSelector
,
useDispatch
}
from
'
react-redux
'
;
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
;
import
{
SCREEN1
}
from
'
../../../memory/data/elementry-level
'
;
let
gameData
=
SCREEN1
.
sort
((
item
)
=>
Math
.
random
(
item
.
id
)
-
0.5
);
const
GameScreenOneAll
=
({
navigation
})
=>
{
const
GameScreenOneAll
=
({
navigation
})
=>
{
const
shuffle
=
()
=>
{
gameData
=
SCREEN1
.
sort
((
item
)
=>
Math
.
random
(
item
.
id
)
-
0.5
);
};
if
(
gameData
.
length
==
0
){
shuffle
();
}
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
[
time
,
setTime
]
=
useState
(
0
);
const
[
time
,
setTime
]
=
useState
(
0
);
...
@@ -26,40 +36,22 @@ const GameScreenOneAll = ({navigation}) => {
...
@@ -26,40 +36,22 @@ const GameScreenOneAll = ({navigation}) => {
},[
timerOn
]);
},[
timerOn
]);
const
renderImageItem
=
(
itemData
)
=>
{
return
(
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
itemData
.
item
.
question
,
answer
:
itemData
.
item
.
answer
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
itemData
.
item
.
question
,
time
:
time
}));
gameData
=
[];
navigation
.
navigate
(
'
GameScreenTwo
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
itemData
.
item
.
source
}
/
>
<
/TouchableOpacity
>
)
}
return
(
return
(
<
View
style
=
{
styles
.
screen
}
>
<
View
style
=
{
styles
.
screen
}
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
FlatList
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q1
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q1
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenTwo
'
)}}
>
keyExtractor
=
{(
item
,
data
)
=>
item
.
id
}
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/1/el1.jpg
'
)}
/
>
data
=
{
gameData
}
<
/TouchableOpacity
>
renderItem
=
{
renderImageItem
}
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q1
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q1
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenTwo
'
)}}
>
numColumns
=
{
2
}
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/1/el2.jpg
'
)}
/
>
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q1
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q1
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenTwo
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/1/el4.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q1
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q1
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenTwo
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/1/el5.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q1
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q1
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenTwo
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/1/el6.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q1
'
,
answer
:
1
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q1
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenTwo
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/1/elmain.jpeg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q1
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q1
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenTwo
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/1/el7.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q1
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q1
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenTwo
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/1/el3.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
);
);
}
}
...
@@ -68,7 +60,6 @@ const styles = StyleSheet.create({
...
@@ -68,7 +60,6 @@ const styles = StyleSheet.create({
screen
:
{
screen
:
{
flex
:
1
,
flex
:
1
,
padding
:
10
,
padding
:
10
,
alignItems
:
'
center
'
},
},
imageItem
:
{
imageItem
:
{
width
:
'
48%
'
,
width
:
'
48%
'
,
...
...
frontend/src/screen/memory/elementry/GameScreenSix.js
View file @
73d032b1
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
}
from
'
react-native
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
Countdown
from
'
../../../constants/Countdown
'
;
const
GameScreenSix
=
({
navigation
})
=>
{
const
GameScreenSix
=
({
navigation
})
=>
{
...
@@ -16,7 +17,7 @@ const GameScreenSix = ({navigation}) => {
...
@@ -16,7 +17,7 @@ const GameScreenSix = ({navigation}) => {
<
Text
style
=
{
styles
.
imageText
}
>
Pencil
-
පැන්සල
<
/Text
>
<
Text
style
=
{
styles
.
imageText
}
>
Pencil
-
පැන්සල
<
/Text
>
<
CountDown
<
CountDown
size
=
{
40
}
size
=
{
40
}
until
=
{
5
}
until
=
{
Countdown
.
elementry
}
// onFinish={() => alert('Finished')}
// onFinish={() => alert('Finished')}
onFinish
=
{()
=>
navigation
.
navigate
(
'
GameScreenSixAll
'
)}
onFinish
=
{()
=>
navigation
.
navigate
(
'
GameScreenSixAll
'
)}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
#1CC625
'
}}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
#1CC625
'
}}
...
...
frontend/src/screen/memory/elementry/GameScreenSixAll.js
View file @
73d032b1
import
React
,{
useState
,
useEffect
}
from
'
react
'
;
import
React
,{
useState
,
useEffect
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
,
TouchableOpacity
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
,
TouchableOpacity
,
FlatList
}
from
'
react-native
'
;
import
{
useDispatch
}
from
'
react-redux
'
;
import
{
useDispatch
}
from
'
react-redux
'
;
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
;
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
;
import
{
SCREEN6
}
from
'
../../../memory/data/elementry-level
'
;
let
gameData
=
SCREEN6
.
sort
((
item
)
=>
Math
.
random
(
item
.
id
)
-
0.5
);
const
GameScreenSixAll
=
({
navigation
})
=>
{
const
GameScreenSixAll
=
({
navigation
})
=>
{
const
shuffle
=
()
=>
{
gameData
=
SCREEN6
.
sort
((
item
)
=>
Math
.
random
(
item
.
id
)
-
0.5
);
};
if
(
gameData
.
length
==
0
){
shuffle
();
}
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
[
time
,
setTime
]
=
useState
(
0
);
const
[
time
,
setTime
]
=
useState
(
0
);
...
@@ -25,40 +36,22 @@ const GameScreenSixAll = ({navigation}) => {
...
@@ -25,40 +36,22 @@ const GameScreenSixAll = ({navigation}) => {
},[
timerOn
]);
},[
timerOn
]);
const
renderImageItem
=
(
itemData
)
=>
{
return
(
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
itemData
.
item
.
question
,
answer
:
itemData
.
item
.
answer
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
itemData
.
item
.
question
,
time
:
time
}));
gameData
=
[];
navigation
.
navigate
(
'
GameOverScreen
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
itemData
.
item
.
source
}
/
>
<
/TouchableOpacity
>
)
}
return
(
return
(
<
View
style
=
{
styles
.
screen
}
>
<
View
style
=
{
styles
.
screen
}
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
FlatList
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q6
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q6
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameOverScreen
'
)}}
>
keyExtractor
=
{(
item
,
data
)
=>
item
.
id
}
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/6/el-kite6.jpg
'
)}
/
>
data
=
{
gameData
}
<
/TouchableOpacity
>
renderItem
=
{
renderImageItem
}
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q6
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q6
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameOverScreen
'
)}}
>
numColumns
=
{
2
}
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/6/el-kite2.jpg
'
)}
/
>
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q6
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q6
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameOverScreen
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/6/el-kite3.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q6
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q6
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameOverScreen
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/6/el-kite4.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q6
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q6
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameOverScreen
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/6/el-kite5.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q6
'
,
answer
:
1
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q6
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameOverScreen
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/6/el-kite1-main.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q6
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q6
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameOverScreen
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/6/el-kite7.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q6
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q6
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameOverScreen
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/6/el-kite8.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
);
);
}
}
...
...
frontend/src/screen/memory/elementry/GameScreenThree.js
View file @
73d032b1
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
}
from
'
react-native
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
Countdown
from
'
../../../constants/Countdown
'
;
const
GameScreenThree
=
({
navigation
})
=>
{
const
GameScreenThree
=
({
navigation
})
=>
{
...
@@ -16,7 +17,7 @@ const GameScreenThree = ({navigation}) => {
...
@@ -16,7 +17,7 @@ const GameScreenThree = ({navigation}) => {
<
Text
style
=
{
styles
.
imageText
}
>
Flower
-
මල
<
/Text
>
<
Text
style
=
{
styles
.
imageText
}
>
Flower
-
මල
<
/Text
>
<
CountDown
<
CountDown
size
=
{
40
}
size
=
{
40
}
until
=
{
5
}
until
=
{
Countdown
.
elementry
}
// onFinish={() => alert('Finished')}
// onFinish={() => alert('Finished')}
onFinish
=
{()
=>
navigation
.
navigate
(
'
GameScreenThreeAll
'
)}
onFinish
=
{()
=>
navigation
.
navigate
(
'
GameScreenThreeAll
'
)}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
#1CC625
'
}}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
#1CC625
'
}}
...
...
frontend/src/screen/memory/elementry/GameScreenThreeAll.js
View file @
73d032b1
import
React
,{
useState
,
useEffect
}
from
'
react
'
;
import
React
,{
useState
,
useEffect
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
,
TouchableOpacity
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
,
TouchableOpacity
,
FlatList
}
from
'
react-native
'
;
import
{
useDispatch
}
from
'
react-redux
'
;
import
{
useDispatch
}
from
'
react-redux
'
;
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
;
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
;
import
{
SCREEN3
}
from
'
../../../memory/data/elementry-level
'
;
let
gameData
=
SCREEN3
.
sort
((
item
)
=>
Math
.
random
(
item
.
id
)
-
0.5
);
const
GameScreenThreeAll
=
({
navigation
})
=>
{
const
GameScreenThreeAll
=
({
navigation
})
=>
{
const
shuffle
=
()
=>
{
gameData
=
SCREEN3
.
sort
((
item
)
=>
Math
.
random
(
item
.
id
)
-
0.5
);
};
if
(
gameData
.
length
==
0
){
shuffle
();
}
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
[
time
,
setTime
]
=
useState
(
0
);
const
[
time
,
setTime
]
=
useState
(
0
);
...
@@ -25,40 +36,22 @@ const GameScreenThreeAll = ({navigation}) => {
...
@@ -25,40 +36,22 @@ const GameScreenThreeAll = ({navigation}) => {
},[
timerOn
]);
},[
timerOn
]);
const
renderImageItem
=
(
itemData
)
=>
{
return
(
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
itemData
.
item
.
question
,
answer
:
itemData
.
item
.
answer
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
itemData
.
item
.
question
,
time
:
time
}));
gameData
=
[];
navigation
.
navigate
(
'
GameScreenFour
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
itemData
.
item
.
source
}
/
>
<
/TouchableOpacity
>
)
}
return
(
return
(
<
View
style
=
{
styles
.
screen
}
>
<
View
style
=
{
styles
.
screen
}
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
FlatList
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q3
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q3
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFour
'
)}}
>
keyExtractor
=
{(
item
,
data
)
=>
item
.
id
}
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/3/el-flo8.jpg
'
)}
/
>
data
=
{
gameData
}
<
/TouchableOpacity
>
renderItem
=
{
renderImageItem
}
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q3
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q3
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFour
'
)}}
>
numColumns
=
{
2
}
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/3/el-flo2.jpg
'
)}
/
>
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q3
'
,
answer
:
1
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q3
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFour
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/3/el-flo1-main.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q3
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q3
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFour
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/3/el-flo3.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q3
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q3
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFour
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/3/el-flo4.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q3
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q3
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFour
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/3/el-flo5.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q3
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q3
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFour
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/3/el-flo6.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q3
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q3
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenFour
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/3/el-flo7.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
);
);
}
}
...
...
frontend/src/screen/memory/elementry/GameScreenTwo.js
View file @
73d032b1
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
}
from
'
react-native
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
Countdown
from
'
../../../constants/Countdown
'
;
const
GameScreenTwo
=
({
navigation
})
=>
{
const
GameScreenTwo
=
({
navigation
})
=>
{
...
@@ -16,7 +17,7 @@ const GameScreenTwo = ({navigation}) => {
...
@@ -16,7 +17,7 @@ const GameScreenTwo = ({navigation}) => {
<
Text
style
=
{
styles
.
imageText
}
>
Ball
-
බෝලය
<
/Text
>
<
Text
style
=
{
styles
.
imageText
}
>
Ball
-
බෝලය
<
/Text
>
<
CountDown
<
CountDown
size
=
{
40
}
size
=
{
40
}
until
=
{
5
}
until
=
{
Countdown
.
elementry
}
// onFinish={() => alert('Finished')}
// onFinish={() => alert('Finished')}
onFinish
=
{()
=>
navigation
.
navigate
(
'
GameScreenTwoAll
'
)}
onFinish
=
{()
=>
navigation
.
navigate
(
'
GameScreenTwoAll
'
)}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
#1CC625
'
}}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
#1CC625
'
}}
...
...
frontend/src/screen/memory/elementry/GameScreenTwoAll.js
View file @
73d032b1
import
{
NavigationContainer
}
from
'
@react-navigation/native
'
;
import
{
NavigationContainer
}
from
'
@react-navigation/native
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
,
TouchableOpacity
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
Image
,
TouchableOpacity
,
FlatList
}
from
'
react-native
'
;
import
{
useDispatch
}
from
'
react-redux
'
;
import
{
useDispatch
}
from
'
react-redux
'
;
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
import
*
as
memoryActions
from
'
../../../store/actions/memory
'
import
{
SCREEN2
}
from
'
../../../memory/data/elementry-level
'
;
let
gameData
=
SCREEN2
.
sort
((
item
)
=>
Math
.
random
(
item
.
id
)
-
0.5
);
const
GameScreenTwoAll
=
({
navigation
})
=>
{
const
GameScreenTwoAll
=
({
navigation
})
=>
{
const
shuffle
=
()
=>
{
gameData
=
SCREEN2
.
sort
((
item
)
=>
Math
.
random
(
item
.
id
)
-
0.5
);
};
if
(
gameData
.
length
==
0
){
shuffle
();
}
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
[
time
,
setTime
]
=
useState
(
0
);
const
[
time
,
setTime
]
=
useState
(
0
);
...
@@ -26,40 +37,22 @@ const GameScreenTwoAll = ({navigation}) => {
...
@@ -26,40 +37,22 @@ const GameScreenTwoAll = ({navigation}) => {
},[
timerOn
]);
},[
timerOn
]);
const
renderImageItem
=
(
itemData
)
=>
{
return
(
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
itemData
.
item
.
question
,
answer
:
itemData
.
item
.
answer
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
itemData
.
item
.
question
,
time
:
time
}));
gameData
=
[];
navigation
.
navigate
(
'
GameScreenThree
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
itemData
.
item
.
source
}
/
>
<
/TouchableOpacity
>
)
}
return
(
return
(
<
View
style
=
{
styles
.
screen
}
>
<
View
style
=
{
styles
.
screen
}
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
FlatList
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q2
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q2
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenThree
'
)}}
>
keyExtractor
=
{(
item
,
data
)
=>
item
.
id
}
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/2/el-ball8.jpg
'
)}
/
>
data
=
{
gameData
}
<
/TouchableOpacity
>
renderItem
=
{
renderImageItem
}
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q2
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q2
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenThree
'
)}}
>
numColumns
=
{
2
}
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/2/el-ball2.jpg
'
)}
/
>
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q2
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q2
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenThree
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/2/el-ball3.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q2
'
,
answer
:
1
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q2
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenThree
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/2/el-ball1-main.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q2
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q2
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenThree
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/2/el-ball4.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q2
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q2
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenThree
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/2/el-ball5.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q2
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q2
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenThree
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/2/el-ball6.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
activeOpacity
=
{
0.7
}
style
=
{
styles
.
imageItem
}
onPress
=
{()
=>
{
dispatch
(
memoryActions
.
setAnswers
({
question
:
'
q2
'
,
answer
:
0
}));
setTimeOn
(
false
);
dispatch
(
memoryActions
.
setTime
({
question
:
'
q2
'
,
time
:
time
}));
navigation
.
navigate
(
'
GameScreenThree
'
)}}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
require
(
'
../../../memory/images/elementry/2/el-ball7.jpg
'
)}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
);
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment