Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game Playing and Images uploaded #6

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6078f04
initial commit after c-r-a
tactnician Jan 5, 2020
164018f
Refactored to component folder structure
tactnician Jan 5, 2020
10d7ba0
Updated lambdaX templates
tactnician Jan 5, 2020
6ef7ac0
initialized Game branch
tactnician Jan 7, 2020
4f2eb4e
File setup
laura-daugherty Jan 7, 2020
fa3504b
adding routes
laura-daugherty Jan 7, 2020
cc0d882
setting background image
laura-daugherty Jan 7, 2020
1fe08a4
bg image
laura-daugherty Jan 7, 2020
4eded39
landing page setup
laura-daugherty Jan 7, 2020
3c02474
landing para style
laura-daugherty Jan 7, 2020
0c16c8f
adding axios
laura-daugherty Jan 7, 2020
1421b4b
changing path to exact path
laura-daugherty Jan 7, 2020
c2471ae
Login basic functionality
laura-daugherty Jan 7, 2020
7fb3bb7
register basic functionality
laura-daugherty Jan 7, 2020
793a3e0
initialize staging branch
laura-daugherty Jan 8, 2020
d19b0eb
adding axios with Auth
laura-daugherty Jan 8, 2020
262fb71
adding private route
laura-daugherty Jan 8, 2020
218ca1a
changing game to private route
laura-daugherty Jan 8, 2020
8361c6f
added axios commands to terminal and began stylings for game component
tactnician Jan 8, 2020
d6a3293
adding withRouter, moving browserRouter from app
laura-daugherty Jan 8, 2020
d7667e9
merge of staging into Game branch
tactnician Jan 8, 2020
41ffcd3
adding routeContext, moving browswerRouter
laura-daugherty Jan 8, 2020
728cf75
init route context
laura-daugherty Jan 8, 2020
f408841
basic nav
laura-daugherty Jan 8, 2020
3ccab65
container style
laura-daugherty Jan 8, 2020
7cdb252
Merge pull request #2 from CSBeastMode/auth
laura-daugherty Jan 8, 2020
c5fecf7
refactored App index to fix imports
tactnician Jan 8, 2020
a6cbdfd
staging merge into Game branch
tactnician Jan 8, 2020
7b2bbb9
register basic styles
laura-daugherty Jan 8, 2020
4552ba3
basic nav styles
laura-daugherty Jan 8, 2020
f77f2e1
basic login styles
laura-daugherty Jan 8, 2020
e037e34
basic landing page styles
laura-daugherty Jan 8, 2020
2718069
flow column main app
laura-daugherty Jan 8, 2020
97d2a78
Merge pull request #3 from CSBeastMode/Styling
laura-daugherty Jan 8, 2020
fd24272
commit of styles b4 pull
tactnician Jan 8, 2020
9593512
updated command pallete to reflect deployed url
tactnician Jan 8, 2020
a0be672
commit from staging merge
tactnician Jan 8, 2020
def0855
some styling changes
tactnician Jan 9, 2020
ca33690
register style changes
laura-daugherty Jan 9, 2020
a5d131d
login styling changes
laura-daugherty Jan 9, 2020
84bfcd3
landing style changes
laura-daugherty Jan 9, 2020
51986c2
nav height change
laura-daugherty Jan 9, 2020
9e8ee68
change background height
laura-daugherty Jan 9, 2020
a7cacaa
ship
laura-daugherty Jan 9, 2020
28d4147
package lock
laura-daugherty Jan 9, 2020
66fdd46
Merge pull request #4 from CSBeastMode/Styling
laura-daugherty Jan 9, 2020
f826f2a
added material-ui to control grid layout
tactnician Jan 9, 2020
79f999f
init/move endpoints connect to BE successfully
arvagas Jan 9, 2020
5851cad
Merge pull request #5 from CSBeastMode/move-init
arvagas Jan 9, 2020
d5e27d0
merge commit staging to Game
tactnician Jan 9, 2020
93a1cf6
attempting to pass props/ context
tactnician Jan 9, 2020
6c2c140
refactored to share context between terminal and map
tactnician Jan 9, 2020
d64c5eb
added new images and updated titles
tactnician Jan 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
File renamed without changes.
File renamed without changes.
14,675 changes: 14,675 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "front-end",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.8.3",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"axios": "^0.19.1",
"dotenv": "^8.2.0",
"plotly.js": "^1.52.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-plotly.js": "^2.4.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.3.0",
"semantic-ui-react": "^0.88.2",
"styled-components": "^4.4.1",
"terminal-in-react": "^4.3.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Binary file added public/favicon.ico
Binary file not shown.
43 changes: 43 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
2 changes: 2 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
26 changes: 26 additions & 0 deletions src/App/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react'
import { BrowserRouter, } from "react-router-dom";
import Routes from './routes'

import { Main } from './styles'

import Nav from '../Nav'
import { RouteContext } from "../Contexts/routeContext";

const App = (props) => {

const routeProps = props

return (
<RouteContext.Provider value={{routeProps}}>
<Main>
<Nav />
<Routes />
</Main>
</RouteContext.Provider>
)

}

export default App

26 changes: 26 additions & 0 deletions src/App/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React, { useState } from 'react'
import { Route } from "react-router-dom";
import { PrivateRoute } from "../utilities/PrivateRoute";

import Game from '../Game'
import Login from '../Login'
import Register from '../Register'
import Landing from '../Landing'

const Routes = () => {

return (
<>
<Route exact path='/' component={Landing} />
<PrivateRoute path='/game' component={Game} />
<Route path='/login' component={Login} />
<Route path='/register' component={Register} />
{/* <Route path='/' component={} /> */}
{/* <Route path='/' component={} /> */}
{/* <Route path='/' component={} /> */}
{/* <Route path='/' component={} /> */}
</>
)
}

export default Routes
24 changes: 24 additions & 0 deletions src/App/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import styled from 'styled-components'
import img from '../Images/jeremy-thomas-4dpAqfTbvKA-unsplash.jpg'
// adding comment
export const Main = styled.main`
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;

main {
width: 99%
height: 99%
}


// flex-flow: column;
background-image: url(${img});
background-color: #D4C7DC; /* Used if the image is unavailable */
height: -webkit-fill-available; /* You must set a specified height */
background-position: center; /* Center the image */
background-repeat: no-repeat; /* Do not repeat the image */
background-size: cover; /* Resize the background image to cover the entire container */
`

5 changes: 5 additions & 0 deletions src/Contexts/roomContext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createContext } from 'react';

const RoomContext = createContext();

export default RoomContext
3 changes: 3 additions & 0 deletions src/Contexts/routeContext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createContext } from 'react';

export const RouteContext = createContext();
35 changes: 35 additions & 0 deletions src/Game/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, {useState, useEffect} from 'react'
import Grid from '@material-ui/core/Grid'
import RoomContext from '../Contexts/roomContext'

import {
Main,
Bridge,
Container
} from "./styles";

import Terminal from '../Terminal'
import Map from '../Map'

const Game = () => {
const [title, setTitle] = useState('')
return (
<Main>
<RoomContext.Provider value={{title, setTitle}} >
<Grid container spacing={0} >
<Grid item xs={12} s={12} >
<Bridge id='bridge' updateTitle={setTitle} title={title} />
</Grid>
<Grid item xs={6} s={6} >
<Terminal id='term' updateTitle={setTitle} title={title} />
</Grid>
<Grid item xs={6} s={6} >
<Map id='map' updateTitle={setTitle} title={title} />
</Grid>
</Grid>
</RoomContext.Provider>
</Main>
)
}

export default Game
112 changes: 112 additions & 0 deletions src/Game/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import styled from 'styled-components'
import bridge from '../Images/humanbridge.png'

export const Main = styled.main`
// display: flex;
// flex-direction: row;
// justify-content: center;
// align-items: space-evenly;

`
export const Container = styled.section`

display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 20px;

#bridge{
width: 95vw;
}

#term{
width: 95vw;
}

#map{
width: 95vw;
height: 95vh;
}

// margin-top: 20px;
// height: 95vh:
// width: 95vw;
// display: grid;
// grid-template-columns: 20% 20% 20% 20% 20% //repeat(20, 5vw);
// grid-template-rows: 20% 20% 20% 20% 20% //repeat(20, 5vh);
// // max-width: 50vw;
// #bridge {
// grid-column-start: 1;
// grid-column-end: 3;
// grid-row-start: 1;
// grid-row-end: 2;
// // width: 50vh;
// }

// #term {
// grid-column-start: 1;
// grid-column-end: 3;
// grid-row-start: 3;
// grid-row-end: 5;

// }

// #map {
// grid-column-start: 3;
// grid-column-end: 5
// grid-row-start: 3;
// grid-row-end: 5;

// }
`

export const Bridge = styled.div`
// display: flex;
// justify-content: center;
// align-items: center;
border: 4px solid white;
background-image: url(${bridge});
// background-color: #D4C7DC; /* Used if the image is unavailable */
height: 500px; /* You must set a specified height */
background-position: center; /* Center the image */
background-repeat: no-repeat; /* Do not repeat the image */
background-size: cover; /* Resize the background image to cover the entire container */
`

//FROM MAIN
// display: grid;
// grid-template-rows: repeat(20, 5vw)
// grid-template-columns: repeat(20, 5vw)


// @media(min-width: 500px){
// div{
// grid-row: 0 / span 20
// grid-column: 0 / span 20
// }
// }


//FROM CONTAINER
// display: grid
// grid-template-rows: 20% 20% 20% 20% 20%
// grid-template-columns: 20% 20% 20% 20% 20%
// width: 100vw;
// height: 95vh;
// margin-top: 5px;
// padding: 0px;

// #bridge {
// grid-column: 1 / span 2;
// grid-row: 1 / span 2;
// }

// #term {
// width: 100vw;
// grid-columm: 1 / span 2;
// grid-row: 4 / span 2;
// }
// #map{
// grid-row: 4;
// }
Binary file added src/Images/Starship.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/bathroom.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/bridge.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/captainsQuarters.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/commandCenter.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/crewQuarters.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/defenseRoom.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/engineRoom.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/hallway.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/humanbridge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/jeremy-thomas-4dpAqfTbvKA-unsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/medBay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/messHall.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/purple-engine-room.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/recRoom.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/ship.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/weapons.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading