File tree Expand file tree Collapse file tree 3 files changed +17
-17
lines changed
Expand file tree Collapse file tree 3 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 33 "type" : " module" ,
44 "private" : true ,
55 "scripts" : {
6- "build" : " bunx astro build" ,
7- "deploy" : " bunx wrangler deploy" ,
8- "dev" : " bunx astro dev" ,
6+ "build" : " astro build" ,
7+ "deploy" : " wrangler deploy" ,
8+ "dev" : " astro dev" ,
99 "test" : " bun test"
1010 },
1111 "dependencies" : {
Original file line number Diff line number Diff line change 1- import { createSignal , batch } from "solid-js" ;
2-
1+ import { batch , createSignal } from "solid-js" ;
2+ import { CONFIG , WORDS } from "~/config" ;
3+ import { getNewWord } from "~/lib/get-new-word" ;
4+ import { getTileColors } from "~/lib/get-tile-colors" ;
5+ import { showNotification } from "~/lib/show-notification" ;
6+ import { showSharePopup } from "~/lib/show-share-popup" ;
37import type {
8+ BoardAction ,
49 CurrentSection ,
510 GameMode ,
611 KeyColor ,
7- TileColor ,
8- BoardAction ,
912 State ,
13+ TileColor ,
1014} from "~/types" ;
1115
12- import { WORDS , CONFIG } from "~/config" ;
13-
14- import { getNewWord } from "~/lib/get-new-word" ;
15- import { getTileColors } from "~/lib/get-tile-colors" ;
16- import { showNotification } from "~/lib/show-notification" ;
17- import { showSharePopup } from "~/lib/show-share-popup" ;
18-
1916import { useSettings } from "./useSettings" ;
2017import { useStats } from "./useStats" ;
2118import { useTiles } from "./useTiles" ;
@@ -102,9 +99,9 @@ export function useGame() {
10299 setKeycolors ( ( prev ) => ( { ...prev , ...newKeyColors } ) ) ;
103100 }
104101
105- function submitGuess ( guess : string ) {
102+ async function submitGuess ( guess : string ) {
106103 if ( ! WORDS . guesses . includes ( guess ) ) {
107- shakeCurrentRow ( ) ;
104+ await shakeCurrentRow ( ) ;
108105 showNotification ( `Word ${ guess . toUpperCase ( ) } does not exist` ) ;
109106 return ;
110107 }
Original file line number Diff line number Diff line change @@ -68,11 +68,14 @@ export function useTiles() {
6868 } , 150 ) ;
6969 }
7070
71- function shakeCurrentRow ( ) {
71+ async function shakeCurrentRow ( ) {
7272 const row = getCurrentRow ( ) ;
7373 const start = row * CONFIG . wordLength ;
7474 const end = start + CONFIG . wordLength ;
7575
76+ // Wait for any ongoing pop animations to finish (150ms)
77+ await delay ( 150 ) ;
78+
7679 setTiles ( ( prev ) => {
7780 const copy = [ ...prev ] ;
7881 for ( let i = start ; i < end ; i ++ ) {
You can’t perform that action at this time.
0 commit comments