Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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*
1 change: 1 addition & 0 deletions _redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "lambda-mud",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"pusher-js": "^4.3.1",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-logger": "^1.1.0",
"react-redux": "^6.0.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-scripts": "2.1.1",
"react-thunk": "^1.0.0",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build && cp build/index.html build/404.html",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
Binary file added public/favicon.ico
Binary file not shown.
41 changes: 41 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. 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>
15 changes: 15 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
176 changes: 176 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
* {
box-sizing: border-box;
}

body {
font-family: 'Roboto', sans-serif;
}

.home-wrap{
background-image: url('./imgs/castle.jpg');
height: 100vh;
widows: 100vh;
display: flex;
justify-content: center;
align-items: center;
}

.home-box{
margin: auto;
height: 300px;
width: 400px;
background-color: rgba(255,255,255, 0.5);
border-radius: 10px;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
border: 2px solid blue;
}

.home-title{
font-size: 32px;
}

.auth-title{
font-size: 32px;
margin-bottom: -20px;
}

.home-links{
width: 100%;
display: flex;
justify-content: space-evenly;
}
.auth-links{
width: 100%;
display: flex;
justify-content: space-evenly;
margin-top: 10px;
}

button{
height: 30px;
width: 80px;
background-color: lightblue;
border: 1px solid blue;
border-radius: 5px;
color: white;
}

.forms{
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
height: 65%;
width: 100%;
}

.forms .auth-form{
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
}

.main{
margin: auto;
height: 700px;
width: 900px;
background-color: rgba(255,255,255, 0.5);
border-radius: 10px;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
border: 2px solid blue;
}

.main-title{
font-size: 32px;
}

.main-inner{
height: 75%;
width: 90%;
display: flex;
flex-direction: column;
}

.main-inner .message-log{
height: 90%;
width: 100%;
background-color: white;
border: 1px solid blue;
overflow: auto;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 20px 0 20px;
}
.main-inner .message-log .message{
width: 100%;
padding: 20px;
border-bottom: 1px solid gray
}

.main-inner form{
width: 100%;
height: 10%;
display: flex;
align-items: center;
}

.main-inner form input{
width: 100%;
height: 25px;
border: 1px solid blue
}


.message{
white-space:pre-wrap;
}
51 changes: 51 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React, { Component } from 'react';
import './App.css';
import { Route, withRouter } from 'react-router-dom'
import { connect } from 'react-redux';
import * as actions from './actions';

import Home from './components/Home'
import Register from './components/auth/Register'
import Login from './components/auth/Login'
import Main from'./components/Main'

class App extends Component {
render() {
return (
<div className="App">
<Route exact path = '/' render = {(props)=><Home {...props} />} />
<Route exact path = '/register' render = {(props)=><Register {...props} />} />
<Route exact path = '/login' render = {(props)=><Login {...props} />} />
<Route
exact path = '/main'
render = {(props)=>
<Main {...props} {...this.props} />}
/>
</div>
);
}
}


const mapStateToProps = state => {
return {
fetchingInit: state.fetchingInit,
title: state.title,
description: state.description,
name: state.name,
players: state.players,
data: state.data,
error: state.error,
uuid: state.uuid,
health: state.health,
attack: state.attack,
defense: state.defense
};
};

export default withRouter(
connect(
mapStateToProps,
actions
)(App)
);
9 changes: 9 additions & 0 deletions src/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
Loading