Continued shrinking real estate to fit more on phones
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
01a1c215e8
commit
c3e15b986b
@ -71,7 +71,8 @@
|
|||||||
width: 40vw;
|
width: 40vw;
|
||||||
max-height: 100vh;
|
max-height: 100vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
min-width: 20em;
|
min-width: 100vw;
|
||||||
|
max-width: 40vw;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
@ -87,7 +88,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.lobby {
|
.lobby {
|
||||||
width: calc(100vw - 1em);
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Chat {
|
.Chat {
|
||||||
@ -102,10 +103,11 @@
|
|||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Chat #ChatList {
|
#ChatList {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ChatList .MuiListItem-gutters {
|
#ChatList .MuiListItem-gutters {
|
||||||
@ -129,7 +131,8 @@
|
|||||||
#ChatList .PlayerColor {
|
#ChatList .PlayerColor {
|
||||||
width: 1em;
|
width: 1em;
|
||||||
height: 1em;
|
height: 1em;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Players {
|
.Players {
|
||||||
@ -137,22 +140,44 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.PlayerSelector .PlayerColor {
|
||||||
|
width: 1em;
|
||||||
|
height: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
.PlayerSelector {
|
.PlayerSelector {
|
||||||
display: flex;
|
display: inline-flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.PlayerSelector.MuiList-padding {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.PlayerSelector .PlayerEntry {
|
.PlayerSelector .PlayerEntry {
|
||||||
|
flex: 1 1 0px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: inline-flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
width: 50%;
|
min-width: 10em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.PlayerSelector .MuiTypography-body1 {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.PlayerSelector .MuiTypography-body2 {
|
||||||
|
font-size: 0.7rem;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Players .PlayerEntry {
|
.Players .PlayerEntry {
|
||||||
border: 1px solid rgba(0,0,0,0);
|
border: 1px solid rgba(0,0,0,0);
|
||||||
border-radius: 0.5em;
|
border-radius: 0.5em;
|
||||||
|
min-width: 10em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Players .PlayerEntry[data-selectable=true]:hover {
|
.Players .PlayerEntry[data-selectable=true]:hover {
|
||||||
@ -258,6 +283,8 @@ button {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 12pt;
|
font-size: 12pt;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
|
margin: 1em;
|
||||||
|
z-index: 10000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Message {
|
.Message {
|
||||||
@ -266,7 +293,7 @@ button {
|
|||||||
background-color: rgba(224, 224, 224);
|
background-color: rgba(224, 224, 224);
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 12pt;
|
font-size: 12pt;
|
||||||
padding: 1em;
|
padding: 0.5em;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import ListItem from '@material-ui/core/ListItem';
|
|||||||
import ListItemAvatar from '@material-ui/core/ListItemAvatar';
|
import ListItemAvatar from '@material-ui/core/ListItemAvatar';
|
||||||
import ListItemText from '@material-ui/core/ListItemText';
|
import ListItemText from '@material-ui/core/ListItemText';
|
||||||
import { makeStyles } from '@material-ui/core/styles';
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
import { deepOrange, lightBlue, red, grey } from '@material-ui/core/colors';
|
import { orange, deepOrange, lightBlue, red, grey } from '@material-ui/core/colors';
|
||||||
import Avatar from '@material-ui/core/Avatar';
|
import Avatar from '@material-ui/core/Avatar';
|
||||||
import Moment from 'react-moment';
|
import Moment from 'react-moment';
|
||||||
//import moment from 'moment';
|
//import moment from 'moment';
|
||||||
@ -57,8 +57,8 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
backgroundColor: red[500],
|
backgroundColor: red[500],
|
||||||
},
|
},
|
||||||
O: {
|
O: {
|
||||||
color: theme.palette.getContrastText(deepOrange[500]),
|
color: theme.palette.getContrastText(orange[500]),
|
||||||
backgroundColor: deepOrange[500],
|
backgroundColor: orange[500],
|
||||||
},
|
},
|
||||||
W: {
|
W: {
|
||||||
color: theme.palette.getContrastText(grey[500]),
|
color: theme.palette.getContrastText(grey[500]),
|
||||||
@ -73,7 +73,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
const PlayerColor = ({ color }) => {
|
const PlayerColor = ({ color }) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<Avatar className={['PlayerColor', classes[color]]}/>
|
<Avatar className={['PlayerColor', classes[color]].join(' ')}/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -425,13 +425,14 @@ const getPlayerName = (sessions, color) => {
|
|||||||
* player's active item in the game */
|
* player's active item in the game */
|
||||||
const Players = ({ board }) => {
|
const Players = ({ board }) => {
|
||||||
const toggleSelected = (key) => {
|
const toggleSelected = (key) => {
|
||||||
|
console.log('toggle');
|
||||||
board.setSelected(board.game.color === key ? "" : key);
|
board.setSelected(board.game.color === key ? "" : key);
|
||||||
}
|
}
|
||||||
|
|
||||||
const players = [];
|
const players = [];
|
||||||
for (let color in board.game.players) {
|
for (let color in board.game.players) {
|
||||||
const item = board.game.players[color];
|
const item = board.game.players[color], inLobby = board.game.state === 'lobby';
|
||||||
if (board.game.state !== "lobby" && item.status === 'Not active') {
|
if (!inLobby && item.status === 'Not active') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const name = getPlayerName(board.game.sessions, color),
|
const name = getPlayerName(board.game.sessions, color),
|
||||||
@ -442,15 +443,16 @@ const Players = ({ board }) => {
|
|||||||
data-selectable={selectable}
|
data-selectable={selectable}
|
||||||
data-selected={board.game.color === color}
|
data-selected={board.game.color === color}
|
||||||
className="PlayerEntry"
|
className="PlayerEntry"
|
||||||
|
onClick={() => { inLobby && selectable && toggleSelected(color) }}
|
||||||
key={`player-${color}`}>
|
key={`player-${color}`}>
|
||||||
<PlayerColor onClick={() => { selectable && toggleSelected(color) }} color={color}/>
|
<PlayerColor color={color}/>
|
||||||
<ListItemText onClick={() => { selectable && toggleSelected(color) }}primary={toggleText} secondary={(
|
<ListItemText primary={toggleText} secondary={(
|
||||||
<>
|
<>
|
||||||
{ item.status + ' ' }
|
{ item.status + ' ' }
|
||||||
{ item.status !== 'Not active' && <Moment fromNow date={item.lastActive > Date.now() ? Date.now() : item.lastActive}/>}
|
{ item.status !== 'Not active' && <Moment fromNow date={item.lastActive > Date.now() ? Date.now() : item.lastActive}/>}
|
||||||
</>)} />
|
</>)} />
|
||||||
{ board.game.state !== 'lobby' && board.game.color === color &&
|
{ !inLobby && board.game.color === color &&
|
||||||
<Button onClick={() => toggleSelected(color)}>exit to lobby</Button>
|
<Button onClick={() => toggleSelected(color)}>Quit</Button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
));
|
));
|
||||||
@ -1487,12 +1489,10 @@ class Board extends React.Component {
|
|||||||
<Chat board={this} promoteGameState={this.promoteGameState}/>
|
<Chat board={this} promoteGameState={this.promoteGameState}/>
|
||||||
<Action board={this}/>
|
<Action board={this}/>
|
||||||
</> }
|
</> }
|
||||||
{ this.state.error && <Paper className="Error"><div>{this.state.error}</div></Paper> }
|
|
||||||
</div> }
|
</div> }
|
||||||
|
|
||||||
<div className="Cards" ref={el => this.cards = el}>
|
<div className="Cards" ref={el => this.cards = el}>
|
||||||
{
|
{ game && game.state === "active" && <>
|
||||||
game && game.state === "active" &&
|
|
||||||
<>
|
|
||||||
<div>In hand</div>
|
<div>In hand</div>
|
||||||
<div className="Hand">
|
<div className="Hand">
|
||||||
<Resource type="wood" count={this.state.wood}/>
|
<Resource type="wood" count={this.state.wood}/>
|
||||||
@ -1535,6 +1535,9 @@ class Board extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
</> }
|
</> }
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{ this.state.error && <Paper className="Error"><div>{this.state.error}</div></Paper> }
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user