dkl9 commited on 2025-209 17:54:46
Showing 2 changed files, with 17 additions and 8 deletions.
| ... | ... |
@@ -11,9 +11,9 @@ |
| 11 | 11 |
#plot { border: 1px solid grey; flex-shrink: 0; width: min(90vw, 25em); height: min(90vw, 25em); flex-shrink: 0; }
|
| 12 | 12 |
#grid { border-collapse: separate; border-spacing: 3px 12px; margin-top: 10px; }
|
| 13 | 13 |
#grid td { min-width: min(13vw, 4rem); height: min(13vw, 4rem); border: 1px solid #ccc; text-align: center; vertical-align: middle; font-weight: bold; transition: transform 0.3s ease; }
|
| 14 |
- .grey { background: #3a3a3c; color: white; }
|
|
| 15 |
- .yellow { background: #b59f3b; color: white; }
|
|
| 16 |
- .green { background: #538e4e; color: white; }
|
|
| 14 |
+ .grey { background: #787c7e; }
|
|
| 15 |
+ .yellow { background: #c9b458; }
|
|
| 16 |
+ .green { background: #6aaa64; }
|
|
| 17 | 17 |
#message { color: red; margin-top: 5px; }
|
| 18 | 18 |
.side { margin-left: 20px; }
|
| 19 | 19 |
.shake { animation: shake 0.3s; }
|
| ... | ... |
@@ -24,6 +24,11 @@ |
| 24 | 24 |
75% { transform: translateX(-5px); }
|
| 25 | 25 |
100% { transform: translateX(0); }
|
| 26 | 26 |
} |
| 27 |
+ @media (prefers-color-scheme: dark) {
|
|
| 28 |
+ .grey { background: #3a3a3c; }
|
|
| 29 |
+ .yellow { background: #b59f3b; }
|
|
| 30 |
+ .green { background: #538e4e; }
|
|
| 31 |
+ } |
|
| 27 | 32 |
@media (min-aspect-ratio: 4/3) { .container { display: flex; flex-wrap: wrap; } }
|
| 28 | 33 |
</style> |
| 29 | 34 |
</head> |
| ... | ... |
@@ -74,8 +79,8 @@ |
| 74 | 79 |
<p><a href="/">dkl9 home</a></p> |
| 75 | 80 |
</div> |
| 76 | 81 |
</div> |
| 77 |
- <script src="guess.js"></script> |
|
| 78 | 82 |
<script src="plot.js"></script> |
| 83 |
+ <script src="guess.js"></script> |
|
| 79 | 84 |
<script src="input.js"></script> |
| 80 | 85 |
</body> |
| 81 | 86 |
</html> |
| ... | ... |
@@ -7,10 +7,9 @@ const allTokens = [...allowed.terminals, ...allowed.unary, ...allowed.binary]; |
| 7 | 7 |
const tl = 5; |
| 8 | 8 |
let target; |
| 9 | 9 |
let puzzleNum; |
| 10 |
-if (false) {
|
|
| 11 |
- target = generateExpr(); |
|
| 12 |
- puzzleNum = 0; |
|
| 13 |
-} else {
|
|
| 10 |
+switch (window.location.hostname) {
|
|
| 11 |
+ case "dkl9.net": |
|
| 12 |
+ case "www.dkl9.net": |
|
| 14 | 13 |
(async () => {
|
| 15 | 14 |
const r = await fetch("https://dkl9.net/cgi-bin/fps_curr", { redirect: "follow" });
|
| 16 | 15 |
puzzleNum = parseInt(r.url.match(/n=(\d+)/)[1]); |
| ... | ... |
@@ -26,6 +25,11 @@ if (false) {
|
| 26 | 25 |
navigator.clipboard.writeText(score); |
| 27 | 26 |
} |
| 28 | 27 |
})(); |
| 28 |
+ break; |
|
| 29 |
+ default: |
|
| 30 |
+ target = generateExpr(); |
|
| 31 |
+ puzzleNum = 0; |
|
| 32 |
+ window.dispatchEvent(new Event("targetReady"));
|
|
| 29 | 33 |
} |
| 30 | 34 |
const container = document.getElementsByClassName("container")[0];
|
| 31 | 35 |
const message = document.getElementById("message");
|
| 32 | 36 |