Skip to content

Commit f72798f

Browse files
committed
beta v1
1 parent 0f10e3c commit f72798f

File tree

7 files changed

+44
-3
lines changed

7 files changed

+44
-3
lines changed

.eslintcache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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":4129,"mtime":1609637397988,"results":"11","hashOfConfig":"12"},{"size":900,"mtime":1609087160929,"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":699,"mtime":1609633027870,"results":"17","hashOfConfig":"12"},{"size":1141,"mtime":1609633801331,"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":null},"7yfzp7",{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"26"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"26"},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"33"},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"36"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"36"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"36"},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/charchill/Work/Projects/catchphrase-word-game/src/pages/in-game/ingame.js",["45"],"/Users/charchill/Work/Projects/catchphrase-word-game/src/index.js",[],["46","47"],"/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",[],["48","49"],"/Users/charchill/Work/Projects/catchphrase-word-game/src/pages/main/main.js",[],["50","51"],"/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",[],"/Users/charchill/Work/Projects/catchphrase-word-game/src/components/main-body-content/mbc.js",[],{"ruleId":"52","severity":1,"message":"53","line":65,"column":8,"nodeType":"54","endLine":65,"endColumn":10,"suggestions":"55"},{"ruleId":"56","replacedBy":"57"},{"ruleId":"58","replacedBy":"59"},{"ruleId":"56","replacedBy":"60"},{"ruleId":"58","replacedBy":"61"},{"ruleId":"56","replacedBy":"62"},{"ruleId":"58","replacedBy":"63"},"react-hooks/exhaustive-deps","React Hook useEffect has missing dependencies: 'endAudio' and 'millisec'. Either include them or remove the dependency array.","ArrayExpression",["64"],"no-native-reassign",["65"],"no-negated-in-lhs",["66"],["65"],["66"],["65"],["66"],{"desc":"67","fix":"68"},"no-global-assign","no-unsafe-negation","Update the dependencies array to be: [endAudio, millisec]",{"range":"69","text":"70"},[2186,2188],"[endAudio, millisec]"]
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":"25"},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"25"},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"43"},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/charchill/Work/Projects/catchphrase-word-game/src/pages/in-game/ingame.js",["46"],"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",["47","48"],"/Users/charchill/Work/Projects/catchphrase-word-game/src/index.js",[],"/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",[],["49","50"],"/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",[],["51","52"],"/Users/charchill/Work/Projects/catchphrase-word-game/src/components/main-body-content/mbc.js",[],{"ruleId":"53","severity":1,"message":"54","line":69,"column":8,"nodeType":"55","endLine":69,"endColumn":10,"suggestions":"56"},{"ruleId":"57","replacedBy":"58"},{"ruleId":"59","replacedBy":"60"},{"ruleId":"57","replacedBy":"61"},{"ruleId":"59","replacedBy":"62"},{"ruleId":"57","replacedBy":"63"},{"ruleId":"59","replacedBy":"64"},"react-hooks/exhaustive-deps","React Hook useEffect has missing dependencies: 'endAudio' and 'millisec'. Either include them or remove the dependency array.","ArrayExpression",["65"],"no-native-reassign",["66"],"no-negated-in-lhs",["67"],["66"],["67"],["66"],["67"],{"desc":"68","fix":"69"},"no-global-assign","no-unsafe-negation","Update the dependencies array to be: [endAudio, millisec]",{"range":"70","text":"71"},[2323,2325],"[endAudio, millisec]"]

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"react-bootstrap": "^1.4.0",
1616
"react-customizable-progressbar": "^1.0.2",
1717
"react-dom": "^17.0.1",
18+
"react-ga": "^3.3.0",
19+
"react-helmet": "^6.1.0",
1820
"react-router-dom": "^5.2.0",
1921
"react-scripts": "4.0.1",
2022
"use-sound": "^2.0.1",

public/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta name="theme-color" content="#000000" />
8-
<meta name="description" content="CatchPhrase - Online multiplayer word game - Party/Beer/High/Drunk game" />
8+
<meta name="description" content="CatchPhrase - Online multiplayer word game - Party/Beer/High/Drink/Weed game - Inspired by Jimmy Fallon Catchphrase game show - Late night show" />
99
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
10+
<meta name="author" content="Motasim Foad" />
11+
<meta name="keywords" content="Catchphrase, multiplayer, Online, word, game, Party, Beer, High, Drunk, Drink, weed, game, family, Jimmy, fallon, show, the, Late, night, show" />
1012
<!--
1113
manifest.json provides metadata used when your web app is installed on a
1214
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/

src/pages/in-game/ingame.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import Footer from "../../components/footer/footer.js";
88
import TimerSound from "../../assets/audio/timer.mp3";
99
import EndTimerSound from "../../assets/audio/bomb.mp3";
1010
import Header from "../../components/header/header.js";
11-
import ProgressBar from 'react-customizable-progressbar'
11+
import ProgressBar from 'react-customizable-progressbar';
12+
import ReactGa from 'react-ga';
13+
14+
ReactGa.initialize("UA-154721739-1");
15+
ReactGa.pageview('catchphrase.motasimfoad.com - Ingame Screen');
1216

1317
function Ingame() {
1418
const [myObj, setMyObj] = useState(["a","b","c"]);

src/pages/main/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import Footer from "../../components/footer/footer.js";
55
import Header from '../../components/header/header.js';
66
import Mbc from '../../components/main-body-content/mbc.js';
77
import { Link } from "react-router-dom";
8+
import ReactGa from 'react-ga';
9+
10+
ReactGa.initialize("UA-154721739-1");
11+
ReactGa.pageview('catchphrase.motasimfoad.com - Rules Screen');
812

913
function App() {
1014
return (

src/pages/pre-game/pregame.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { Button, Container, Row, Form } from 'react-bootstrap';
44
import {Link} from 'react-router-dom';
55
import Footer from "../../components/footer/footer.js";
66
import Header from "../../components/header/header.js";
7+
import ReactGa from 'react-ga';
8+
9+
ReactGa.initialize("UA-154721739-1");
10+
ReactGa.pageview('catchphrase.motasimfoad.com - Pregame Screen');
711

812
function Pregame() {
913
const [num, setNum] = useState("");

yarn.lock

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9132,6 +9132,26 @@ react-error-overlay@^6.0.8:
91329132
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.8.tgz"
91339133
integrity sha512-HvPuUQnLp5H7TouGq3kzBeioJmXms1wHy9EGjz2OURWBp4qZO6AfGEcnxts1D/CbwPLRAgTMPCEgYhA3sEM4vw==
91349134

9135+
react-fast-compare@^3.1.1:
9136+
version "3.2.0"
9137+
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb"
9138+
integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==
9139+
9140+
react-ga@^3.3.0:
9141+
version "3.3.0"
9142+
resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-3.3.0.tgz#c91f407198adcb3b49e2bc5c12b3fe460039b3ca"
9143+
integrity sha512-o8RScHj6Lb8cwy3GMrVH6NJvL+y0zpJvKtc0+wmH7Bt23rszJmnqEQxRbyrqUzk9DTJIHoP42bfO5rswC9SWBQ==
9144+
9145+
react-helmet@^6.1.0:
9146+
version "6.1.0"
9147+
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726"
9148+
integrity sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==
9149+
dependencies:
9150+
object-assign "^4.1.1"
9151+
prop-types "^15.7.2"
9152+
react-fast-compare "^3.1.1"
9153+
react-side-effect "^2.1.0"
9154+
91359155
react-is@^16.3.2, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
91369156
version "16.13.1"
91379157
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz"
@@ -9261,6 +9281,11 @@ [email protected]:
92619281
optionalDependencies:
92629282
fsevents "^2.1.3"
92639283

9284+
react-side-effect@^2.1.0:
9285+
version "2.1.1"
9286+
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.1.tgz#66c5701c3e7560ab4822a4ee2742dee215d72eb3"
9287+
integrity sha512-2FoTQzRNTncBVtnzxFOk2mCpcfxQpenBMbk5kSVBg5UcPqV9fRbgY2zhb7GTWWOlpFmAxhClBDlIq8Rsubz1yQ==
9288+
92649289
react-transition-group@^4.4.1:
92659290
version "4.4.1"
92669291
resolved "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.1.tgz"

0 commit comments

Comments
 (0)