diff --git a/client/assets/styles/instance.mobile.css b/client/assets/styles/instance.mobile.css index d3761706..acc33451 100644 --- a/client/assets/styles/instance.mobile.css +++ b/client/assets/styles/instance.mobile.css @@ -61,11 +61,8 @@ } .instance.constructs-visible .construct-list { - display: flex; - flex-flow: row; - align-content: flex-end; - height: 100%; - margin: 0; + display: grid; + grid-auto-rows: 1fr; } .vbox-inventory { @@ -88,7 +85,6 @@ } .instance-construct { - flex: 1; display: grid; grid-template-rows: min-content min-content min-content 1fr min-content; grid-template-areas: @@ -107,10 +103,6 @@ transition-timing-function: ease; } - .instance-construct .avatar { - min-height: 150px; - } - .instance-construct:first-child { border-left-width: 0; } diff --git a/client/src/components/footer.jsx b/client/src/components/footer.jsx index edad7dd2..07b3caa3 100644 --- a/client/src/components/footer.jsx +++ b/client/src/components/footer.jsx @@ -5,7 +5,7 @@ const { connect } = require('preact-redux'); const actions = require('./../actions'); const TeamFooter = require('./team.footer'); -const ListFooter = require('./list.footer'); +const PlayFooter = require('./play.footer'); const InstanceFooter = require('./instance.footer'); const GameFooter = require('./game.footer'); @@ -30,8 +30,8 @@ function renderHeader(args) { if (game) return ; if (instance) return ; - if (nav === 'team') return ; - if (nav === 'list') return ; + if (nav === 'team' || nav === 'account') return ; + if (nav === 'play' || nav === 'shop' || !nav) return ; } diff --git a/client/src/components/game.footer.jsx b/client/src/components/game.footer.jsx index 1daa4981..40095d45 100644 --- a/client/src/components/game.footer.jsx +++ b/client/src/components/game.footer.jsx @@ -9,7 +9,7 @@ const addState = connect( ws, game, account, - showNav, + animating, } = state; function sendGameReady() { @@ -24,9 +24,9 @@ const addState = connect( return { game, account, + animating, sendInstanceState, sendGameReady, - showNav, }; }, @@ -36,15 +36,7 @@ const addState = connect( dispatch(actions.setInstance(null)); } - function skip() { - dispatch(actions.setSkip(true)); - } - - function setShowNav(v) { - return dispatch(actions.setShowNav(v)); - } - - return { setShowNav, quit, skip }; + return { quit }; } ); @@ -53,22 +45,13 @@ function GameFooter(props) { const { game, account, - showNav, + animating, quit, - setShowNav, sendGameReady, sendInstanceState, } = props; - if (!game) { - return ( -
- -
- ); - } - const playerTeam = game.players.find(t => t.id === account.id); function quitClick() { @@ -86,6 +69,7 @@ function GameFooter(props) { const readyBtn = ( {game.phase === 'Finish' && quitBtn } {game.phase === 'Skill' && readyBtn } diff --git a/client/src/components/instance.footer.jsx b/client/src/components/instance.footer.jsx index ee8cf2c3..4a01e943 100644 --- a/client/src/components/instance.footer.jsx +++ b/client/src/components/instance.footer.jsx @@ -5,20 +5,16 @@ const actions = require('../actions'); const addState = connect( function receiveState(state) { - const { ws, instance, player, nav, showNav } = state; + const { ws, instance, player, nav } = state; function sendInstanceReady() { return ws.sendInstanceReady(instance.id); } - return { player, instance, sendInstanceReady, nav, showNav }; + return { player, instance, sendInstanceReady, nav }; }, function receiveDispatch(dispatch) { - function setShowNav(v) { - return dispatch(actions.setShowNav(v)); - } - function setInfo(c) { return dispatch(actions.setInfo(c)); } @@ -30,7 +26,6 @@ const addState = connect( return { setInfo, setNav, - setShowNav, }; } ); @@ -44,7 +39,6 @@ function Instance(args) { setInfo, setNav, - setShowNav, sendInstanceReady, } = args; @@ -118,7 +112,6 @@ function Instance(args) { return (
{timer} - {navBtn} {readyBtn}
diff --git a/client/src/components/list.footer.jsx b/client/src/components/list.footer.jsx deleted file mode 100644 index 65109d72..00000000 --- a/client/src/components/list.footer.jsx +++ /dev/null @@ -1,48 +0,0 @@ -const { connect } = require('preact-redux'); -const preact = require('preact'); - -const actions = require('./../actions'); - -const addState = connect( - function receiveState(state) { - const { showNav } = state; - return { showNav }; - }, - function receiveDispatch(dispatch) { - function navToTeam() { - return dispatch(actions.setNav('team')); - } - - function setShowNav(v) { - return dispatch(actions.setShowNav(v)); - } - - return { - navToTeam, - setShowNav, - }; - } -); - -function ListFooter(args) { - return false; - - // const { - // showNav, - - // navToTeam, - // setShowNav, - // } = args; - - // return ( - //
- // - // - //
- // ); -} - -module.exports = addState(ListFooter); diff --git a/client/src/components/play.footer.jsx b/client/src/components/play.footer.jsx new file mode 100644 index 00000000..f8a8479a --- /dev/null +++ b/client/src/components/play.footer.jsx @@ -0,0 +1,139 @@ +const preact = require('preact'); +const { connect } = require('preact-redux'); + +const { errorToast, infoToast } = require('../utils'); + +const AccountBox = require('./account.box'); + +const addState = connect( + function receiveState(state) { + const { + ws, + instances, + invite, + } = state; + + function sendInstanceState(id) { + ws.sendInstanceState(id); + } + + function sendInstancePractice() { + ws.sendInstancePractice(); + } + + function sendInstanceQueue() { + ws.sendInstanceQueue(); + } + + function sendInstanceInvite() { + ws.sendInstanceInvite(); + } + + return { + instances, + invite, + + sendInstanceState, + sendInstanceQueue, + sendInstancePractice, + sendInstanceInvite, + }; + } +); + +function JoinButtons(args) { + const { + instances, + invite, + + sendInstanceState, + sendInstanceQueue, + sendInstancePractice, + sendInstanceInvite, + } = args; + + const discordBtn = ( + + ); + + if (instances.length) { + return ( +
+
+ +
+ ); + } + + const inviteBtn = () => { + if (!invite) { + return ( + + ); + } + + function copyClick(e) { + const link = `${document.location.origin}#join=${invite}`; + const textArea = document.createElement('textarea', { id: '#clipboard' }); + textArea.value = link; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + + try { + document.execCommand('copy'); + infoToast('Invite link copied.'); + } catch (err) { + console.error('link copy error', err); + errorToast('Invite link copy error.'); + } + + document.body.removeChild(textArea); + return true; + } + + return ( + + ); + }; + + return ( + + ); +} + +module.exports = addState(JoinButtons); diff --git a/server/src/names.rs b/server/src/names.rs index e5ff7943..48d81c7c 100644 --- a/server/src/names.rs +++ b/server/src/names.rs @@ -1,7 +1,7 @@ use rand::prelude::*; use rand::{thread_rng}; -const FIRSTS: [&'static str; 50] = [ +const FIRSTS: [&'static str; 51] = [ "artificial", "ambient", "borean", @@ -17,6 +17,7 @@ const FIRSTS: [&'static str; 50] = [ "emotive", "emotionless", "elliptical", + "extrasolar", "fierce", "fossilised", "frozen", @@ -54,9 +55,10 @@ const FIRSTS: [&'static str; 50] = [ "weary", ]; -const LASTS: [&'static str; 55] = [ +const LASTS: [&'static str; 56] = [ "artifact", "assembly", + "alloy", "carbon", "console", "construct", @@ -68,7 +70,7 @@ const LASTS: [&'static str; 55] = [ "detector", "energy", "entropy", - "exomorph", + "exoplanet", "foilage", "forest", "form",