Commit Graph

170 Commits

Author SHA1 Message Date
Jesse D. McDonald 6c17ea3bf7 put the current player's pieces in front to make dragging easier 2020-04-25 00:14:42 -05:00
Jesse D. McDonald a0daab9e5b bump package version to 0.2.0 based on new features 2020-04-24 23:36:26 -05:00
Jesse D. McDonald f6fa4ca32d keep earlier moves when unable to replay full game state 2020-04-24 23:36:02 -05:00
Jesse D. McDonald 204d7acddc add the ability to detect checkmate without taking the king 2020-04-24 23:16:21 -05:00
Jesse D. McDonald db5f56735b prevent selection of pieces with no legal moves 2020-04-24 22:08:05 -05:00
Jesse D. McDonald 2171bb00ee block chain moves which are known dead ends 2020-04-24 22:07:16 -05:00
Jesse D. McDonald 612a39e891 fix for inability to drag from the phantom square 2020-04-24 21:36:20 -05:00
Jesse D. McDonald 7e01b0aad0 fix some interactions between click-to-select and drag 2020-04-23 11:48:03 -05:00
Jesse D. McDonald fc73c872ed fix for broken cycle detection in isInCheck function 2020-04-18 16:05:50 -05:00
Jesse D. McDonald 4e72bd4258 fix for warning when serviceWorker is present without getNotifications 2020-04-17 17:42:23 -05:00
Jesse D. McDonald ada365b76f workaround for Safari, version 2; tested in Midori 2020-04-17 17:41:25 -05:00
Jesse D. McDonald baaff7a8c3 add a workaround for a Safari bug that breaks the board sizing 2020-04-17 16:02:57 -05:00
Jesse D. McDonald c791c05d5e add rel="noopener noreferer" to external links for improved privacy and security 2020-04-16 21:31:47 -05:00
Jesse D. McDonald f3e2d2c7a4 add a 'badge' icon with link to current page with game ID 2020-04-16 21:30:38 -05:00
Jesse D. McDonald d6ee83a36f add a per-game Jitsi Meet link for voice/video chat 2020-04-16 01:28:46 -05:00
Jesse D. McDonald 6bfe05459d fix for badge opacity not recognized in Firefox 2020-04-11 18:13:29 -05:00
Jesse D. McDonald cc083e4d52 add missing pieces so Chrome sees an installable PWA 2020-04-11 18:12:19 -05:00
Jesse D. McDonald 3010e4bb84 disable user scaling (mobile only) 2020-04-06 02:32:33 -05:00
Jesse D. McDonald d436dfd7b5 limit width of game select widget to fit within page 2020-04-06 02:20:11 -05:00
Jesse D. McDonald 7c4b5972db add a Progressive Web App (PWA) manifest 2020-04-06 02:02:01 -05:00
Jesse D. McDonald 36d9a8654d remove cb-in-check class when placing pieces 2020-04-05 20:48:36 -05:00
Jesse D. McDonald a7df98a990 fix for prev_turn has no effect when mid-chain 2020-04-05 17:39:47 -05:00
Jesse D. McDonald cba11ec0c8 highlight king when in check 2020-04-05 17:31:42 -05:00
Jesse D. McDonald 7c04b9ba09 performance improvements for determination of check 2020-04-05 17:25:06 -05:00
Jesse D. McDonald accbc316ff add an optional in-page notification sound 2020-04-05 17:24:22 -05:00
Jesse D. McDonald e28ea59095 block castling out of check 2020-04-05 05:24:26 -05:00
Jesse D. McDonald d8f199d1d1 add a dev-build script to run webpack in development mode 2020-04-05 04:42:39 -05:00
Jesse D. McDonald fcb14d489c add ability to detect obvious check (chains of 6 moves or less) 2020-04-05 04:42:10 -05:00
Jesse D. McDonald 75b66e6ce3 fix for sw.js not copied to dist directory 2020-04-05 04:39:55 -05:00
Jesse D. McDonald 644a140b65 remove CSS optimizer plugin; fixes 1% opacity on badges 2020-04-05 04:39:10 -05:00
Jesse D. McDonald 1a7728e53d fix some quirks with the game select menu 2020-04-04 06:03:13 -05:00
Jesse D. McDonald 7ebea1d1fc restructure data to limit indirect links; breaking change
I found that the game list was wiped out (again) and I suspect that the
issue was that some client pushed an update to the game list before
receiving the current data for the top-level object. That would have
caused it to create new objects for the game and metadata lists
containing only the single newly-created game and store links to them in
the 'games' and 'meta' fields of the top-level object. This data would
not be merged because the new objects have no connection to the original
objects which should have been linked from those fields. The top-level
object would be merged, but only to the extent of updating the links.

To fix this, I moved the 'meta' object to the top level with a fixed
identifier (UUID + '/meta'). This identifier _is_ the object's identity
("soul") so even if a client initializes it with an empty object the new
fields should be merged when syncing resumes. I removed the 'games'
object altogether, since the meta object keeps track of which game IDs
are available. Individual games are assigned "souls" based on their game
IDs (UUID + ('/game/' or '/meta/') + game ID). The resulting structure
looks like:

    'UUID/meta': {
      '12345abcde': <link to 'UUID/meta/12345abcde'>,
      '3a2b5c7e1f': <link to 'UUID/meta/3a2b5c7e1f'>,
      ...
    },
    'UUID/meta/12345abcde': { ... darkName, lightName, moves, etc. ... },
    'UUID/game/12345abcde': { 'board': 'JSON' },
    'UUID/meta/3a2b5c7e1f': { ... darkName, lightName, moves, etc. ... },
    'UUID/game/3a2b5c7e1f': { 'board': 'JSON' },
    ...

Besides being more resilient, this structure should also be more
performant since there are fewer links to traverse to access the game
data. So far in my admittedly limited testing I haven't seen any of the
syncronization issues that plagued the older version.
2020-04-04 05:24:59 -05:00
Jesse D. McDonald b228f1f626 switch scanPath and legalMoves to return generators instead of arrays 2020-04-04 03:10:42 -05:00
Jesse D. McDonald 5f9ce09181 fix for syntax error (extension) function statement inside 'if' 2020-04-03 13:37:58 -05:00
Jesse D. McDonald fe711991f5 store initial state as soon as a new game is created 2020-04-02 18:10:08 -05:00
Jesse D. McDonald e1722cf589 fix remaining hard-coded paths & extend cache lifetimes with content hashes 2020-04-02 05:25:49 -05:00
Jesse D. McDonald 68f1618597 integrate SVG optimization with webpack 2020-04-02 03:05:52 -05:00
Jesse D. McDonald 2e68c3b7b1 replace submodules with proper NPM dependencies & webpack 2020-04-02 02:51:41 -05:00
Jesse D. McDonald be41aa3467 optimize SVGs with svgo 2020-04-01 21:39:33 -05:00
Jesse D. McDonald a51401980a format as an NPM package to manage dependencies 2020-04-01 21:38:56 -05:00
Jesse D. McDonald 258e6db544 remove the flipped versions of the traditional chess icons 2020-04-01 21:38:00 -05:00
Jesse D. McDonald 60b0157d1f adjust SVG stroke width on Paco Ŝako pieces to match traditional icons 2020-04-01 21:24:24 -05:00
Jesse D. McDonald ce7a69a10a filter unwanted fields from received JSON board string 2020-03-30 00:06:19 -05:00
Jesse D. McDonald d37cb4a67f simplify filter expression for GUN message logging 2020-03-30 00:05:48 -05:00
Jesse D. McDonald d329f005da remove redundant closeNotifications() before setCurrentGame() 2020-03-29 20:16:03 -05:00
Jesse D. McDonald 864f320b41 adjust badge layout to avoid overlap & add tooltips 2020-03-29 20:12:32 -05:00
Jesse D. McDonald 31853ec1be adjust rook SVG to avoid thin edges 2020-03-29 16:50:24 -05:00
Jesse D. McDonald d5b3594e57 close prior notifications when updating game state 2020-03-29 16:40:48 -05:00
Jesse D. McDonald 1f0442cadb reverse all piece images when board is reversed, not just knights 2020-03-29 16:13:20 -05:00
Jesse D. McDonald eb25bb31d2 make entire square clickable to select, not just the piece 2020-03-29 16:12:46 -05:00