Skip to content

Commit ffd13b6

Browse files
authored
Merge pull request #1 from motasimfoad/dev
beta v1
2 parents 7acf31d + f8558b2 commit ffd13b6

40 files changed

+12551
-1
lines changed

.DS_Store

6 KB
Binary file not shown.

.eslintcache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"/Users/charchill/Work/Projects/catchphrase-word-game/src/pages/in-game/ingame.js":"1","/Users/charchill/Work/Projects/catchphrase-word-game/src/index.js":"2","/Users/charchill/Work/Projects/catchphrase-word-game/src/components/router/index.js":"3","/Users/charchill/Work/Projects/catchphrase-word-game/src/components/footer/footer.js":"4","/Users/charchill/Work/Projects/catchphrase-word-game/src/serviceWorkerRegistration.js":"5","/Users/charchill/Work/Projects/catchphrase-word-game/src/pages/main/main.js":"6","/Users/charchill/Work/Projects/catchphrase-word-game/src/pages/pre-game/pregame.js":"7","/Users/charchill/Work/Projects/catchphrase-word-game/src/reportWebVitals.js":"8","/Users/charchill/Work/Projects/catchphrase-word-game/src/components/header/header.js":"9","/Users/charchill/Work/Projects/catchphrase-word-game/src/components/main-body-content/mbc.js":"10"},{"size":4266,"mtime":1609638870468,"results":"11","hashOfConfig":"12"},{"size":900,"mtime":1609638087375,"results":"13","hashOfConfig":"12"},{"size":588,"mtime":1609154204580,"results":"14","hashOfConfig":"12"},{"size":335,"mtime":1609602123392,"results":"15","hashOfConfig":"12"},{"size":5064,"mtime":1609006557317,"results":"16","hashOfConfig":"12"},{"size":834,"mtime":1609638815693,"results":"17","hashOfConfig":"12"},{"size":1278,"mtime":1609638847429,"results":"18","hashOfConfig":"12"},{"size":364,"mtime":1609006557316,"results":"19","hashOfConfig":"12"},{"size":295,"mtime":1609632532445,"results":"20","hashOfConfig":"12"},{"size":3084,"mtime":1609633053862,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"24","usedDeprecatedRules":"25"},"7yfzp7",{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"35"},{"filePath":"36","messages":"37","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/charchill/Work/Projects/catchphrase-word-game/src/pages/in-game/ingame.js",["47"],"import React, { useState, useEffect } from \"react\";\nimport '../in-game/ingame.css';\nimport { Button, Container, Row, Col, Alert, Card, ButtonGroup} from 'react-bootstrap';\nimport {useLocation, Link} from 'react-router-dom';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faLowVision, faEye } from '@fortawesome/free-solid-svg-icons';\nimport Footer from \"../../components/footer/footer.js\";\nimport TimerSound from \"../../assets/audio/timer.mp3\";\nimport EndTimerSound from \"../../assets/audio/bomb.mp3\";\nimport Header from \"../../components/header/header.js\";\nimport ProgressBar from 'react-customizable-progressbar';\nimport ReactGa from 'react-ga';\n\nReactGa.initialize(\"UA-154721739-1\");\nReactGa.pageview('catchphrase.motasimfoad.com - Ingame Screen');\n\nfunction Ingame() {\n const [myObj, setMyObj] = useState([\"a\",\"b\",\"c\"]);\n const { state } = useLocation();\n const [min] = useState(state);\n const [millisec] = useState((min*60)*1000);\n const [seconds, setSeconds] = useState(0);\n const [flag, setFlag] = useState(true);\n const [rand, setRand] = useState(Math.round(Math.random() * (myObj.length-1)));\n const [temp, setTemp] = useState(rand);\n const [audio] = useState(new Audio(TimerSound));\n const [endAudio] = useState(new Audio(EndTimerSound));\n const [gameStatus, setGameStatus] = useState(false);\n \n const getData=()=>{\n fetch('https://api.motasimfoad.com/catch_phrase/catch_phrase.json'\n ).then(function(response){\n return response.json();\n })\n .then(function(myJson) {\n setMyObj(myJson);\n });\n }\n\n function toggle() {\n setFlag(!flag);\n }\n\n function word() {\n setRand(Math.round(Math.random() * (myObj.length-1)));\n setTemp ( Math.round(rand));\n }\n\n function getPercentageChange(){\n var secToMs = (seconds*1000);\n var decreaseValue = millisec - secToMs;\n var temp = (decreaseValue / millisec) * 100;\n temp = Math.round(temp);\n audio.play();\n return temp;\n }\n\n useEffect(() => {\n getData();\n const interval = setInterval(() => {\n setSeconds(seconds => seconds + 1);\n }, 1000);\n const timeout = setTimeout(() => {\n endAudio.play();\n setGameStatus(true);\n clearInterval(interval);\n }, millisec);\n return () => clearTimeout(timeout);\n }, []);\n \n return (\n <Container className=\"App\" fluid>\n <Header />\n <Row>\n <Col>\n <Alert className=\"App-Header\" variant=\"dark\">\n {flag ? <h3>{seconds}</h3>: <h4>hidden</h4>}\n <small>Timer</small>\n </Alert>\n </Col>\n <Col>\n <Alert className=\"App-Header\" variant=\"dark\">\n <Button variant=\"outline-dark\" onClick={toggle}>{flag ? <FontAwesomeIcon icon={faLowVision} />: <FontAwesomeIcon icon={faEye} />}</Button>\n <small>Visibility</small>\n </Alert>\n </Col>\n </Row>\n <Row>\n <Card>\n <Card.Body className=\"App-Game-Rules\">\n <ProgressBar\n radius={40}\n progress={getPercentageChange()}\n cut={120}\n rotate={-210}\n counterClockwise\n inverse\n initialAnimation\n initialAnimationDelay={1}\n strokeWidth={10}\n strokeColor=\"#d35400\"\n strokeLinecap=\"butt\"\n trackStrokeWidth={10}\n trackStrokeLinecap=\"butt\"\n >\n <div className=\"indicator\">\n <div>{myObj[temp]}</div>\n </div>\n </ProgressBar>\n </Card.Body>\n <Card.Footer>\n <ButtonGroup aria-label=\"Basic example\">\n <Button variant=\"warning\" className=\"btnPadding\" onClick={word} disabled={gameStatus}>Next</Button>\n <Link to=\"/pregame\"><Button variant=\"danger\" className=\"btnPadding\">Reset</Button></Link>\n </ButtonGroup> \n </Card.Footer>\n </Card>\n </Row>\n <Footer />\n </Container>\n );\n}\n\nexport default Ingame;\n",["48","49"],"/Users/charchill/Work/Projects/catchphrase-word-game/src/index.js",[],["50","51"],"/Users/charchill/Work/Projects/catchphrase-word-game/src/components/router/index.js",[],"/Users/charchill/Work/Projects/catchphrase-word-game/src/components/footer/footer.js",[],"/Users/charchill/Work/Projects/catchphrase-word-game/src/serviceWorkerRegistration.js",[],["52","53"],"/Users/charchill/Work/Projects/catchphrase-word-game/src/pages/main/main.js",[],"/Users/charchill/Work/Projects/catchphrase-word-game/src/pages/pre-game/pregame.js",[],"/Users/charchill/Work/Projects/catchphrase-word-game/src/reportWebVitals.js",[],"/Users/charchill/Work/Projects/catchphrase-word-game/src/components/header/header.js",[],["54","55"],"/Users/charchill/Work/Projects/catchphrase-word-game/src/components/main-body-content/mbc.js",[],{"ruleId":"56","severity":1,"message":"57","line":69,"column":8,"nodeType":"58","endLine":69,"endColumn":10,"suggestions":"59"},{"ruleId":"60","replacedBy":"61"},{"ruleId":"62","replacedBy":"63"},{"ruleId":"60","replacedBy":"64"},{"ruleId":"62","replacedBy":"65"},{"ruleId":"60","replacedBy":"66"},{"ruleId":"62","replacedBy":"67"},{"ruleId":"60","replacedBy":"68"},{"ruleId":"62","replacedBy":"69"},"react-hooks/exhaustive-deps","React Hook useEffect has missing dependencies: 'endAudio' and 'millisec'. Either include them or remove the dependency array.","ArrayExpression",["70"],"no-native-reassign",["71"],"no-negated-in-lhs",["72"],["71"],["72"],["71"],["72"],["71"],["72"],{"desc":"73","fix":"74"},"no-global-assign","no-unsafe-negation","Update the dependencies array to be: [endAudio, millisec]",{"range":"75","text":"76"},[2323,2325],"[endAudio, millisec]"]25],"[endAudio, millisec]"]

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33

44
# Ada Library Information
55
*.ali
6+
7+
build
8+
node_modules

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
# catchphrase-word-game
1+
# catchphrase-word-game-react-pwa
2+
3+
Built using : ReactJS, Create-React-App PWA
4+
5+
Live Preview : https://catchphrase.motasimfoad.com/
6+
7+
Simple catchphrase game influenced by Jimmy Fallon Shows Catchphrase Game!
8+
9+
10+
![Simple catchphrase game influenced by Jimmy Fallon Shows Catchphrase Game Image](https://motasimfoad.com/webasset/catchphrase/1.png)

package.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "catchphrase",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"@fortawesome/fontawesome-svg-core": "^1.2.32",
7+
"@fortawesome/free-solid-svg-icons": "^5.15.1",
8+
"@fortawesome/react-fontawesome": "^0.1.14",
9+
"@testing-library/jest-dom": "^5.11.4",
10+
"@testing-library/react": "^11.1.0",
11+
"@testing-library/user-event": "^12.1.10",
12+
"bootstrap": "^4.5.3",
13+
"react": "^17.0.1",
14+
"react-bootstrap": "^1.4.0",
15+
"react-customizable-progressbar": "^1.0.2",
16+
"react-dom": "^17.0.1",
17+
"react-ga": "^3.3.0",
18+
"react-router-dom": "^5.2.0",
19+
"react-scripts": "4.0.1",
20+
"web-vitals": "^0.2.4",
21+
"workbox-background-sync": "^5.1.3",
22+
"workbox-broadcast-update": "^5.1.3",
23+
"workbox-cacheable-response": "^5.1.3",
24+
"workbox-core": "^5.1.3",
25+
"workbox-expiration": "^5.1.3",
26+
"workbox-google-analytics": "^5.1.3",
27+
"workbox-navigation-preload": "^5.1.3",
28+
"workbox-precaching": "^5.1.3",
29+
"workbox-range-requests": "^5.1.3",
30+
"workbox-routing": "^5.1.3",
31+
"workbox-strategies": "^5.1.3",
32+
"workbox-streams": "^5.1.3"
33+
},
34+
"scripts": {
35+
"start": "react-scripts start",
36+
"build": "react-scripts build",
37+
"test": "react-scripts test",
38+
"eject": "react-scripts eject"
39+
},
40+
"eslintConfig": {
41+
"extends": [
42+
"react-app",
43+
"react-app/jest"
44+
]
45+
},
46+
"browserslist": {
47+
"production": [
48+
">0.2%",
49+
"not dead",
50+
"not op_mini all"
51+
],
52+
"development": [
53+
"last 1 chrome version",
54+
"last 1 firefox version",
55+
"last 1 safari version"
56+
]
57+
}
58+
}

public/.DS_Store

6 KB
Binary file not shown.

public/android-chrome-192x192.png

10.8 KB
Loading

public/android-chrome-512x512.png

51 KB
Loading

public/apple-touch-icon.png

9.68 KB
Loading

public/favicon-16x16.png

287 Bytes
Loading

0 commit comments

Comments
 (0)