Small tweak for Firefox and added a start button to the start banner
This commit is contained in:
@@ -67,7 +67,7 @@ export const ControlPanel = ({
|
|||||||
zoomOut
|
zoomOut
|
||||||
}) => (
|
}) => (
|
||||||
<Layout>
|
<Layout>
|
||||||
<HorizontalStack style={{ minHeight: "2rem" }}>
|
<HorizontalStack style={{ minHeight: "2rem", lineHeight: "2rem" }}>
|
||||||
<ThemeSelector onChange={e => changeTheme(e.target.value)} value={theme}>
|
<ThemeSelector onChange={e => changeTheme(e.target.value)} value={theme}>
|
||||||
<option value="light">Light</option>
|
<option value="light">Light</option>
|
||||||
<option value="dark">Miami Night</option>
|
<option value="dark">Miami Night</option>
|
||||||
@@ -75,7 +75,7 @@ export const ControlPanel = ({
|
|||||||
<option value="default">Black / White</option>
|
<option value="default">Black / White</option>
|
||||||
</ThemeSelector>
|
</ThemeSelector>
|
||||||
</HorizontalStack>
|
</HorizontalStack>
|
||||||
<HorizontalStack style={{ minHeight: "2rem" }}>
|
<HorizontalStack style={{ minHeight: "2rem", lineHeight: "2rem" }}>
|
||||||
<span>
|
<span>
|
||||||
Zoom: <b>{zoom}</b>
|
Zoom: <b>{zoom}</b>
|
||||||
</span>
|
</span>
|
||||||
@@ -84,7 +84,7 @@ export const ControlPanel = ({
|
|||||||
<IconButton icon="plus-circle" size={1} onClick={zoomIn} />
|
<IconButton icon="plus-circle" size={1} onClick={zoomIn} />
|
||||||
</div>
|
</div>
|
||||||
</HorizontalStack>
|
</HorizontalStack>
|
||||||
<HorizontalStack style={{ minHeight: "2rem" }}>
|
<HorizontalStack style={{ minHeight: "2rem", lineHeight: "2rem", marginBottom: "1rem" }}>
|
||||||
<span>
|
<span>
|
||||||
FPS: <b>{fps}</b>
|
FPS: <b>{fps}</b>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export const Tooltip = styled.div`
|
|||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
padding: ${({ theme }) => theme.tooltip.padding};
|
padding: ${({ theme }) => theme.tooltip.padding};
|
||||||
box-shadow: 1px 1px 3px ${({ theme }) => theme.tooltip.shadowColor};
|
box-shadow: 1px 1px 3px ${({ theme }) => theme.tooltip.shadowColor};
|
||||||
|
right: 0;
|
||||||
${props =>
|
${props =>
|
||||||
props.hover
|
props.hover
|
||||||
? css`
|
? css`
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import ControlPanel from "../components/ControlPanel.js";
|
|||||||
import Scoreboard from "../components/Scoreboard.js";
|
import Scoreboard from "../components/Scoreboard.js";
|
||||||
import Stage from "../components/Stage.js";
|
import Stage from "../components/Stage.js";
|
||||||
import SnakePart from "../components/SnakePart.js";
|
import SnakePart from "../components/SnakePart.js";
|
||||||
|
import Button, { ButtonContainer } from "../components/Button.js";
|
||||||
import Apple from "../components/Apple.js";
|
import Apple from "../components/Apple.js";
|
||||||
import Banner from "../components/Banner.js";
|
import Banner from "../components/Banner.js";
|
||||||
import Highscore from "../components/Highscore.js";
|
import Highscore from "../components/Highscore.js";
|
||||||
@@ -87,7 +88,14 @@ const Snake = ({
|
|||||||
(cell.type === "snake" && <SnakePart zoom={zoom} value={cell} died={died} />)
|
(cell.type === "snake" && <SnakePart zoom={zoom} value={cell} died={died} />)
|
||||||
}
|
}
|
||||||
</Stage>
|
</Stage>
|
||||||
{!started && <Banner fade>Press 'r' to start the game</Banner>}
|
{!started && (
|
||||||
|
<Banner fade>
|
||||||
|
<p>Press 'r' to start the game</p>
|
||||||
|
<ButtonContainer>
|
||||||
|
<Button onClick={startSnake}>Start</Button>
|
||||||
|
</ButtonContainer>
|
||||||
|
</Banner>
|
||||||
|
)}
|
||||||
{died && lastGameId !== gameId && hasHighscore(score) && (
|
{died && lastGameId !== gameId && hasHighscore(score) && (
|
||||||
<HighscoreInput score={score} gameId={gameId} name={lastUsername} onSubmit={onSubmitHighscore} />
|
<HighscoreInput score={score} gameId={gameId} name={lastUsername} onSubmit={onSubmitHighscore} />
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -18,6 +18,19 @@ const GlobalStyle = createGlobalStyle`
|
|||||||
font-family: Lato;
|
font-family: Lato;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// firefox
|
||||||
|
@-moz-document url-prefix() {
|
||||||
|
select {
|
||||||
|
text-indent: -2px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edge
|
||||||
|
@supports (-ms-ime-align: auto) {
|
||||||
|
select {
|
||||||
|
text-indent: -2px
|
||||||
|
}
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default GlobalStyle;
|
export default GlobalStyle;
|
||||||
|
|||||||
Reference in New Issue
Block a user