diff --git a/WORKLOG.md b/WORKLOG.md index 3489c8da..5a757c5f 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -10,9 +10,9 @@ * treats * constructs jiggle when clicked * background colour changes depending on time of day - -* bug fixes - * pvp 1st round doesn't resolve until warden timer completes + * hit animation wobble + * combat text scale + translate + * susbcriber gold name in instance * bot game grind * stress test diff --git a/bin/deploy.sh b/bin/deploy.sh index f84b7d97..dcf11a59 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -6,7 +6,6 @@ MNML_PATH=$(realpath "$DIR/../") VERSION=$(<"$MNML_PATH/VERSION") SERVER_BIN_DIR="/usr/local/mnml/bin" - CLIENT_DIST_DIR="/var/lib/mnml/client" CLIENT_PUBLIC_DIR="/var/lib/mnml/public/current" diff --git a/client/assets/styles/account.less b/client/assets/styles/account.less index d6f43a30..74ef9e3c 100644 --- a/client/assets/styles/account.less +++ b/client/assets/styles/account.less @@ -1,9 +1,6 @@ @import 'colours.less'; .account { - margin-top: 2em; - grid-area: bottom; - display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; grid-gap: 0 1em; diff --git a/client/assets/styles/controls.less b/client/assets/styles/controls.less index d036debc..4484d720 100644 --- a/client/assets/styles/controls.less +++ b/client/assets/styles/controls.less @@ -8,10 +8,17 @@ aside { "timer controls"; grid-template-columns: min-content 1fr; - grid-template-rows: 1fr 1fr 1fr; - grid-gap: 0.5em 0; + grid-template-rows: 1fr; - padding: 1em 1em 1em 0; + padding-left: 1em; + + .controls { + grid-area: controls; + + display: grid; + grid-auto-rows: 1fr; + grid-gap: 0.5em 0; + } // fix chrome being inconsistent table { diff --git a/client/assets/styles/instance.less b/client/assets/styles/instance.less index 96dfd4cd..ee7a1898 100644 --- a/client/assets/styles/instance.less +++ b/client/assets/styles/instance.less @@ -1,9 +1,9 @@ @import 'colours.less'; .instance { - overflow-x: hidden; + overflow: hidden; display: grid; - grid-template-columns: 2fr minmax(min-content, 1fr); + grid-template-columns: 1fr minmax(min-content, 1fr); grid-template-rows: min-content 1fr; grid-template-areas: diff --git a/client/assets/styles/menu.less b/client/assets/styles/menu.less index fb919124..041f0263 100644 --- a/client/assets/styles/menu.less +++ b/client/assets/styles/menu.less @@ -4,16 +4,16 @@ height: 100%; display: grid; - grid-template-rows: minmax(min-content, 2fr) 1fr; + grid-template-rows: min-content 1fr 2fr; grid-template-columns: 1fr; grid-template-areas: + "hdr" "top" "bottom"; .top { grid-area: top; - padding: 0 0 0.5em 2em; border-bottom: 0.1em solid #222; box-sizing: border-box; } @@ -24,9 +24,10 @@ .team { display: grid; - grid-area: top; + grid-area: bottom; grid-template-columns: repeat(auto-fill, minmax(min-content, 33%)); max-height: 100%; + margin-top: 1em; .team-select:not(:nth-child(3n)) { margin-right: 0.5em; @@ -61,9 +62,6 @@ } .inventory { - margin-top: 2em; - grid-area: bottom; - display: grid; grid-template-columns: 1fr 1fr; @@ -71,6 +69,10 @@ margin-bottom: 0.5em; } + .news { + padding-right: 1em; + } + .list { letter-spacing: 0.25em; text-transform: uppercase; @@ -87,4 +89,21 @@ flex-flow: column; } } + + .options { + grid-area: hdr; + + button { + width: 25%; + border-top: 0; + border: 1px solid #222; + &:not(:last-child) { + border-right: 0; + } + + &:last-child { + float: right; + } + } + } } diff --git a/client/assets/styles/styles.less b/client/assets/styles/styles.less index 30b6d8e1..cd773c0d 100644 --- a/client/assets/styles/styles.less +++ b/client/assets/styles/styles.less @@ -67,6 +67,7 @@ hr { color: #222; margin: 1.5em 0; width: 100%; + border-top: 1px solid #222; } figure { @@ -84,16 +85,17 @@ dl { #mnml { display: grid; - grid-template-columns: minmax(min-content, 1fr) 8fr 1fr; - grid-template-rows: min-content 1fr min-content; + grid-template-columns: 9fr 1fr; + grid-template-rows: min-content min-content 1fr; grid-template-areas: - "hd hd ctrl" - "nav main ctrl" - "nav main ctrl"; + "hdr ctrl" + "main ctrl" + "main ctrl"; + + padding: 0.5em 1em; } main { - padding: 1em; grid-area: main; } @@ -198,12 +200,6 @@ button[disabled] { */ .welcome { - .highlight { - color: black; - background: @white; - border: 1px solid @white; - } - .login { width: 50%; display: flex; @@ -213,11 +209,6 @@ button[disabled] { .options { width: 50%; - display: flex; - flex-flow: row; - button { - flex: 1; - } } h2 { @@ -262,4 +253,48 @@ figure.gray { .mobile-title { display: none; +} + +header { + .options { + font-size: 150%; + } + + button { + height: 2em; + } +} + +.options { + button { + &.highlight { + color: @white; + box-shadow: inset 0px 5px 0px 0px @white; + border: 0; + &:first-child { + border-left: 1px solid #444; + } + + &:last-child { + border-right: 1px solid #444; + } + + } + + border: 1px solid #444; + flex: 1; + } +} + +nav { + display: none; +} + +ul { + margin-bottom: 1em; + list-style: inside; +} + +li { + margin-bottom: 0.5em; } \ No newline at end of file diff --git a/client/src/components/account.page.jsx b/client/src/components/account.page.jsx deleted file mode 100644 index 021bb58b..00000000 --- a/client/src/components/account.page.jsx +++ /dev/null @@ -1,33 +0,0 @@ -const { connect } = require('preact-redux'); -const preact = require('preact'); - -const Team = require('./team'); -const AccountManagement = require('./account.management'); - -const addState = connect( - function receiveState(state) { - const { - ws, - account, - } = state; - - return { - account, - }; - }, -); - -function Account(args) { - const { - account, - } = args; - - return ( -
- - -
- ); -} - -module.exports = addState(Account); diff --git a/client/src/components/account.management.jsx b/client/src/components/account.top.jsx similarity index 98% rename from client/src/components/account.management.jsx rename to client/src/components/account.top.jsx index b2799138..813e6054 100644 --- a/client/src/components/account.management.jsx +++ b/client/src/components/account.top.jsx @@ -151,19 +151,9 @@ class AccountStatus extends Component { } return ( -
+
-

{account.name}

-
-
-
spawn new construct
- -
-
- - + {subInfo()}
@@ -216,7 +206,16 @@ class AccountStatus extends Component {
- {subInfo()} +
+
+
spawn new construct
+ +
+
+ +
); diff --git a/client/src/components/collection.jsx b/client/src/components/collection.jsx new file mode 100644 index 00000000..c6441803 --- /dev/null +++ b/client/src/components/collection.jsx @@ -0,0 +1,89 @@ +const preact = require('preact'); +const { connect } = require('preact-redux'); + +const actions = require('./../actions'); +const { COLOURS } = require('./../utils'); +const { ConstructAvatar } = require('./construct'); + +const addState = connect( + function receiveState(state) { + const { ws, constructs, teamPage, teamSelect } = state; + + function sendConstructSpawn(name) { + return ws.sendMtxConstructSpawn(name); + } + + return { + constructs, + teamPage, + teamSelect, + }; + }, + function receiveDispatch(dispatch) { + function setTeam(constructIds) { + dispatch(actions.setTeamSelect(constructIds)); + } + + return { + setTeam, + }; + } +); + +function Collection(args) { + const { + constructs, + teamPage, + teamSelect, + setTeam, + } = args; + + if (!constructs) return
; + + // redux limitation + suggested workaround + // so much for dumb components + function selectConstruct(id) { + // remove + const i = teamSelect.findIndex(sid => sid === id); + if (i > -1) { + teamSelect[i] = null; + return setTeam(teamSelect); + } + + // window insert + const insert = teamSelect.findIndex(j => j === null); + if (insert === -1) return setTeam([id, null, null]); + teamSelect[insert] = id; + return setTeam(teamSelect); + } + console.log(constructs.length); + const dispConstructs = constructs.length >= ((teamPage + 1) * 6) + ? constructs.slice(teamPage * 6, (teamPage + 1) * 6) + : constructs.slice(teamPage * 6, constructs.length); + + const constructPanels = dispConstructs.map(construct => { + const colour = teamSelect.indexOf(construct.id); + const selected = colour > -1; + + const borderColour = selected ? COLOURS[colour] : '#000000'; + + return ( +
selectConstruct(construct.id)} > + +

{construct.name}

+
+ ); + }); + + return ( +
+ {constructPanels} +
+ ); +} + +module.exports = addState(Collection); diff --git a/client/src/components/game.ctrl.jsx b/client/src/components/game.ctrl.jsx index a27e4e06..4bf517d6 100644 --- a/client/src/components/game.ctrl.jsx +++ b/client/src/components/game.ctrl.jsx @@ -125,9 +125,11 @@ function Controls(args) { return ( ); } diff --git a/client/src/components/header.jsx b/client/src/components/header.jsx index 5562502b..7c776ff8 100644 --- a/client/src/components/header.jsx +++ b/client/src/components/header.jsx @@ -1,40 +1,96 @@ -// eslint-disable-next-line -const preact = require('preact'); const { connect } = require('preact-redux'); +const preact = require('preact'); -const { saw } = require('./shapes'); -const actions = require('./../actions'); - -function pingColour(ping) { - if (ping < 100) return 'forestgreen'; - if (ping < 200) return 'yellow'; - return 'red'; -} +const actions = require('../actions'); const addState = connect( - ({ account, ping, showNav }) => { - return { account, ping }; + function receiveState(state) { + const { + ws, + account, + nav, + } = state; + + function sendInstanceState(instance) { + return ws.sendInstanceState(instance.id); + } + + function sendAccountStates() { + ws.sendEmailState(); + ws.sendSubscriptionState(); + } + + return { + account, + nav, + + sendInstanceState, + sendAccountStates, + }; }, + function receiveDispatch(dispatch) { + function setNav(place) { + dispatch(actions.setGame(null)); + dispatch(actions.setInstance(null)); + dispatch(actions.setCombiner([])); + dispatch(actions.setReclaiming(false)); + dispatch(actions.setActiveSkill(null)); + dispatch(actions.setActiveConstruct(null)); + dispatch(actions.setInfo(null)); + dispatch(actions.setItemEquip(null)); + dispatch(actions.setItemUnequip([])); + dispatch(actions.setVboxHighlight([])); + + return dispatch(actions.setNav(place)); + } + + return { + setNav, + }; + } ); -function renderHeader(args) { - const { account, ping } = args; +function Header(args) { + const { + account, + nav, - const accountStatus = account - ? (
-

{account.name}

- {saw(pingColour(ping))} -
{ping}ms
-
) - : ''; + sendAccountStates, + setNav, + } = args; + + if (!account) return false; + + function navTo(p) { + return setNav(p); + } + + function accountClick() { + sendAccountStates(); + navTo('account'); + } return (
-

mnml.gg

- {accountStatus} +
+ + + +
); } - -module.exports = addState(renderHeader); +module.exports = addState(Header); \ No newline at end of file diff --git a/client/src/components/info.component.jsx b/client/src/components/info.component.jsx index 2696cadf..36fc19b5 100644 --- a/client/src/components/info.component.jsx +++ b/client/src/components/info.component.jsx @@ -18,7 +18,19 @@ function InfoComponent(args) { // const { info } = args; function Info() { - if (!info) return false; + if (!info) { + return ( +
+

VBOX phase

+

double clicking items in the VBOX will purchase and move them to your INVENTORY.

+

+ hover over an item to see its effects and combinations.
+ click an item and then click a construct to equip that item to it.
+

+

click the READY button on the right to progress to the GAME PHASE.

+
+ ); + } const fullInfo = itemInfo.items.find(i => i.item === info) || INFO[info]; if (!fullInfo) return false; const isSkill = fullInfo.skill; diff --git a/client/src/components/instance.constructs.jsx b/client/src/components/instance.constructs.jsx index 1761b656..1eecfd6e 100644 --- a/client/src/components/instance.constructs.jsx +++ b/client/src/components/instance.constructs.jsx @@ -98,7 +98,7 @@ function Construct(props) { const skill = construct.skills[i]; const s = skill ? skill.skill - : (+); + : (SKILL); function skillClick(e) { if (!skill) return false; diff --git a/client/src/components/instance.ctrl.jsx b/client/src/components/instance.ctrl.jsx index 129bb80c..a431f1d4 100644 --- a/client/src/components/instance.ctrl.jsx +++ b/client/src/components/instance.ctrl.jsx @@ -93,11 +93,13 @@ function Controls(args) { ); return ( -