This commit is contained in:
mehbark 2023-04-01 23:11:32 -04:00
parent 04e0155e04
commit 041a8167ea
6 changed files with 3247 additions and 46 deletions

View file

@ -1,6 +1,6 @@
.PHONY: build serve clean scp .PHONY: build serve clean scp
build: chess.js main.js Makefile build: chess.min.js main.min.js gchessboard.min.js Makefile
serve: build serve: build
python -m http.server python -m http.server
@ -12,11 +12,16 @@ upload: build
full-upload: build full-upload: build
scp * root@pyrope.net:/var/www/mysite/elo-worldle/ scp * root@pyrope.net:/var/www/mysite/elo-worldle/
# https://unix.stackexchange.com/questions/153862/remove-all-files-directories-except-for-one-file
clean: clean:
rm *.js find . -name "*.js" ! -name "gchessboard*" -exec rm {} +
# main.js: main.ts # main.js: main.ts
# tsc main.ts # tsc main.ts
%.min.js: %.js
npx uglify-js $< | sed s/chess\.js/chess.min.js/g > $@
%.js: %.ts tsconfig.json %.js: %.ts tsconfig.json
tsc tsc

1
chess.min.js vendored Normal file

File diff suppressed because one or more lines are too long

3120
gchessboard.js Normal file

File diff suppressed because one or more lines are too long

1
gchessboard.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -2,21 +2,34 @@
<html lang="en"> <html lang="en">
<head> <head>
<title>Elo Worldle</title> <title>Elo Worldle</title>
<script>var exports = {};</script> <script>
var exports = {};
</script>
<!-- <script defer src="chess.js"></script> --> <!-- <script defer src="chess.js"></script> -->
<script type="module" src="main.js"></script> <!-- You can still access the unminified files! Just go to,
<script type="module" src="https://unpkg.com/gchessboard"></script> e.g, https://elo-worldle.pyrope.net/main.js -->
<meta charset="UTF-8"> <script type="module" src="main.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <script type="module" src="gchessboard.min.js"></script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta content="Elo Worldle" property="og:title" /> <meta content="Elo Worldle" property="og:title" />
<meta content="A game where you guess what bad chess algorithm you are playing against." property="og:description" /> <meta
content="A game where you guess what bad chess algorithm you are playing against."
property="og:description"
/>
<meta content="https://elo-worldle.pyrope.net/" property="og:url" /> <meta content="https://elo-worldle.pyrope.net/" property="og:url" />
<meta content="https://elo-worldle.pyrope.net/favicon.png" property="og:image" /> <meta
content="https://elo-worldle.pyrope.net/favicon.png"
property="og:image"
/>
<meta content="#538d4e" data-react-helmet="true" name="theme-color" /> <meta content="#538d4e" data-react-helmet="true" name="theme-color" />
<meta name="description" content="A Wordle-like game where you guess what bad chess algorithm you are playing against." /> <meta
name="description"
content="A Wordle-like game where you guess what bad chess algorithm you are playing against."
/>
<link rel="stylesheet" href="./main.css"></link> <!-- <link rel="stylesheet" href="./main.css"></link> -->
<style> <style>
html { html {
background-color: #002121; background-color: #002121;
@ -30,13 +43,18 @@
width: calc(min(90vw, 90vh)); width: calc(min(90vw, 90vh));
height: calc(min(90vw, 90vh)); height: calc(min(90vw, 90vh));
} }
#game-over, #stats, #copy-stats, #play-again, #win-count { #game-over,
#stats,
#copy-stats,
#play-again,
#win-count {
display: none; display: none;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
#game-over, #win-count { #game-over,
#win-count {
text-align: center; text-align: center;
width: 100%; width: 100%;
} }
@ -49,7 +67,8 @@
margin-bottom: 0; margin-bottom: 0;
} }
#copy-stats, #play-again { #copy-stats,
#play-again {
color: black; color: black;
} }
@ -60,12 +79,13 @@
} }
:host { :host {
--square-color-dark: #86A666; --square-color-dark: #86a666;
--square-color-light: #FFFFDD; --square-color-light: #ffffdd;
} }
h1, pre { h1,
font-family: 'Courier New', Courier, monospace; pre {
font-family: "Courier New", Courier, monospace;
} }
h1 { h1 {
@ -73,10 +93,11 @@
} }
p { p {
font-family: 'Times New Roman', Times, serif; font-family: "Times New Roman", Times, serif;
} }
#players, .player { #players,
.player {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
text-align: center; text-align: center;
@ -114,51 +135,98 @@
color: white; color: white;
} }
g-chess-board::part(piece-wb) { background-image: url("./piece-wb.png"); image-rendering: pixelated; } g-chess-board::part(piece-wb) {
g-chess-board::part(piece-wr) { background-image: url("./piece-wr.png"); image-rendering: pixelated; } background-image: url("./piece-wb.png");
g-chess-board::part(piece-wp) { background-image: url("./piece-wp.png"); image-rendering: pixelated; } image-rendering: pixelated;
g-chess-board::part(piece-wn) { background-image: url("./piece-wn.png"); image-rendering: pixelated; } }
g-chess-board::part(piece-wk) { background-image: url("./piece-wk.png"); image-rendering: pixelated; } g-chess-board::part(piece-wr) {
g-chess-board::part(piece-wq) { background-image: url("./piece-wq.png"); image-rendering: pixelated; } background-image: url("./piece-wr.png");
image-rendering: pixelated;
}
g-chess-board::part(piece-wp) {
background-image: url("./piece-wp.png");
image-rendering: pixelated;
}
g-chess-board::part(piece-wn) {
background-image: url("./piece-wn.png");
image-rendering: pixelated;
}
g-chess-board::part(piece-wk) {
background-image: url("./piece-wk.png");
image-rendering: pixelated;
}
g-chess-board::part(piece-wq) {
background-image: url("./piece-wq.png");
image-rendering: pixelated;
}
g-chess-board::part(piece-bb) { background-image: url("./piece-bb.png"); image-rendering: pixelated; } g-chess-board::part(piece-bb) {
g-chess-board::part(piece-br) { background-image: url("./piece-br.png"); image-rendering: pixelated; } background-image: url("./piece-bb.png");
g-chess-board::part(piece-bp) { background-image: url("./piece-bp.png"); image-rendering: pixelated; } image-rendering: pixelated;
g-chess-board::part(piece-bn) { background-image: url("./piece-bn.png"); image-rendering: pixelated; } }
g-chess-board::part(piece-bk) { background-image: url("./piece-bk.png"); image-rendering: pixelated; } g-chess-board::part(piece-br) {
g-chess-board::part(piece-bq) { background-image: url("./piece-bq.png"); image-rendering: pixelated; } background-image: url("./piece-br.png");
image-rendering: pixelated;
}
g-chess-board::part(piece-bp) {
background-image: url("./piece-bp.png");
image-rendering: pixelated;
}
g-chess-board::part(piece-bn) {
background-image: url("./piece-bn.png");
image-rendering: pixelated;
}
g-chess-board::part(piece-bk) {
background-image: url("./piece-bk.png");
image-rendering: pixelated;
}
g-chess-board::part(piece-bq) {
background-image: url("./piece-bq.png");
image-rendering: pixelated;
}
</style> </style>
</head> </head>
<body> <body>
<g-chess-board <g-chess-board
id="board" fen="start" interactive turn="white" id="board"
fen="start"
interactive
turn="white"
></g-chess-board> ></g-chess-board>
<button style="display: none" id="finish">show me the answer please i toootally guessed already</button> <button style="display: none" id="finish">
show me the answer please i toootally guessed already
</button>
<h1 id="game-over"></h1> <h1 id="game-over"></h1>
<button title="or press `r`" id="play-again">&gt; play again &lt;</button> <button title="or press `r`" id="play-again">
&gt; play again &lt;
</button>
<pre id="stats"></pre> <pre id="stats"></pre>
<button title="or press `c`" id="copy-stats">^ copy ^</button> <button title="or press `c`" id="copy-stats">^ copy ^</button>
<br> <br />
<h1>Players: (click name to toggle strikethrough)</h1> <h1>Players: (click name to toggle strikethrough)</h1>
<div id="players"> <div id="players"></div>
</div>
<footer> <footer>
<a href="https://www.youtube.com/watch?v=DpXy041BIlA">Tutorial</a><br> <a href="https://www.youtube.com/watch?v=DpXy041BIlA">Tutorial</a
<a href="http://tom7.org/chess">Piece sprites, board colors, algorithms, etc.</a> ><br />
<a href="http://tom7.org/chess"
>Piece sprites, board colors, algorithms, etc.</a
>
&amp; &amp;
<a href="https://sourceforge.net/p/tom7misc/svn/HEAD/tree/trunk/chess/">Original implementations</a> <a
href="https://sourceforge.net/p/tom7misc/svn/HEAD/tree/trunk/chess/"
>Original implementations</a
>
&amp; &amp;
<a href="http://tom7.org/chess/weak.pdf">Original paper</a> <a href="http://tom7.org/chess/weak.pdf">Original paper</a>
by by
<a href="http://tom7.org">tom7</a> <a href="http://tom7.org">tom7</a>
<br> <br />
<a href="https://git.pyrope.net/mbk/elo-worldle">Code</a> <a href="https://git.pyrope.net/mbk/elo-worldle">Code</a>
&amp; &amp;
<a href="https://elo-worldle.pyrope.net/paper.pdf">Paper</a> <a href="https://elo-worldle.pyrope.net/paper.pdf">Paper</a>
by by
<a href="https://pl.pyrope.net/terezi">me</a> <a href="https://pl.pyrope.net/terezi">me</a>
<div id="win-count"></div>
</footer> </footer>
</body> </body>
<div id="win-count"></div>
</html> </html>

6
main.min.js vendored Normal file

File diff suppressed because one or more lines are too long