diff --git a/Dockerfile b/Dockerfile index cd70931..859ed95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,2 @@ -# Use the official Nginx image from Docker Hub FROM nginx:latest COPY public /usr/share/nginx/html diff --git a/README.md b/README.md index 5227726..84389c6 100644 --- a/README.md +++ b/README.md @@ -4,5 +4,6 @@ ## Setup 1. Install dependencies: `npm install` -2. Run webpack to watch for changes: `npm run dev` -3. Do something \ No newline at end of file +2. Run webpack to watch for changes in background: `npm run dev &` +3. Start HTTP server: `python3 -m http.server -d public` +4. Have fun and remember to stop the background job with `kill %1` \ No newline at end of file diff --git a/app/main.js b/app/main.js index f69d2cc..5d5664d 100644 --- a/app/main.js +++ b/app/main.js @@ -22,6 +22,7 @@ var pieceValues = { [game.QUEEN]: 9, [game.KING]: 1000, } +var gameStarted = false; // TODO: not fully working? I dont think it's calculating the piece values correctly. All board values are -1 when a rook/knight/etc. could be taken by white next turn var getBoardValue = function(move) { @@ -119,9 +120,17 @@ var onDrop = function (source, target) { removeGreySquares(); displayMoveHistory(game.history()); + if (!gameStarted) { + setSubtitle("Walked along the sand dunes of the Sahara desert for forty days and forty nights with nothing but a pack of Newports and a fifth of henny. I really do this shit."); + gameStarted = true; + } window.setTimeout(makeBestMove, 1000); }; +var setSubtitle = function(text) { + document.getElementById("subtitle").textContent = text; +} + var onSnapEnd = function () { board.position(game.fen()); }; diff --git a/public/css/style.css b/public/css/style.css index 33e9dc3..c9d2f65 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -1,3 +1,20 @@ +body { + font-family: Arial, sans-serif; + background-color: #333333; + color: white; + font-size: 1.1rem; +} + +body > div { + width: 50%; + margin: 0 auto; + text-align: center; +} + +.text-left { + text-align: left; +} + /* square */ .square-55d63 { float: left; @@ -22,4 +39,4 @@ .black-3c85d { background-color: #b58863; color: #f0d9b5; -} \ No newline at end of file +} diff --git a/public/index.html b/public/index.html index 004d874..6baaf7a 100644 --- a/public/index.html +++ b/public/index.html @@ -11,8 +11,14 @@ Chess boi -
-
+
+

Chess

+

+ You can't beat me. Don't even try... unless you want to wake up in a pool of your own tears with a deep sense of shame and humiliation. +

+
+
+