diff --git a/client/assets/styles/colours.less b/client/assets/styles/colours.less index b6362c6b..79088b7c 100644 --- a/client/assets/styles/colours.less +++ b/client/assets/styles/colours.less @@ -131,6 +131,15 @@ svg { } } +@keyframes co-text { + from { + color: @black; + } + to { + color: @gray-exists; + } +} + button { &.blue { border-color: @blue; diff --git a/client/assets/styles/instance.less b/client/assets/styles/instance.less index 44857870..9990b400 100644 --- a/client/assets/styles/instance.less +++ b/client/assets/styles/instance.less @@ -438,9 +438,35 @@ .faceoff-text { grid-area: text; - text-align: center; - align-self: center; - height: auto; + font-size: 200%; + text-transform: uppercase; + letter-spacing: 1em; + + color: @black; + animation: faceoff 4s linear 0s 2 alternate; + + &.winner { + color: @yellow; + animation: win 2s linear 0s 1; + } +} + +@keyframes faceoff { + from { + color: @black; + } + to { + color: @white; + } +} + +@keyframes win { + from { + color: @black; + } + to { + color: @yellow; + } } /* Mobile Nav*/ diff --git a/client/src/components/faceoff.jsx b/client/src/components/faceoff.jsx index c589a60c..d6a068fd 100644 --- a/client/src/components/faceoff.jsx +++ b/client/src/components/faceoff.jsx @@ -81,26 +81,19 @@ function Faceoff(props) { } function faceoffText() { if (!instance.winner) { - const zero = Date.parse(instance.phase_start); - const now = Date.now(); - const end = Date.parse(instance.phase_end); - const timerPct = instance.phase_end - ? ((now - zero) / (end - zero) * 100) - : 100; - const fight = timerPct > 10 ?

FIGHT

: null; return ( -
-

{otherTeam.name}

-

vs

-

{playerTeam.name}

- {fight} +
+
{otherTeam.name}
+
vs
+
{playerTeam.name}
); } - const winner = instance.winner === playerTeam.id ? playerTeam.name : otherTeam.name; + const winner = instance.winner === playerTeam.id ? playerTeam : otherTeam; return ( -
-

{winner} wins

+
+
{winner.name}
+
win
) diff --git a/client/src/components/instance.component.jsx b/client/src/components/instance.component.jsx index 3d935752..44df54e7 100644 --- a/client/src/components/instance.component.jsx +++ b/client/src/components/instance.component.jsx @@ -62,9 +62,9 @@ class Instance extends Component { if (!instance) return false; - if (instance.phase !== 'InProgress') { + // if (instance.phase !== 'InProgress') { return ; - } + // } function instanceClick(e) { e.stopPropagation(); diff --git a/client/src/components/scoreboard.jsx b/client/src/components/scoreboard.jsx deleted file mode 100644 index ee2e9e1d..00000000 --- a/client/src/components/scoreboard.jsx +++ /dev/null @@ -1,52 +0,0 @@ -const preact = require('preact'); -const { connect } = require('preact-redux'); - -const addState = connect( - function receiveState(state) { - const { - ws, - instance - } = state; - - return { instance }; - }, -); - -function ScoreBoard(args) { - const { - instance, - } = args; - - const players = instance.players.map((p, i) => { - if (instance.phase === 'Finished') { - const winner = p.wins > instance.max_rounds / 2; - return - {p.name} - {p.wins} / {p.losses} - {winner ? 'winner' : ''} - - } - - const text = instance.phase === 'Finished' - ? p.wins > instance.rounds / 2 && 'Winner' - : ''; - - return - {p.name} - {p.wins} / {p.losses} - {p.ready ? 'ready' : ''} - - }); - - return ( - - - {players} - -
- ); -} - -module.exports = addState(ScoreBoard); diff --git a/client/src/components/vertical.thresholds.js b/client/src/components/vertical.thresholds.js deleted file mode 100644 index ab079170..00000000 --- a/client/src/components/vertical.thresholds.js +++ /dev/null @@ -1,172 +0,0 @@ -const preact = require('preact'); -const range = require('lodash/range'); - -const { INFO } = require('./../constants'); -const { convertItem } = require('../utils'); -const shapes = require('./shapes'); - -const ScoreBoard = require('./scoreboard'); - -function InfoComponent(args) { - const { - itemInfo, - combiner, - player, - instance, - } = args; - - args.info = 'PowerRG'; - const { info } = args; - - function Info() { - if (!info) return false; - const fullInfo = itemInfo.items.find(i => i.item === info) || INFO[info]; - if (!fullInfo) return false; - const isSkill = fullInfo.skill; - const isSpec = fullInfo.spec; - - if (isSkill) { - return ( -
-

{fullInfo.item}

-
{fullInfo.description}
-
- ); - } - - if (isSpec) { - let red = 0; - let blue = 0; - let green = 0; - player.constructs.forEach(construct => { - red += construct.colours.red; - blue += construct.colours.blue; - green += construct.colours.green; - }); - const teamColours = { red, blue, green }; - - const colourReqs = fullInfo.values.bonuses || []; - - const thresholds = colourReqs.map((bonus, i) => { - const colours = ['red', 'green', 'blue']; - const colourGoals = colours.map(c => { - const colourReq = bonus.req[c]; - if (colourReqs === 0) return false; - - const start = i === 0 - ? 0 - : colourReqs[i - 1].req[c]; - - const dots = range(start, colourReq).map(j => { - const unmet = teamColours[c] < j + 1; - - const reqClass = unmet - ? 'unmet' - : ''; - - return ( -
- {shapes.square([c])} -
- ); - }); - - return ( -
- {dots} -
- ); - }); - - const reqsMet = colours.every(c => teamColours[c] >= bonus.req[c]); - - const reqClass = reqsMet - ? '' - : 'unmet'; - - return ( -
-
- {colourGoals} -
-
- + {bonus.bonus} -
-
-
- ); - }); - - return ( -
-

{info}

-
{fullInfo.description}
-
- {thresholds} -
-
- ); - } - - return ( -
-

{fullInfo.item}

-
{fullInfo.description}
-
- ); - } - - function Combos() { - if (!player) return false; - - // show recipe for what's in combiner - if (combiner.some(u => u !== null)) { - const filteredCombos = itemInfo.combos - .filter(combo => combiner.every(u => u === null - || combo.components.includes(player.vbox.bound[u]))); - if (filteredCombos.length > 6) return false; - return ( - - - {filteredCombos.map((c, i) => - - - {c.components.map((u, j) => )} - - )} - -
{convertItem(c.item)}{convertItem(u)}
- ); - } - - if (!info) return false; - const vboxCombos = itemInfo.combos.filter(c => c.components.includes(info)); - if (vboxCombos.length > 6) return false; - return ( - - - {vboxCombos.map((c, i) => - - - {c.components.map((u, j) => )} - - )} - -
{convertItem(c.item)}{convertItem(u)}
- ); - } - - const scoreboard = instance.phase === 'Lobby' || info - ? null - : ; - - return ( -
- {scoreboard} - - -
- ); -} - -module.exports = InfoComponent;