2 Commits
main ... dev

Author SHA1 Message Date
wordsmith
d99447776e npm -> yarn 2022-02-06 19:55:17 -05:00
wordsmith
8a1af6f9fa Daily Industrial Wordl 2022-02-06 19:54:00 -05:00
8 changed files with 8863 additions and 27941 deletions

1
.tool-versions Normal file
View File

@@ -0,0 +1 @@
nodejs 16.13.1

1
CNAME
View File

@@ -1 +0,0 @@
hellowordl.net

27912
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -140,7 +140,7 @@ table.Game-rows > tbody {
} }
body.dark { body.dark {
background-color: #404040; background-color: #121213;
color: #e0e0e0; color: #e0e0e0;
color-scheme: dark; color-scheme: dark;
} }

View File

@@ -74,16 +74,14 @@ function App() {
fontStyle: difficulty > 1 ? "italic" : "inherit", fontStyle: difficulty > 1 ? "italic" : "inherit",
}} }}
> >
hell Industrial Wordl
</span> </span>
o wordl
</h1> </h1>
<div className="top-right"> <div className="top-right">
{page !== "game" ? ( {page !== "game" ? (
link("❌", "Close", "game") link("❌", "Close", "game")
) : ( ) : (
<> <>
{link("❓", "About", "about")}
{link("⚙️", "Settings", "settings")} {link("⚙️", "Settings", "settings")}
</> </>
)} )}
@@ -96,11 +94,7 @@ function App() {
visibility: page === "game" ? "visible" : "hidden", visibility: page === "game" ? "visible" : "hidden",
}} }}
> >
<a href={seed ? "?random" : "?seed=" + todaySeed}>
{seed ? "Random" : "Today's"}
</a>
</div> </div>
{page === "about" && <About />}
{page === "settings" && ( {page === "settings" && (
<div className="Settings"> <div className="Settings">
<div className="Settings-setting"> <div className="Settings-setting">

View File

@@ -157,7 +157,7 @@ function Game(props: GameProps) {
const onKey = (key: string) => { const onKey = (key: string) => {
if (gameState !== GameState.Playing) { if (gameState !== GameState.Playing) {
if (key === "Enter") { if (key === "Enter") {
startNextGame(); // startNextGame();
} }
return; return;
} }
@@ -192,9 +192,7 @@ function Game(props: GameProps) {
setCurrentGuess((guess) => ""); setCurrentGuess((guess) => "");
const gameOver = (verbed: string) => const gameOver = (verbed: string) =>
`You ${verbed}! The answer was ${target.toUpperCase()}. (Enter to ${ `You ${verbed}! The answer was ${target.toUpperCase()}.`;
challenge ? "play a random game" : "play again"
})`;
if (currentGuess === target) { if (currentGuess === target) {
setHint(gameOver("won")); setHint(gameOver("won"));
@@ -287,7 +285,7 @@ function Game(props: GameProps) {
disabled={gameState !== GameState.Playing || guesses.length === 0} disabled={gameState !== GameState.Playing || guesses.length === 0}
onClick={() => { onClick={() => {
setHint( setHint(
`The answer was ${target.toUpperCase()}. (Enter to play again)` `The answer was ${target.toUpperCase()}.`
); );
setGameState(GameState.Lost); setGameState(GameState.Lost);
(document.activeElement as HTMLElement)?.blur(); (document.activeElement as HTMLElement)?.blur();
@@ -318,21 +316,7 @@ function Game(props: GameProps) {
letterInfo={letterInfo} letterInfo={letterInfo}
onKey={onKey} onKey={onKey}
/> />
<div className="Game-seed-info">
{challenge
? "playing a challenge game"
: seed
? `${describeSeed(seed)} — length ${wordLength}, game ${gameNumber}`
: "playing a random game"}
</div>
<p> <p>
<button
onClick={() => {
share("Link copied to clipboard!");
}}
>
Share a link to this game
</button>{" "}
{gameState !== GameState.Playing && ( {gameState !== GameState.Playing && (
<button <button
onClick={() => { onClick={() => {

View File

@@ -32,7 +32,13 @@ export function resetRng(): void {
} }
export function pick<T>(array: Array<T>): T { export function pick<T>(array: Array<T>): T {
return array[Math.floor(array.length * random())]; const todaySeed = Number(new Date().toISOString().replace(/-/g, "").slice(0, 8));
console.log(todaySeed);
let val = mulberry32(todaySeed)();
let index = val;
const floored = Math.floor(array.length * index);
const word = array[floored];
return word;
} }
// https://a11y-guidelines.orange.com/en/web/components-examples/make-a-screen-reader-talk/ // https://a11y-guidelines.orange.com/en/web/components-examples/make-a-screen-reader-talk/

8850
yarn.lock Normal file

File diff suppressed because it is too large Load Diff