Visual adjustments
This commit is contained in:
@@ -123,6 +123,7 @@ function App() {
|
|||||||
gameClient.createNewGame(rows, cols, mines).then(response => {
|
gameClient.createNewGame(rows, cols, mines).then(response => {
|
||||||
setActiveGame(response);
|
setActiveGame(response);
|
||||||
setFlags(mines);
|
setFlags(mines);
|
||||||
|
document.getElementsByClassName('reset')[0].innerHTML = '🙂';
|
||||||
generateDummyBoard();
|
generateDummyBoard();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -133,6 +134,7 @@ function App() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="app">
|
<div className="app">
|
||||||
|
<div className="app-col-spacer"> </div>
|
||||||
<div className="canvas">
|
<div className="canvas">
|
||||||
<Header
|
<Header
|
||||||
cols={cols}
|
cols={cols}
|
||||||
@@ -154,6 +156,7 @@ function App() {
|
|||||||
rows={rows}
|
rows={rows}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="app-col-spacer"> </div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,15 +8,24 @@ body {
|
|||||||
background-color: $gray-mid;
|
background-color: $gray-mid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.app {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
&-col-spacer {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.canvas {
|
.canvas {
|
||||||
max-width: 1000px;
|
|
||||||
width: 100%;
|
|
||||||
min-width: 500px;
|
|
||||||
margin: 0 auto;
|
|
||||||
border-radius: 3px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
|
flex: 0 0 auto;
|
||||||
|
border-width: 3px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: darken($gray, 20%) lighten($gray, 20%) lighten($gray, 20%)
|
||||||
|
darken($gray, 20%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import './styles.scss';
|
|||||||
const Board = ({ dummyBoard, handleCellClick, handleCellContextMenu }) => {
|
const Board = ({ dummyBoard, handleCellClick, handleCellContextMenu }) => {
|
||||||
return (
|
return (
|
||||||
<div className="board">
|
<div className="board">
|
||||||
<div className="board-col-left"> </div>
|
|
||||||
<div className="board-col-center">
|
<div className="board-col-center">
|
||||||
{dummyBoard.map((cols, rowId) => (
|
{dummyBoard.map((cols, rowId) => (
|
||||||
<div className="board-row" key={`row_${rowId}`}>
|
<div className="board-row" key={`row_${rowId}`}>
|
||||||
@@ -25,7 +24,6 @@ const Board = ({ dummyBoard, handleCellClick, handleCellContextMenu }) => {
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div className="board-col-right"> </div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,19 +2,7 @@
|
|||||||
|
|
||||||
.board {
|
.board {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
&-col-left,
|
|
||||||
&-col-right {
|
|
||||||
flex: 1 1 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-col-center {
|
|
||||||
flex: 0 0 auto;
|
|
||||||
border-width: 3px;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: darken($gray, 20%) lighten($gray, 20%) lighten($gray, 20%)
|
|
||||||
darken($gray, 20%);
|
|
||||||
}
|
|
||||||
|
|
||||||
&-row {
|
&-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -17,32 +17,46 @@ const Header = ({
|
|||||||
return (
|
return (
|
||||||
<div className="header">
|
<div className="header">
|
||||||
<div className="settings">
|
<div className="settings">
|
||||||
|
<div className="form-control">
|
||||||
|
<label for="rows">Rows:</label>
|
||||||
<input
|
<input
|
||||||
className="box"
|
className="box"
|
||||||
onChange={event => setRows(parseInt(event.target.value))}
|
onChange={event => setRows(parseInt(event.target.value))}
|
||||||
type="number"
|
type="number"
|
||||||
value={rows}
|
value={rows}
|
||||||
|
id="rows"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="form-control">
|
||||||
|
<label for="cols">Columns:</label>
|
||||||
<input
|
<input
|
||||||
className="box"
|
className="box"
|
||||||
onChange={event => setCols(parseInt(event.target.value))}
|
onChange={event => setCols(parseInt(event.target.value))}
|
||||||
type="number"
|
type="number"
|
||||||
value={cols}
|
value={cols}
|
||||||
|
id="cols"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="form-control">
|
||||||
|
<label for="mines">Mines:</label>
|
||||||
<input
|
<input
|
||||||
className="box"
|
className="box"
|
||||||
onChange={event => handleSetMines(event)}
|
onChange={event => handleSetMines(event)}
|
||||||
type="number"
|
type="number"
|
||||||
value={mines}
|
value={mines}
|
||||||
|
id="mines"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="form-control">
|
||||||
<button
|
<button
|
||||||
className="button box"
|
className="button box"
|
||||||
onClick={() => setUpdateDummyBoard(true)}>
|
onClick={() => setUpdateDummyBoard(true)}>
|
||||||
Apply
|
Apply
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="canvas">
|
</div>
|
||||||
<div className="flags led-panel box">{flags}</div>
|
<div className="header-actions">
|
||||||
|
<div className="flags led-panel">{flags}</div>
|
||||||
<div
|
<div
|
||||||
className="reset box"
|
className="reset box"
|
||||||
onMouseDown={event => {
|
onMouseDown={event => {
|
||||||
@@ -54,7 +68,7 @@ const Header = ({
|
|||||||
}}>
|
}}>
|
||||||
🙂
|
🙂
|
||||||
</div>
|
</div>
|
||||||
<div className="timer led-panel box">000</div>
|
<div className="timer led-panel">000</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,19 +1,50 @@
|
|||||||
@import '../../assets/scss/variables';
|
@import '../../assets/scss/variables';
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
max-width: 500px;
|
max-width: 400px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 5px;
|
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
|
&-col-left,
|
||||||
|
&-col-right {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-col-center {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
border-width: 3px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: darken($gray, 20%) lighten($gray, 20%) lighten($gray, 20%)
|
||||||
|
darken($gray, 20%);
|
||||||
|
}
|
||||||
|
|
||||||
.settings {
|
.settings {
|
||||||
max-width: 221px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: 10px auto;
|
border-width: 3px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: lighten($gray, 20%) darken($gray, 20%) darken($gray, 20%)
|
||||||
|
lighten($gray, 20%);
|
||||||
|
padding-bottom: 5px;
|
||||||
|
|
||||||
|
.form-control {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
font-size: 75%;
|
||||||
|
text-transform: uppercase;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
@@ -22,18 +53,28 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
background: $gray-light;
|
background: $gray-light;
|
||||||
margin: 0 2px;
|
margin: 0 2px;
|
||||||
|
border-color: darken($gray, 20%) lighten($gray, 20%) lighten($gray, 20%)
|
||||||
|
darken($gray, 20%);
|
||||||
|
font-size: 120%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin: 0 2px;
|
margin: 0 2px;
|
||||||
|
height: 38px;
|
||||||
|
border-color: lighten($gray, 20%) darken($gray, 20%) darken($gray, 20%)
|
||||||
|
lighten($gray, 20%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.canvas {
|
&-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
border-width: 3px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: lighten($gray, 20%) darken($gray, 20%) darken($gray, 20%)
|
||||||
|
lighten($gray, 20%);
|
||||||
|
|
||||||
.led-panel {
|
.led-panel {
|
||||||
font-family: 'Space Mono', monospace;
|
font-family: 'Space Mono', monospace;
|
||||||
@@ -47,10 +88,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.reset {
|
.reset {
|
||||||
width: 30px;
|
width: 24px;
|
||||||
line-height: 30px;
|
line-height: 24px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
margin: 3px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user