profesh... except the css
This commit is contained in:
@@ -1,137 +0,0 @@
|
||||
// const { connect } = require('preact-redux');
|
||||
const preact = require('preact');
|
||||
const { connect } = require('preact-redux');
|
||||
|
||||
const { errorToast, infoToast } = require('../utils');
|
||||
const actions = require('./../actions');
|
||||
|
||||
const VERSION = process.env.npm_package_version;
|
||||
|
||||
const Welcome = require('./welcome');
|
||||
|
||||
const addState = connect(
|
||||
function receiveState(state) {
|
||||
const {
|
||||
ws,
|
||||
account,
|
||||
instances,
|
||||
invite,
|
||||
pvp,
|
||||
} = state;
|
||||
|
||||
function sendInstanceState(id) {
|
||||
ws.sendInstanceState(id);
|
||||
}
|
||||
|
||||
function sendInstancePractice() {
|
||||
ws.sendInstancePractice();
|
||||
}
|
||||
|
||||
function sendInstanceQueue() {
|
||||
ws.sendInstanceQueue();
|
||||
}
|
||||
|
||||
function sendInstanceInvite() {
|
||||
ws.sendInstanceInvite();
|
||||
}
|
||||
|
||||
function sendInstanceLeave() {
|
||||
ws.sendInstanceLeave();
|
||||
}
|
||||
|
||||
return {
|
||||
account,
|
||||
instances,
|
||||
invite,
|
||||
pvp,
|
||||
|
||||
sendInstanceState,
|
||||
sendInstanceQueue,
|
||||
sendInstancePractice,
|
||||
sendInstanceInvite,
|
||||
sendInstanceLeave,
|
||||
};
|
||||
},
|
||||
|
||||
function receiveDispatch(dispatch) {
|
||||
function setMtxActive(mtx) {
|
||||
dispatch(actions.setConstructRename(null));
|
||||
dispatch(actions.setMtxActive(mtx));
|
||||
return true;
|
||||
}
|
||||
|
||||
function setNav(place) {
|
||||
return dispatch(actions.setNav(place));
|
||||
}
|
||||
|
||||
return {
|
||||
setMtxActive,
|
||||
setNav,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
function Play(args) {
|
||||
const {
|
||||
account,
|
||||
instances,
|
||||
invite,
|
||||
pvp,
|
||||
|
||||
sendInstanceState,
|
||||
sendInstanceQueue,
|
||||
sendInstancePractice,
|
||||
sendInstanceInvite,
|
||||
sendInstanceLeave,
|
||||
|
||||
setNav,
|
||||
} = args;
|
||||
|
||||
const news = (
|
||||
<div class="news">
|
||||
<p> MNML is a turn-based 1v1 strategy game in an abstract setting. </p>
|
||||
<p>
|
||||
Build a unique team of 3 constructs from a range of skills and specialisations.<br />
|
||||
Outplay your opponent in multiple rounds by adapting to an always shifting meta. <br />
|
||||
Simple rules, complex interactions and unique mechanics.<br />
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
const list = () => {
|
||||
return (
|
||||
<div class='list play'>
|
||||
<figure>
|
||||
<button
|
||||
class="ready"
|
||||
onClick={() => sendInstancePractice()}>
|
||||
Tutorial
|
||||
</button>
|
||||
<figcaption>Learn MNML</figcaption>
|
||||
</figure>
|
||||
<figure>
|
||||
<button
|
||||
class='discord-btn'
|
||||
onClick={() => window.open('https://discord.gg/YJJgurM') }>
|
||||
|
||||
</button>
|
||||
<figcaption>Join the Community</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<section class="top">
|
||||
<div class="news">
|
||||
<h1>Welcome to MNML</h1>
|
||||
{list()}
|
||||
<hr />
|
||||
{news}
|
||||
</div>
|
||||
<Welcome />
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = addState(Play);
|
||||
@@ -4,7 +4,6 @@ const preact = require('preact');
|
||||
const actions = require('./../actions');
|
||||
|
||||
const AccountTop = require('./account.top');
|
||||
const GuestTop = require('./guest.top');
|
||||
const Play = require('./play');
|
||||
const Shop = require('./shop');
|
||||
const Reshape = require('./reshape');
|
||||
@@ -13,12 +12,10 @@ const addState = connect(
|
||||
function receiveState(state) {
|
||||
const {
|
||||
nav,
|
||||
authenticated,
|
||||
} = state;
|
||||
|
||||
return {
|
||||
nav,
|
||||
authenticated,
|
||||
};
|
||||
},
|
||||
);
|
||||
@@ -29,8 +26,6 @@ function Top(args) {
|
||||
authenticated,
|
||||
} = args;
|
||||
|
||||
if (!authenticated) return <GuestTop />
|
||||
|
||||
if (nav === 'account') return <AccountTop />;
|
||||
if (nav === 'play') return <Play />
|
||||
if (nav === 'shop') return <Shop />
|
||||
|
||||
@@ -4,27 +4,35 @@ const { connect } = require('preact-redux');
|
||||
const Main = require('./main');
|
||||
// const Nav = require('./nav');
|
||||
const Controls = require('./controls');
|
||||
const FrontPage = require('./front.page');
|
||||
|
||||
const addState = connect(
|
||||
({ game, instance }) => ({ game, instance })
|
||||
({ game, instance, authenticated }) => ({ game, instance, authenticated })
|
||||
);
|
||||
|
||||
function Mnml(args) {
|
||||
const {
|
||||
game,
|
||||
instance,
|
||||
authenticated,
|
||||
} = args;
|
||||
|
||||
const rotateClass = (game || instance) && window.innerHeight < 900 && window.innerWidth < window.innerHeight
|
||||
? 'show'
|
||||
: '';
|
||||
|
||||
if (!authenticated) return (
|
||||
<div id="mnml" class='front-page'>
|
||||
<FrontPage />
|
||||
<div id="rotate" class={rotateClass} ></div>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div id="mnml">
|
||||
<Main />
|
||||
<Controls />
|
||||
<div id="rotate" class={rotateClass} >
|
||||
</div>
|
||||
<div id="rotate" class={rotateClass} ></div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user