- About Crafity Snake
- Play snake in your browser using HTML 5 and Javascript.
- Introduction
-
- This experiment has been created to test out React, Redux and Styled Components and see if it is possible to
- create a simple web based game like snake. The source code for this game is open source and free to download and
- change.
-
-
- A couple of noticable features in this game are resumable game play using local storage. The page can be reloaded
- or reopened any time and the game should continue from where it was left.
-
- How to play
-
- You control the snake using the arrow keys or the hjkl keys. Everytime the snake eats an apple the
- tail of the snake grows longer. When the snake touches his own body the game is over.
-
-
- Other keys to control the game are r to (re)start the game. The s key to stop the game
- and p to pause the game.
-
- Technology
- Snake has been developed with the folowing technologies.
-
- - React + React Router
- - Redux
- - Styled Components
- - Webpack + Babel
- - Jest
- - ESLint
- - pre-commit
- - Docker
-
- Source Code
- The source code is hosted on Crafity's git repositories at the following location:
-
- Crafity Snake
-
- After donwloading the source code run the following commands:
-
- npm install
-
-
- npm run dev
-
+
+
+
+ Crafity Snake
+ Play snake with HTML 5 and Javascript.
+
+ 🐍
+
+
+
+ Introduction
+
+ This experiment has been created to test out React, Redux and Styled Components and see if it is possible to
+ create a simple web based game like snake. The source code for this game is open source and free to download and
+ change.
+
+
+ A couple of noticable features in this game are resumable game play using local storage. The page can be
+ reloaded or reopened any time and the game should continue from where it was left.
+
+
+
+ How to play
+
+ You control the snake using the arrow keys or the hjkl keys. Everytime the snake eats an apple the
+ tail of the snake grows longer. When the snake touches his own body the game is over.
+
+
+ Other keys to control the game are r to (re)start the game. The s key to stop the game
+ and p to pause the game.
+
+
+
+ Technology
+ Snake has been developed with the folowing technologies.
+
+ - React + React Router
+ - Redux
+ - Styled Components
+ - Webpack + Babel
+ - Jest
+ - ESLint
+ - pre-commit
+ - Docker
+
+
+
+ Source Code
+ The source code is hosted on Crafity's git repositories at the following location:
+
+ Crafity Snake
+
+ After donwloading the source code run the following commands:
+
+ npm install
+
+
+ npm run dev
+
+
);
diff --git a/src/theming/GlobalStyle.js b/src/theming/GlobalStyle.js
index 340c4b9..c1d44c6 100644
--- a/src/theming/GlobalStyle.js
+++ b/src/theming/GlobalStyle.js
@@ -9,6 +9,7 @@ const GlobalStyle = createGlobalStyle`
background: ${props => props.theme.body.background};
color: ${props => props.theme.body.color};
min-height: 100vh;
+ -webkit-font-smoothing: antialiased;
}
body, input, select {
font-family: ${({ theme }) => theme.body.fontFamily};
diff --git a/src/theming/themes/dark.js b/src/theming/themes/dark.js
index 9307ad5..8ec5499 100644
--- a/src/theming/themes/dark.js
+++ b/src/theming/themes/dark.js
@@ -11,7 +11,7 @@ export const colors = {
colorInactive: "#97727e",
colorAlternate: "#ecb1c5",
shadowColor: "#222",
- borderColor: "#222",
+ borderColor: "silver",
borderColorActive: "#e6b4c4",
borderColorInactive: "#97727e",
spinnerShadow: "#444",
diff --git a/src/theming/themes/default.js b/src/theming/themes/default.js
index 8bc765e..f5b2a6c 100644
--- a/src/theming/themes/default.js
+++ b/src/theming/themes/default.js
@@ -21,7 +21,10 @@ export const defaultColors = {
snakePartHueAlive: "340",
snakePartHueDied: "0",
snakePartLightness: "0%",
- selectColor: "black"
+ selectColor: "black",
+ pageSectionMainColor: "#eaeaea",
+ pageSectionStandardColor: "white",
+ pageSectionAlternateColor: "#fafafa"
};
const mapRange = (l, i, min, max) => Math.round((max - min) * ((l - i) / l) + min);
@@ -45,6 +48,7 @@ export const renderTheme = themeColors => {
borderWidth: `${1 / 16}rem`
},
select: {
+ borderColor: colors.borderColor,
color: colors.selectColor
},
header: {
diff --git a/src/theming/themes/light.js b/src/theming/themes/light.js
index 54aa990..a3ec4b4 100644
--- a/src/theming/themes/light.js
+++ b/src/theming/themes/light.js
@@ -18,7 +18,10 @@ export const colors = {
spinnerHighlight: "#db7093",
cardFoldHighlight: "#ad5a75",
cardFoldShadow: "#bdb19a",
- selectColor: "#db7093"
+ selectColor: "#db7093",
+ pageSectionMainColor: "papayawhip",
+ pageSectionStandardColor: "white",
+ pageSectionAlternateColor: "#fafafa"
};
const mapRange = (l, i, min, max) => Math.round((max - min) * ((l - i) / l) + min);