changed background
This commit is contained in:
parent
101a8ad3b1
commit
c22ee282b9
14
src/components/Navbar.css
Normal file
14
src/components/Navbar.css
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
.yellow {
|
||||||
|
position: relative;
|
||||||
|
left: 38px;
|
||||||
|
}
|
||||||
|
.blue {
|
||||||
|
position: relative;
|
||||||
|
top: 538px;
|
||||||
|
right: 114px;
|
||||||
|
}
|
||||||
|
.green {
|
||||||
|
position: relative;
|
||||||
|
top: 538px;
|
||||||
|
left: 152px;
|
||||||
|
}
|
||||||
@ -1,12 +1,14 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import NameContainer from './navbar-components/NameContainer';
|
import NameContainer from './navbar-components/NameContainer';
|
||||||
import ReadyButton from './navbar-components/ReadyButton';
|
import ReadyButton from './navbar-components/ReadyButton';
|
||||||
|
import './Navbar.css';
|
||||||
|
|
||||||
const Navbar = ({ players, started, time, isReady }) => {
|
const Navbar = ({ players, started, time, isReady }) => {
|
||||||
|
const colors = ['red', 'blue', 'green', 'yellow'];
|
||||||
return (
|
return (
|
||||||
<div className='navbar-container'>
|
<div className='navbar-container'>
|
||||||
{players.map((player, index) => (
|
{players.map((player, index) => (
|
||||||
<NameContainer key={index} player={player} time={time} />
|
<NameContainer key={index} player={player} color={colors[index]} time={time} />
|
||||||
))}
|
))}
|
||||||
{started ? null : <ReadyButton isReady={isReady} />}
|
{started ? null : <ReadyButton isReady={isReady} />}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -208,8 +208,8 @@ const Map = ({ pawns, nowMoving, rolledNumber }) => {
|
|||||||
return (
|
return (
|
||||||
<canvas
|
<canvas
|
||||||
className='canvas-container'
|
className='canvas-container'
|
||||||
width={480}
|
width={460}
|
||||||
height={480}
|
height={460}
|
||||||
ref={canvasRef}
|
ref={canvasRef}
|
||||||
onClick={handleCanvasClick}
|
onClick={handleCanvasClick}
|
||||||
onMouseMove={handleMouseMove}
|
onMouseMove={handleMouseMove}
|
||||||
|
|||||||
@ -1,16 +1,18 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
const NameContainer = ( {player, time} ) => {
|
const NameContainer = ({ player, time, color }) => {
|
||||||
const getRemainingTime = () => {
|
const getRemainingTime = () => {
|
||||||
return Math.round((time - Date.now()) / 1000) + 1;
|
return Math.round((time - Date.now()) / 1000) + 1;
|
||||||
}
|
};
|
||||||
return (
|
return (
|
||||||
<div className="name-container"
|
<div
|
||||||
style={ player.ready ? { backgroundColor: player.color} : { backgroundColor: 'grey'} }>
|
className={`name-container ${color}`}
|
||||||
|
style={player.ready ? { backgroundColor: color } : { backgroundColor: 'lightgrey' }}
|
||||||
|
>
|
||||||
{player.name}
|
{player.name}
|
||||||
{player.nowMoving ? <div className="timer"> {getRemainingTime()} </div> : null}
|
{player.nowMoving ? <div className='timer'> {getRemainingTime()} </div> : null}
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
export default NameContainer;
|
export default NameContainer;
|
||||||
@ -1,5 +1,11 @@
|
|||||||
body {
|
body {
|
||||||
background-color: antiquewhite;
|
background: radial-gradient(
|
||||||
|
circle,
|
||||||
|
rgba(0, 138, 255, 1) 0%,
|
||||||
|
rgba(0, 138, 255, 1) 9%,
|
||||||
|
rgba(0, 138, 255, 1) 16%,
|
||||||
|
rgba(9, 9, 121, 1) 81%
|
||||||
|
);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -7,6 +13,10 @@ body{
|
|||||||
.canvas-container {
|
.canvas-container {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
canvas {
|
||||||
|
border-radius: 15px;
|
||||||
|
border: 2px solid black;
|
||||||
|
}
|
||||||
.dice-container {
|
.dice-container {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 30%;
|
top: 30%;
|
||||||
@ -22,6 +32,7 @@ body{
|
|||||||
.name-container {
|
.name-container {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
|
border: 2px solid white;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
color: white;
|
color: white;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@ -34,8 +45,10 @@ body{
|
|||||||
background-color: darkblue;
|
background-color: darkblue;
|
||||||
color: white;
|
color: white;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -20px;
|
top: -24px;
|
||||||
left: 15px;
|
left: 32px;
|
||||||
|
border: 1px solid white;
|
||||||
|
padding: 1px;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user