diff --git a/.gitignore b/.gitignore index f78ec928..5c02c7b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .parcel-cache +/node_modules +/dist diff --git a/package-lock.json b/package-lock.json index d7f43490..c95b3b01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -372,6 +372,7 @@ "integrity": "sha512-SRZFtqGiaKHlZ2YAvf+NHvBFWS3GnkBvJMfOJM7kxJRK3M1bhbwJa/GgSdzqro5UVf9Bfj6E+pkdrRQIOZ7jMQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@mischnic/json-sourcemap": "^0.1.0", "@parcel/cache": "2.13.3", @@ -2024,6 +2025,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001688", "electron-to-chromium": "^1.5.73", @@ -3256,21 +3258,6 @@ "node": ">=10" } }, - "node_modules/srcset": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/srcset/-/srcset-5.0.1.tgz", - "integrity": "sha512-/P1UYbGfJVlxZag7aABNRrulEXAwCSDo7fklafOQrantuPTDmYgijJMks2zusPCVzgW9+4P69mq7w6pYuZpgxw==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", diff --git a/src/css/og-snake.css b/src/css/og-snake.css new file mode 100644 index 00000000..e9420ab7 --- /dev/null +++ b/src/css/og-snake.css @@ -0,0 +1,159 @@ +/* +JavaScript Snake +By Patrick Gillespie +http://patorjk.com/games/snake +*/ +body { + margin: 0px; + padding: 0px; + background-color: darkgreen; +} + +.snake-toolbar { + background-color: rgba(255, 255, 255, 0.4); + border-radius: 10px; +} + +#game-area { + margin: 10px; + padding: 0px; + background-color: lightgreen; +} + +#mode-wrapper { + color: #ffffff; + font-family: Verdana, arial, helvetica, sans-serif; + font-size: 14px; +} + +#game-area:focus { + outline: none; +} + +a.snake-link, +a.snake-link:link, +a.snake-link:visited { + color: black; +} + +a.snake-link:hover { + color: #ffff54; +} + +.snake-pause-screen { + font-family: Verdana, arial, helvetica, sans-serif; + font-size: 14px; + position: absolute; + width: 300px; + height: 80px; + text-align: center; + top: 50%; + left: 50%; + margin-top: -40px; + margin-left: -150px; + display: none; + background-color: black; + color: white; +} + +.snake-panel-component { + position: absolute; + font-family: Verdana, arial, helvetica, sans-serif; + font-size: 14px; + color: black; + text-align: center; + background-color: white; + padding: 8px; + margin: 0px; +} + +#snake-snakehead-alive { + background-image: url("src/css/images/green-head-snakeblock.png"); + margin: 0px; + padding: 0px; + background-color: rgb(10, 48, 173); + position: absolute; + border: 0px solid #000000; + background-repeat: no-repeat; + border-radius: 4px; +} + +.snake-snakebody-block { + margin: 0px; + padding: 0px; + background-color: #4E7CF6; + position: absolute; + border: 0px solid #000080; + background-repeat: no-repeat; +} + +.snake-snakebody-alive { + background-image: url("src/css/images/snakeblock.png"); +} + +.snake-snakebody-dead { + background-image: url("src/css/images/deadblock.png"); +} + +.snake-food-block { + margin: 0px; + padding: 0px; + background-color: #E7471D; + border: 0px solid #000080; + position: absolute; +} + +.snake-playing-field { + margin: 0px; + padding: 0px; + position: absolute; + background-color: #AAD751; + border: 0px solid #0000a8; +} + +.snake-game-container { + margin: 0px; + padding: 0px; + border-width: 0px; + border-style: none; + zoom: 1; + background-color: #4E7CF6; + position: relative; +} + +.snake-welcome-dialog { + padding: 8px; + margin: 0px; + background-color: #000000; + color: #ffffff; + font-family: Verdana, arial, helvetica, sans-serif; + font-size: 14px; + position: absolute; + top: 50%; + left: 50%; + width: 300px; + /*height: 150px;*/ + margin-top: -100px; + margin-left: -158px; + text-align: center; + display: block; +} + +.snake-try-again-dialog, +.snake-win-dialog { + padding: 8px; + margin: 0px; + background-color: #000000; + color: #ffffff; + font-family: Verdana, arial, helvetica, sans-serif; + font-size: 14px; + position: absolute; + top: 50%; + left: 50%; + width: 300px; + height: 100px; + margin-top: -75px; + margin-left: -158px; + text-align: center; + display: none; +} \ No newline at end of file diff --git a/src/index.html b/src/index.html index 03dc6b10..1404138a 100755 --- a/src/index.html +++ b/src/index.html @@ -1,7 +1,8 @@ - - - - JavaScript Snake - - - - - - -
-
- Theme: - -
-
- Mode: - -
- -
+ --> + + + +
+
+ Theme: +
+
+ Mode: + +
+ +
+
-
+
-
- - - + + + - document.getElementById('go_full_screen').addEventListener('click', go_full_screen); - - - + \ No newline at end of file