diff --git a/client/src/Matches.js b/client/src/Matches.js index 7738eb8..33e41f9 100644 --- a/client/src/Matches.js +++ b/client/src/Matches.js @@ -1,17 +1,38 @@ import React from 'react'; class Matches extends React.Component { + constructor(props) { + super(props); + this.onTeamChange = this.onTeamChange.bind(this) + this.state = { + team_to_search: 1114, + } + } + + + + onTeamChange(event) { + this.setState({team_to_search: parseInt(event.target.value)}) + console.log("searching: " + event.target.value) + } + render() { return( -
+

Matches

- {this.props.event_code ? ( + {this.props.event_code ? [ + +
+ + +
, + - + - + @@ -20,16 +41,18 @@ class Matches extends React.Component { {this.props.matches.map(m => ( - - - - - - - + + + + + + + ))} -
Number
Number red 1 red 2red 3red 3 blue 1 blue 2 blue 3
{m.match_number}{m.red1}{m.red2}{m.red3}{m.blue1}{m.blue2}{m.blue3}{m.match_number}{m.red1}{m.red2}{m.red3}{m.blue1}{m.blue2}{m.blue3}
) :Select an event} + , + + ] :Select an event}
); } diff --git a/client/src/NextMatch.js b/client/src/NextMatch.js index c5dedac..8f084a8 100644 --- a/client/src/NextMatch.js +++ b/client/src/NextMatch.js @@ -56,7 +56,9 @@ class NextMatch extends React.Component { - {this.props.next_match_info.map(team_output => + {this.props.next_match_info.map(team_output => + {team_output.match_number} {team_output.alliance_colour} {team_output.team_number} diff --git a/client/src/Strategy.css b/client/src/Strategy.css index 9cdc074..f1320bb 100644 --- a/client/src/Strategy.css +++ b/client/src/Strategy.css @@ -1,3 +1,20 @@ +:root { + --red-team-colour: hsla(0, 85%, 61%, 0.7); + --blue-team-colour: hsla(210, 85%, 61%, 0.7); + /* Decrease the opacity slightly for odd numbered rows in a table for readability */ + --red-team-odd-colour: hsla(0, 85%, 61%, 0.5); + --blue-team-odd-colour: hsla(210, 85%, 61%, 0.5); + + /* A green background colour for cells that contain team to search */ + --searched-team-colour: hsla(140, 85%, 61%, 0.9); + + /* Saturated background colours for cells that contain our team */ + --our-team-red-colour: hsla(0, 100%, 30%, 1.0); + --our-team-blue-colour: hsla(210, 100%, 30%, 1.0); + + --divider: 2px solid black; +} + .Strategy { min-height: 100vh; padding-left: 1em; @@ -55,12 +72,57 @@ text-align: left; padding-right: 1em; } -th.matchNumber,td.matchNumber { - border-right: 1px solid; +.matchesContainer { + display: inline-block; +} + +.searchTeam { + float: right; + margin-left: 1vw; +} + +th.rightDivider, td.rightDivider { + border-right: var(--divider); +} + +tr.bottomDivider { + border-bottom: var(--divider); +} + +table { + border-collapse: collapse; +} + +tr.redTeam, td.redTeam { + background-color: var(--red-team-colour); +} + +tr.blueTeam, td.blueTeam { + background-color: var(--blue-team-colour); +} + +tr:nth-child(odd)>td.redTeam, tr:nth-child(odd).redTeam { + background-color: var(--red-team-odd-colour); +} + +tr:nth-child(odd)>td.blueTeam, tr:nth-child(odd).blueTeam { + background-color: var(--blue-team-odd-colour); +} + +td.searchedTeam { + background-color: var(--searched-team-colour) !important; +} + +td.ourTeam { + color: white; +} + +td.ourTeam.redTeam { + background-color: var(--our-team-red-colour) !important; } -th.lastRedTeam,td.lastRedTeam { - border-right: 1px solid; +td.ourTeam.blueTeam { + background-color: var(--our-team-blue-colour) !important; } .outputFilter {