diff --git a/modules/pref/src/main/Pref.scala b/modules/pref/src/main/Pref.scala index 5bd2022d79..ff631b57ba 100644 --- a/modules/pref/src/main/Pref.scala +++ b/modules/pref/src/main/Pref.scala @@ -99,6 +99,15 @@ case class Pref( case _ => 250 } + def animationMillisForSpeedPuzzles: Int = + animation match { + case Animation.NONE => 0 + case Animation.FAST => 70 + case Animation.NORMAL => 100 + case Animation.SLOW => 160 + case _ => 100 + } + def isBlindfold = blindfold == Pref.Blindfold.YES def bgImgOrDefault = bgImg | Pref.defaultBgImg diff --git a/modules/storm/src/main/StormJson.scala b/modules/storm/src/main/StormJson.scala index 99a22dfc1f..778bd740f3 100644 --- a/modules/storm/src/main/StormJson.scala +++ b/modules/storm/src/main/StormJson.scala @@ -23,7 +23,8 @@ final class StormJson(sign: StormSign) { "destination" -> p.destination, "moveEvent" -> p.moveEvent, "highlight" -> p.highlight, - "is3d" -> p.is3d + "is3d" -> p.is3d, + "animation" -> p.animationMillisForSpeedPuzzles ) def newHigh(n: Option[StormHigh.NewHigh]) = diff --git a/ui/analyse/package.json b/ui/analyse/package.json index 2fe4b5174f..dad3ef529e 100644 --- a/ui/analyse/package.json +++ b/ui/analyse/package.json @@ -25,7 +25,7 @@ "ceval": "2.0.0", "chat": "2.0.0", "chess": "2.0.0", - "chessground": "^8.1.2", + "chessground": "^8.1.3", "chessops": "^0.9.0", "common": "2.0.0", "game": "2.0.0", diff --git a/ui/chess/package.json b/ui/chess/package.json index f47828ab99..cc7b7bfa42 100644 --- a/ui/chess/package.json +++ b/ui/chess/package.json @@ -18,7 +18,7 @@ "prod": "yarn run compile" }, "dependencies": { - "chessground": "^8.1.2", + "chessground": "^8.1.3", "common": "2.0.0", "snabbdom": "^3.0.1" }, diff --git a/ui/editor/package.json b/ui/editor/package.json index 6278a21776..0fe20fac97 100644 --- a/ui/editor/package.json +++ b/ui/editor/package.json @@ -15,7 +15,7 @@ "@build/rollupProject": "2.0.0" }, "dependencies": { - "chessground": "^8.1.2", + "chessground": "^8.1.3", "chessops": "^0.9.0", "snabbdom": "^3.0.1", "common": "2.0.0" diff --git a/ui/lobby/package.json b/ui/lobby/package.json index 6c4d4e8823..c4e4300853 100644 --- a/ui/lobby/package.json +++ b/ui/lobby/package.json @@ -18,7 +18,7 @@ "@types/lichess": "2.0.0" }, "dependencies": { - "chessground": "^8.1.2", + "chessground": "^8.1.3", "common": "2.0.0", "snabbdom": "^3.0.1" }, diff --git a/ui/puz/package.json b/ui/puz/package.json index 054e2acafe..d0160b4b3d 100644 --- a/ui/puz/package.json +++ b/ui/puz/package.json @@ -16,7 +16,7 @@ "dependencies": { "chessops": "^0.9.0", "snabbdom": "^3.0.1", - "chessground": "^8.1.2", + "chessground": "^8.1.3", "common": "2.0.0" }, "devDependencies": { diff --git a/ui/puz/src/interfaces.ts b/ui/puz/src/interfaces.ts index 81894f8486..ca054ac732 100644 --- a/ui/puz/src/interfaces.ts +++ b/ui/puz/src/interfaces.ts @@ -9,6 +9,7 @@ export interface PuzPrefs { rookCastle: boolean; moveEvent: number; highlight: boolean; + animation: number; } export type UserMove = (orig: Key, dest: Key) => void; diff --git a/ui/puz/src/view/chessground.ts b/ui/puz/src/view/chessground.ts index 1e8aac3f06..4c03f76362 100644 --- a/ui/puz/src/view/chessground.ts +++ b/ui/puz/src/view/chessground.ts @@ -46,8 +46,7 @@ export function makeConfig(opts: CgConfig, pref: PuzPrefs, userMove: UserMove): check: pref.highlight, }, animation: { - enabled: true, - duration: 100, + duration: pref.animation, }, disableContextMenu: true, }; diff --git a/ui/puzzle/package.json b/ui/puzzle/package.json index b2791e4ea4..e5921df381 100644 --- a/ui/puzzle/package.json +++ b/ui/puzzle/package.json @@ -20,7 +20,7 @@ "ceval": "2.0.0", "chart.js": "^2.9", "chess": "2.0.0", - "chessground": "^8.1.2", + "chessground": "^8.1.3", "chessops": "^0.9.0", "common": "2.0.0", "nvui": "2.0.0", diff --git a/ui/racer/package.json b/ui/racer/package.json index d2a503747f..2d7bb52e96 100644 --- a/ui/racer/package.json +++ b/ui/racer/package.json @@ -18,7 +18,7 @@ "dependencies": { "chess": "2.0.0", "chessops": "^0.9.0", - "chessground": "^8.1.2", + "chessground": "^8.1.3", "snabbdom": "^3.0.1", "common": "2.0.0", "puz": "2.0.0" diff --git a/ui/round/package.json b/ui/round/package.json index fff1ae8d73..946241774d 100644 --- a/ui/round/package.json +++ b/ui/round/package.json @@ -19,7 +19,7 @@ "ab": "https://github.com/lichess-org/ab-stub", "chat": "2.0.0", "chess": "2.0.0", - "chessground": "^8.1.2", + "chessground": "^8.1.3", "common": "2.0.0", "game": "2.0.0", "nvui": "2.0.0", diff --git a/ui/storm/package.json b/ui/storm/package.json index 6ab4089b5d..153e53c3a8 100644 --- a/ui/storm/package.json +++ b/ui/storm/package.json @@ -18,7 +18,7 @@ "dependencies": { "chess": "2.0.0", "chessops": "^0.9.0", - "chessground": "^8.1.2", + "chessground": "^8.1.3", "snabbdom": "^3.0.1", "common": "2.0.0", "puz": "2.0.0" diff --git a/ui/swiss/package.json b/ui/swiss/package.json index 1f6ede0f1d..f2ffe1487d 100644 --- a/ui/swiss/package.json +++ b/ui/swiss/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "chat": "2.0.0", - "chessground": "^8.1.2", + "chessground": "^8.1.3", "common": "2.0.0", "game": "2.0.0", "snabbdom": "^3.0.1" diff --git a/ui/tournament/package.json b/ui/tournament/package.json index b973119581..d301fd0a58 100644 --- a/ui/tournament/package.json +++ b/ui/tournament/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "chat": "2.0.0", - "chessground": "^8.1.2", + "chessground": "^8.1.3", "common": "2.0.0", "game": "2.0.0", "snabbdom": "^3.0.1" diff --git a/yarn.lock b/yarn.lock index b1dfc86537..d39c12400f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -967,10 +967,10 @@ chessground@^4.4: merge "1.2.0" mithril "github:ornicar/mithril.js#v1.0.1" -chessground@^8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/chessground/-/chessground-8.1.2.tgz#08be47dc838316054a03b441c370c09613bf487a" - integrity sha512-DRRBUbagjfKGnWAU9heiIfM1mowYxcV2Q/gukdR+TxjJwW9s0QjgTqipBqt0xki+SanQRuqhi37t2gLMd09RuQ== +chessground@^8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/chessground/-/chessground-8.1.3.tgz#8c573e86c6b37cdd154870ade24f7f874959d1e8" + integrity sha512-ca6NJKA0AUsDD0Z6Niuj4MubMlv37yVguB43mn3I2G05uT9x/z0yWmpDCsjci75xrDgX7yKFchgDpZ08YT1nrA== chessops@^0.9.0: version "0.9.0"