@bendyline/gilde 0.2.7 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/authoring/chat-models/nanbeige4.2-3b-q4.json +1 -1
- package/authoring/chat-models/nemotron3.5-bolt-e4b-q4.json +137 -0
- package/authoring/tactical/wave.json +18 -18
- package/data/chat-models/index.json +1 -1
- package/data/chat-models/na/nanbeige4.2-3b-q4/manifest.json +1 -1
- package/data/chat-models/ne/nemotron3.5-bolt-e4b-q4/manifest.json +142 -0
- package/data/chat-models/ne/nemotron3.5-bolt-e4b-q4/versions/1.0.0/manifest.json +14 -0
- package/data/chat-models/ne/nemotron3.5-bolt-e4b-q4/versions/1.0.1/manifest.json +14 -0
- package/data/chat-models/raw-index.json +1 -1
- package/data/craftbook-templates/an/anniversary-cut/versions/1.0.8/craftbook.json +411 -0
- package/data/craftbook-templates/an/anniversary-cut/versions/1.0.8/test.json +100 -0
- package/data/craftbook-templates/au/automation-recipe/versions/1.0.6/craftbook.json +354 -0
- package/data/craftbook-templates/au/automation-recipe/versions/1.0.6/test.json +223 -0
- package/data/craftbook-templates/bu/bug-fix-tdd/versions/2.0.6/craftbook.json +736 -0
- package/data/craftbook-templates/bu/bug-fix-tdd/versions/2.0.6/test.json +221 -0
- package/data/craftbook-templates/ch/character-sheet/versions/1.0.6/craftbook.json +242 -0
- package/data/craftbook-templates/ch/character-sheet/versions/1.0.6/test.json +143 -0
- package/data/craftbook-templates/ch/character-turnaround/versions/1.0.6/craftbook.json +284 -0
- package/data/craftbook-templates/ch/character-turnaround/versions/1.0.6/test.json +189 -0
- package/data/craftbook-templates/co/codemod-sweep/versions/1.0.5/craftbook.json +607 -0
- package/data/craftbook-templates/co/codemod-sweep/versions/1.0.5/test.json +252 -0
- package/data/craftbook-templates/co/comprehensive-codebase-review/manifest.json +1 -1
- package/data/craftbook-templates/co/comprehensive-codebase-review/versions/1.0.3/craftbook.json +548 -0
- package/data/craftbook-templates/co/comprehensive-codebase-review/versions/1.0.3/test.json +160 -0
- package/data/craftbook-templates/de/dependency-upgrade/versions/1.0.6/craftbook.json +625 -0
- package/data/craftbook-templates/de/dependency-upgrade/versions/1.0.6/test.json +235 -0
- package/data/craftbook-templates/dr/draft-social-post/versions/1.0.6/craftbook.json +343 -0
- package/data/craftbook-templates/dr/draft-social-post/versions/1.0.6/test.json +161 -0
- package/data/craftbook-templates/ed/edit-notes/versions/1.0.5/craftbook.json +341 -0
- package/data/craftbook-templates/ed/edit-notes/versions/1.0.5/test.json +150 -0
- package/data/craftbook-templates/fl/flaky-test-fix/versions/1.0.5/craftbook.json +720 -0
- package/data/craftbook-templates/fl/flaky-test-fix/versions/1.0.5/test.json +239 -0
- package/data/craftbook-templates/in/invitation-design/versions/1.0.5/craftbook.json +269 -0
- package/data/craftbook-templates/in/invitation-design/versions/1.0.5/test.json +121 -0
- package/data/craftbook-templates/in/invoice-run/versions/1.1.8/craftbook.json +405 -0
- package/data/craftbook-templates/in/invoice-run/versions/1.1.8/test.json +140 -0
- package/data/craftbook-templates/index.json +1 -1
- package/data/craftbook-templates/ju/juice-pass/versions/1.0.5/craftbook.json +257 -0
- package/data/craftbook-templates/ju/juice-pass/versions/1.0.5/test.json +116 -0
- package/data/craftbook-templates/mo/mock-interview/versions/1.0.6/craftbook.json +300 -0
- package/data/craftbook-templates/mo/mock-interview/versions/1.0.6/test.json +82 -0
- package/data/craftbook-templates/mo/morning-report/versions/1.0.5/craftbook.json +319 -0
- package/data/craftbook-templates/mo/morning-report/versions/1.0.5/test.json +259 -0
- package/data/craftbook-templates/ni/nightly-fix-sweep/manifest.json +2 -1
- package/data/craftbook-templates/ni/nightly-fix-sweep/versions/1.0.3/craftbook.json +244 -0
- package/data/craftbook-templates/ni/nightly-fix-sweep/versions/1.0.3/test.json +120 -0
- package/data/craftbook-templates/pa/page-spread/versions/1.0.6/craftbook.json +243 -0
- package/data/craftbook-templates/pa/page-spread/versions/1.0.6/test.json +132 -0
- package/data/craftbook-templates/pe/perf-optimization/versions/2.0.5/craftbook.json +699 -0
- package/data/craftbook-templates/pe/perf-optimization/versions/2.0.5/test.json +235 -0
- package/data/craftbook-templates/pr/practice-exam/versions/1.0.5/craftbook.json +326 -0
- package/data/craftbook-templates/pr/practice-exam/versions/1.0.5/test.json +119 -0
- package/data/craftbook-templates/raw-index.json +1 -1
- package/data/craftbook-templates/re/reception-report/versions/1.0.6/craftbook.json +327 -0
- package/data/craftbook-templates/re/reception-report/versions/1.0.6/test.json +168 -0
- package/data/craftbook-templates/re/refactor-module/versions/2.0.6/craftbook.json +699 -0
- package/data/craftbook-templates/re/refactor-module/versions/2.0.6/test.json +241 -0
- package/data/craftbook-templates/ro/rough-cut-assembly/versions/1.0.6/craftbook.json +332 -0
- package/data/craftbook-templates/ro/rough-cut-assembly/versions/1.0.6/test.json +142 -0
- package/data/craftbook-templates/sc/schema-migration/versions/2.0.5/craftbook.json +626 -0
- package/data/craftbook-templates/sc/schema-migration/versions/2.0.5/test.json +225 -0
- package/data/craftbook-templates/sh/ship/versions/1.1.4/craftbook.json +353 -0
- package/data/craftbook-templates/sh/ship/versions/1.1.4/test.json +235 -0
- package/data/craftbook-templates/so/social-digest/versions/1.0.7/craftbook.json +271 -0
- package/data/craftbook-templates/so/social-digest/versions/1.0.7/test.json +168 -0
- package/data/craftbook-templates/te/test-suite-backfill/versions/2.0.6/craftbook.json +596 -0
- package/data/craftbook-templates/te/test-suite-backfill/versions/2.0.6/test.json +195 -0
- package/data/craftbook-templates/th/thank-you-sweep/versions/1.0.5/craftbook.json +310 -0
- package/data/craftbook-templates/th/thank-you-sweep/versions/1.0.5/test.json +146 -0
- package/data/craftbook-templates/ti/tileset-batch/versions/1.0.6/craftbook.json +349 -0
- package/data/craftbook-templates/ti/tileset-batch/versions/1.0.6/test.json +162 -0
- package/data/craftbook-templates/tr/transcribe-index/versions/1.0.5/craftbook.json +359 -0
- package/data/craftbook-templates/tr/transcribe-index/versions/1.0.5/test.json +157 -0
- package/data/craftbook-templates/ty/type-safety-pass/versions/2.0.5/craftbook.json +596 -0
- package/data/craftbook-templates/ty/type-safety-pass/versions/2.0.5/test.json +221 -0
- package/data/craftbook-templates/we/weak-spot-drill/versions/1.0.5/craftbook.json +321 -0
- package/data/craftbook-templates/we/weak-spot-drill/versions/1.0.5/test.json +128 -0
- package/data/craftbook-templates/we/weekly-pipeline-review/versions/1.0.6/craftbook.json +244 -0
- package/data/craftbook-templates/we/weekly-pipeline-review/versions/1.0.6/test.json +80 -0
- package/data/gezel-templates/aa/aanjager/manifest.json +2 -2
- package/data/gezel-templates/aa/aanjager/versions/1.0.1/about.md +22 -0
- package/data/gezel-templates/aa/aanjager/versions/1.0.1/manifest.json +10 -0
- package/data/gezel-templates/ar/archivaris/manifest.json +4 -3
- package/data/gezel-templates/ar/archivaris/versions/1.0.2/about.md +26 -0
- package/data/gezel-templates/ar/archivaris/versions/1.0.2/manifest.json +10 -0
- package/data/gezel-templates/bo/boekwachter/manifest.json +2 -2
- package/data/gezel-templates/bo/boekwachter/versions/1.1.1/about.md +29 -0
- package/data/gezel-templates/bo/boekwachter/versions/1.1.1/manifest.json +16 -0
- package/data/gezel-templates/bu/builder/versions/1.5.1/about.md +34 -0
- package/data/gezel-templates/bu/builder/versions/1.5.1/manifest.json +16 -0
- package/data/gezel-templates/ca/career-coach/manifest.json +2 -2
- package/data/gezel-templates/ca/career-coach/versions/1.0.1/about.md +29 -0
- package/data/gezel-templates/ca/career-coach/versions/1.0.1/manifest.json +10 -0
- package/data/gezel-templates/ce/ceremoniemeester/manifest.json +4 -3
- package/data/gezel-templates/ce/ceremoniemeester/versions/1.0.1/about.md +24 -0
- package/data/gezel-templates/ce/ceremoniemeester/versions/1.0.1/manifest.json +10 -0
- package/data/gezel-templates/ch/checkers-player/manifest.json +2 -2
- package/data/gezel-templates/ch/checkers-player/versions/1.0.2/about.md +24 -0
- package/data/gezel-templates/ch/checkers-player/versions/1.0.2/manifest.json +10 -0
- package/data/gezel-templates/ch/chess-player/manifest.json +2 -2
- package/data/gezel-templates/ch/chess-player/versions/1.0.2/about.md +21 -0
- package/data/gezel-templates/ch/chess-player/versions/1.0.2/manifest.json +10 -0
- package/data/gezel-templates/de/developer/manifest.json +1 -1
- package/data/gezel-templates/de/developer/versions/1.5.1/about.md +34 -0
- package/data/gezel-templates/de/developer/versions/1.5.1/manifest.json +21 -0
- package/data/gezel-templates/go/go-player/manifest.json +2 -2
- package/data/gezel-templates/go/go-player/versions/1.0.2/about.md +22 -0
- package/data/gezel-templates/go/go-player/versions/1.0.2/manifest.json +10 -0
- package/data/gezel-templates/hu/huismeester/manifest.json +2 -2
- package/data/gezel-templates/hu/huismeester/versions/1.0.1/about.md +24 -0
- package/data/gezel-templates/hu/huismeester/versions/1.0.1/manifest.json +10 -0
- package/data/gezel-templates/index.json +1 -1
- package/data/gezel-templates/ka/kantoormeester/manifest.json +4 -3
- package/data/gezel-templates/ka/kantoormeester/versions/1.0.1/about.md +22 -0
- package/data/gezel-templates/ka/kantoormeester/versions/1.0.1/manifest.json +10 -0
- package/data/gezel-templates/ke/keurmeester/manifest.json +4 -3
- package/data/gezel-templates/ke/keurmeester/versions/1.0.1/about.md +17 -0
- package/data/gezel-templates/ke/keurmeester/versions/1.0.1/manifest.json +6 -0
- package/data/gezel-templates/ma/maaltijdplanner/manifest.json +4 -3
- package/data/gezel-templates/ma/maaltijdplanner/versions/1.0.1/about.md +21 -0
- package/data/gezel-templates/ma/maaltijdplanner/versions/1.0.1/manifest.json +10 -0
- package/data/gezel-templates/me/meester/versions/1.4.1/about.md +26 -0
- package/data/gezel-templates/me/meester/versions/1.4.1/manifest.json +9 -0
- package/data/gezel-templates/mo/mock-interviewer/manifest.json +2 -2
- package/data/gezel-templates/mo/mock-interviewer/versions/1.0.1/about.md +28 -0
- package/data/gezel-templates/mo/mock-interviewer/versions/1.0.1/manifest.json +10 -0
- package/data/gezel-templates/om/omroeper/manifest.json +5 -3
- package/data/gezel-templates/om/omroeper/versions/1.0.1/about.md +33 -0
- package/data/gezel-templates/om/omroeper/versions/1.0.1/manifest.json +23 -0
- package/data/gezel-templates/pe/penningmeester/manifest.json +4 -3
- package/data/gezel-templates/pe/penningmeester/versions/1.0.2/about.md +23 -0
- package/data/gezel-templates/pe/penningmeester/versions/1.0.2/manifest.json +10 -0
- package/data/gezel-templates/pu/puzzelaar/manifest.json +4 -3
- package/data/gezel-templates/pu/puzzelaar/versions/1.0.1/about.md +18 -0
- package/data/gezel-templates/pu/puzzelaar/versions/1.0.1/manifest.json +16 -0
- package/data/gezel-templates/raw-index.json +1 -1
- package/data/gezel-templates/re/reisleider/manifest.json +4 -3
- package/data/gezel-templates/re/reisleider/versions/1.0.1/about.md +22 -0
- package/data/gezel-templates/re/reisleider/versions/1.0.1/manifest.json +10 -0
- package/data/gezel-templates/re/reviewer/versions/1.4.1/about.md +49 -0
- package/data/gezel-templates/re/reviewer/versions/1.4.1/manifest.json +21 -0
- package/data/gezel-templates/sc/schrijfmaat/manifest.json +4 -3
- package/data/gezel-templates/sc/schrijfmaat/versions/1.0.1/about.md +25 -0
- package/data/gezel-templates/sc/schrijfmaat/versions/1.0.1/manifest.json +10 -0
- package/data/gezel-templates/st/study-buddy/manifest.json +4 -3
- package/data/gezel-templates/st/study-buddy/versions/1.0.1/about.md +21 -0
- package/data/gezel-templates/st/study-buddy/versions/1.0.1/manifest.json +10 -0
- package/data/gezel-templates/ve/veiligheidsmeester/manifest.json +1 -1
- package/data/gezel-templates/ve/veiligheidsmeester/versions/1.0.1/about.md +27 -0
- package/data/gezel-templates/ve/veiligheidsmeester/versions/1.0.1/manifest.json +21 -0
- package/data/gezel-templates/ve/vertaler/manifest.json +1 -1
- package/data/gezel-templates/ve/vertaler/versions/1.0.1/about.md +26 -0
- package/data/gezel-templates/ve/vertaler/versions/1.0.1/manifest.json +13 -0
- package/data/gezel-templates/vo/voorman/manifest.json +4 -3
- package/data/gezel-templates/vo/voorman/versions/1.6.1/about.md +37 -0
- package/data/gezel-templates/vo/voorman/versions/1.6.1/manifest.json +9 -0
- package/data/gezel-templates/wo/woordsmid/manifest.json +4 -3
- package/data/gezel-templates/wo/woordsmid/versions/1.0.1/about.md +18 -0
- package/data/gezel-templates/wo/woordsmid/versions/1.0.1/manifest.json +16 -0
- package/data/gezel-templates/zo/zorgcoordinator/manifest.json +4 -3
- package/data/gezel-templates/zo/zorgcoordinator/versions/1.0.2/about.md +23 -0
- package/data/gezel-templates/zo/zorgcoordinator/versions/1.0.2/manifest.json +10 -0
- package/data/project-types/ca/caregiving-binder/manifest.json +1 -1
- package/data/project-types/ca/caregiving-binder/versions/1.1.2/about.md +7 -0
- package/data/project-types/ca/caregiving-binder/versions/1.1.2/care.json +4 -0
- package/data/project-types/ca/caregiving-binder/versions/1.1.2/manifest.json +178 -0
- package/data/project-types/ca/caregiving-binder/versions/1.1.2/meds.json +8 -0
- package/data/project-types/ca/caregiving-binder/versions/1.1.2/mission.md +7 -0
- package/data/project-types/ca/caregiving-binder/versions/1.1.2/pages/dashboard/index.html +265 -0
- package/data/project-types/ch/checkers/manifest.json +1 -1
- package/data/project-types/ch/checkers/versions/1.2.4/about.md +9 -0
- package/data/project-types/ch/checkers/versions/1.2.4/game.json +77 -0
- package/data/project-types/ch/checkers/versions/1.2.4/manifest.json +182 -0
- package/data/project-types/ch/checkers/versions/1.2.4/mission.md +9 -0
- package/data/project-types/ch/checkers/versions/1.2.4/pages/board/index.html +1158 -0
- package/data/project-types/ch/chess/manifest.json +1 -1
- package/data/project-types/ch/chess/versions/1.0.7/about.md +9 -0
- package/data/project-types/ch/chess/versions/1.0.7/game.json +127 -0
- package/data/project-types/ch/chess/versions/1.0.7/manifest.json +196 -0
- package/data/project-types/ch/chess/versions/1.0.7/mission.md +8 -0
- package/data/project-types/ch/chess/versions/1.0.7/pages/board/index.html +851 -0
- package/data/project-types/ev/event-planner/manifest.json +1 -1
- package/data/project-types/ev/event-planner/versions/1.0.3/about.md +7 -0
- package/data/project-types/ev/event-planner/versions/1.0.3/budget.json +5 -0
- package/data/project-types/ev/event-planner/versions/1.0.3/guests.json +10 -0
- package/data/project-types/ev/event-planner/versions/1.0.3/manifest.json +171 -0
- package/data/project-types/ev/event-planner/versions/1.0.3/mission.md +6 -0
- package/data/project-types/ev/event-planner/versions/1.0.3/pages/dashboard/index.html +283 -0
- package/data/project-types/fl/flashcards/manifest.json +1 -1
- package/data/project-types/fl/flashcards/versions/1.2.1/about.md +8 -0
- package/data/project-types/fl/flashcards/versions/1.2.1/deck.json +7 -0
- package/data/project-types/fl/flashcards/versions/1.2.1/manifest.json +207 -0
- package/data/project-types/fl/flashcards/versions/1.2.1/mission.md +6 -0
- package/data/project-types/fl/flashcards/versions/1.2.1/pages/review/index.html +549 -0
- package/data/project-types/fr/freelance-office/manifest.json +1 -1
- package/data/project-types/fr/freelance-office/versions/1.0.3/about.md +6 -0
- package/data/project-types/fr/freelance-office/versions/1.0.3/invoices.json +9 -0
- package/data/project-types/fr/freelance-office/versions/1.0.3/manifest.json +143 -0
- package/data/project-types/fr/freelance-office/versions/1.0.3/mission.md +6 -0
- package/data/project-types/fr/freelance-office/versions/1.0.3/pages/dashboard/index.html +258 -0
- package/data/project-types/fu/fundraiser-hq/manifest.json +1 -1
- package/data/project-types/fu/fundraiser-hq/versions/1.0.3/about.md +7 -0
- package/data/project-types/fu/fundraiser-hq/versions/1.0.3/donations.json +7 -0
- package/data/project-types/fu/fundraiser-hq/versions/1.0.3/manifest.json +127 -0
- package/data/project-types/fu/fundraiser-hq/versions/1.0.3/mission.md +6 -0
- package/data/project-types/fu/fundraiser-hq/versions/1.0.3/pages/dashboard/index.html +261 -0
- package/data/project-types/go/go/manifest.json +1 -1
- package/data/project-types/go/go/versions/1.0.5/about.md +9 -0
- package/data/project-types/go/go/versions/1.0.5/game.json +103 -0
- package/data/project-types/go/go/versions/1.0.5/manifest.json +182 -0
- package/data/project-types/go/go/versions/1.0.5/mission.md +8 -0
- package/data/project-types/go/go/versions/1.0.5/pages/board/index.html +855 -0
- package/data/project-types/ho/household-budget/manifest.json +1 -1
- package/data/project-types/ho/household-budget/versions/1.0.4/about.md +6 -0
- package/data/project-types/ho/household-budget/versions/1.0.4/ledger.json +5 -0
- package/data/project-types/ho/household-budget/versions/1.0.4/manifest.json +164 -0
- package/data/project-types/ho/household-budget/versions/1.0.4/mission.md +5 -0
- package/data/project-types/ho/household-budget/versions/1.0.4/pages/dashboard/index.html +340 -0
- package/data/project-types/ho/household-manual/manifest.json +1 -1
- package/data/project-types/ho/household-manual/versions/1.0.3/about.md +7 -0
- package/data/project-types/ho/household-manual/versions/1.0.3/manifest.json +153 -0
- package/data/project-types/ho/household-manual/versions/1.0.3/mission.md +8 -0
- package/data/project-types/ho/household-manual/versions/1.0.3/pages/dashboard/index.html +258 -0
- package/data/project-types/ho/household-manual/versions/1.0.3/systems.json +8 -0
- package/data/project-types/im/image-feed/art.json +1 -1
- package/data/project-types/im/image-feed/manifest.json +1 -1
- package/data/project-types/im/image-feed/versions/1.0.2/about.md +21 -0
- package/data/project-types/im/image-feed/versions/1.0.2/manifest.json +330 -0
- package/data/project-types/im/image-feed/versions/1.0.2/mission.md +10 -0
- package/data/project-types/im/image-feed/versions/1.0.2/pages/gallery/index.html +830 -0
- package/data/project-types/im/image-feed/versions/1.0.2/posts/index.json +4 -0
- package/data/project-types/im/image-feed/versions/1.0.2/style-guide.md +24 -0
- package/data/project-types/index.json +1 -1
- package/data/project-types/jo/job-hunt/versions/1.0.4/about.md +10 -0
- package/data/project-types/jo/job-hunt/versions/1.0.4/activity.json +4 -0
- package/data/project-types/jo/job-hunt/versions/1.0.4/manifest.json +212 -0
- package/data/project-types/jo/job-hunt/versions/1.0.4/mission.md +9 -0
- package/data/project-types/jo/job-hunt/versions/1.0.4/pages/dashboard/index.html +430 -0
- package/data/project-types/jo/job-hunt/versions/1.0.4/pipeline.json +6 -0
- package/data/project-types/li/life-binder/manifest.json +1 -1
- package/data/project-types/li/life-binder/versions/1.0.4/about.md +7 -0
- package/data/project-types/li/life-binder/versions/1.0.4/documents.json +145 -0
- package/data/project-types/li/life-binder/versions/1.0.4/manifest.json +138 -0
- package/data/project-types/li/life-binder/versions/1.0.4/mission.md +6 -0
- package/data/project-types/li/life-binder/versions/1.0.4/pages/dashboard/index.html +248 -0
- package/data/project-types/me/meal-planner/manifest.json +1 -1
- package/data/project-types/me/meal-planner/versions/1.0.3/about.md +6 -0
- package/data/project-types/me/meal-planner/versions/1.0.3/manifest.json +160 -0
- package/data/project-types/me/meal-planner/versions/1.0.3/menu.json +5 -0
- package/data/project-types/me/meal-planner/versions/1.0.3/mission.md +5 -0
- package/data/project-types/me/meal-planner/versions/1.0.3/pages/dashboard/index.html +248 -0
- package/data/project-types/me/meal-planner/versions/1.0.3/pantry.json +9 -0
- package/data/project-types/no/novel-writing-room/manifest.json +1 -1
- package/data/project-types/no/novel-writing-room/versions/1.0.3/about.md +7 -0
- package/data/project-types/no/novel-writing-room/versions/1.0.3/chapters.json +10 -0
- package/data/project-types/no/novel-writing-room/versions/1.0.3/manifest.json +158 -0
- package/data/project-types/no/novel-writing-room/versions/1.0.3/mission.md +7 -0
- package/data/project-types/no/novel-writing-room/versions/1.0.3/pages/dashboard/index.html +264 -0
- package/data/project-types/no/novel-writing-room/versions/1.0.3/sessions.json +6 -0
- package/data/project-types/raw-index.json +1 -1
- package/data/project-types/so/social-feed/art.json +1 -1
- package/data/project-types/so/social-feed/manifest.json +1 -1
- package/data/project-types/so/social-feed/versions/1.0.3/about.md +19 -0
- package/data/project-types/so/social-feed/versions/1.0.3/manifest.json +348 -0
- package/data/project-types/so/social-feed/versions/1.0.3/mission.md +10 -0
- package/data/project-types/so/social-feed/versions/1.0.3/pages/dashboard/index.html +754 -0
- package/data/project-types/so/social-feed/versions/1.0.3/posts/index.json +4 -0
- package/data/project-types/so/social-feed/versions/1.0.3/voice-guide.md +22 -0
- package/data/project-types/so/software-project/art.json +1 -1
- package/data/project-types/so/software-project/manifest.json +1 -1
- package/data/project-types/so/software-project/versions/1.0.1/about.md +3 -0
- package/data/project-types/so/software-project/versions/1.0.1/manifest.json +41 -0
- package/data/project-types/so/software-project/versions/1.0.1/mission.md +4 -0
- package/data/project-types/tr/trip-planner/manifest.json +1 -1
- package/data/project-types/tr/trip-planner/versions/1.0.4/about.md +7 -0
- package/data/project-types/tr/trip-planner/versions/1.0.4/journal.json +4 -0
- package/data/project-types/tr/trip-planner/versions/1.0.4/manifest.json +226 -0
- package/data/project-types/tr/trip-planner/versions/1.0.4/mission.md +4 -0
- package/data/project-types/tr/trip-planner/versions/1.0.4/packing.json +8 -0
- package/data/project-types/tr/trip-planner/versions/1.0.4/pages/dashboard/index.html +368 -0
- package/data/project-types/tr/trip-planner/versions/1.0.4/trip.json +8 -0
- package/data/project-types/wo/word-clues/manifest.json +1 -1
- package/data/project-types/wo/word-clues/versions/1.0.2/about.md +7 -0
- package/data/project-types/wo/word-clues/versions/1.0.2/game.json +14 -0
- package/data/project-types/wo/word-clues/versions/1.0.2/manifest.json +205 -0
- package/data/project-types/wo/word-clues/versions/1.0.2/mission.md +3 -0
- package/data/project-types/wo/word-clues/versions/1.0.2/pages/board/index.html +399 -0
- package/data/project-types/wo/word-clues/versions/1.0.2/words.json +216 -0
- package/package.json +1 -1
- package/schemas/craftbook-doc.schema.json +26 -0
- package/schemas/craftbook-template-version.schema.json +26 -0
- package/schemas/craftbook-test.schema.json +1 -0
|
@@ -0,0 +1,1158 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="gezel-demo" content="standalone" />
|
|
7
|
+
<title>Checkers</title>
|
|
8
|
+
<style>
|
|
9
|
+
:root {
|
|
10
|
+
color-scheme: light dark;
|
|
11
|
+
--bg: #faf7f2;
|
|
12
|
+
--card: #fff;
|
|
13
|
+
--ink: #2b2620;
|
|
14
|
+
--muted: #7a7166;
|
|
15
|
+
--accent: #b5651d;
|
|
16
|
+
--track: #ece5da;
|
|
17
|
+
--sq-light: #f3ead9;
|
|
18
|
+
--sq-dark: #b08968;
|
|
19
|
+
--sq-hint: #7a9e7e;
|
|
20
|
+
--red-a: #c9502c;
|
|
21
|
+
--red-b: #8f3018;
|
|
22
|
+
--black-a: #4a423a;
|
|
23
|
+
--black-b: #211c17;
|
|
24
|
+
--coord-on-light: rgba(43, 38, 32, 0.38);
|
|
25
|
+
--coord-on-dark: rgba(255, 250, 242, 0.5);
|
|
26
|
+
--frame-a: #9a7557;
|
|
27
|
+
--frame-b: #513725;
|
|
28
|
+
--frame-edge: #352217;
|
|
29
|
+
--last-move: rgba(239, 180, 92, 0.36);
|
|
30
|
+
}
|
|
31
|
+
:root[data-theme='dark'] {
|
|
32
|
+
--bg: #1c1a17;
|
|
33
|
+
--card: #262320;
|
|
34
|
+
--ink: #efe9e0;
|
|
35
|
+
--muted: #a59a8c;
|
|
36
|
+
--accent: #e0894a;
|
|
37
|
+
--track: #3a352f;
|
|
38
|
+
--sq-light: #3c362e;
|
|
39
|
+
--sq-dark: #6b4f37;
|
|
40
|
+
--sq-hint: #5d7f62;
|
|
41
|
+
--red-a: #d96a42;
|
|
42
|
+
--red-b: #9c3b1e;
|
|
43
|
+
--black-a: #8c8378;
|
|
44
|
+
--black-b: #3a342d;
|
|
45
|
+
--coord-on-light: rgba(239, 233, 224, 0.38);
|
|
46
|
+
--coord-on-dark: rgba(255, 248, 238, 0.48);
|
|
47
|
+
--frame-a: #74543d;
|
|
48
|
+
--frame-b: #34241a;
|
|
49
|
+
--frame-edge: #1b120d;
|
|
50
|
+
--last-move: rgba(236, 159, 85, 0.32);
|
|
51
|
+
}
|
|
52
|
+
@media (prefers-color-scheme: dark) {
|
|
53
|
+
:root:not([data-theme='light']) {
|
|
54
|
+
--bg: #1c1a17;
|
|
55
|
+
--card: #262320;
|
|
56
|
+
--ink: #efe9e0;
|
|
57
|
+
--muted: #a59a8c;
|
|
58
|
+
--accent: #e0894a;
|
|
59
|
+
--track: #3a352f;
|
|
60
|
+
--sq-light: #3c362e;
|
|
61
|
+
--sq-dark: #6b4f37;
|
|
62
|
+
--sq-hint: #5d7f62;
|
|
63
|
+
--red-a: #d96a42;
|
|
64
|
+
--red-b: #9c3b1e;
|
|
65
|
+
--black-a: #8c8378;
|
|
66
|
+
--black-b: #3a342d;
|
|
67
|
+
--coord-on-light: rgba(239, 233, 224, 0.38);
|
|
68
|
+
--coord-on-dark: rgba(255, 248, 238, 0.48);
|
|
69
|
+
--frame-a: #74543d;
|
|
70
|
+
--frame-b: #34241a;
|
|
71
|
+
--frame-edge: #1b120d;
|
|
72
|
+
--last-move: rgba(236, 159, 85, 0.32);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
* { box-sizing: border-box; }
|
|
76
|
+
body {
|
|
77
|
+
margin: 0;
|
|
78
|
+
font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
79
|
+
background: var(--bg);
|
|
80
|
+
color: var(--ink);
|
|
81
|
+
padding: 1.25rem;
|
|
82
|
+
}
|
|
83
|
+
main { max-width: 720px; margin: 0 auto; }
|
|
84
|
+
header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
|
|
85
|
+
h1 {
|
|
86
|
+
font-family: Georgia, 'PT Serif', 'Times New Roman', serif;
|
|
87
|
+
font-size: 1.35rem;
|
|
88
|
+
font-weight: 600;
|
|
89
|
+
margin: 0;
|
|
90
|
+
}
|
|
91
|
+
.status { color: var(--muted); font-size: 0.9rem; margin: 0.15rem 0 0.9rem; }
|
|
92
|
+
.status .thinking { color: var(--accent); }
|
|
93
|
+
button.newgame {
|
|
94
|
+
border: 1px solid var(--track);
|
|
95
|
+
background: var(--card);
|
|
96
|
+
color: var(--ink);
|
|
97
|
+
border-radius: 6px;
|
|
98
|
+
padding: 0.3rem 0.7rem;
|
|
99
|
+
min-height: 44px;
|
|
100
|
+
font: inherit;
|
|
101
|
+
font-size: 0.85rem;
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
}
|
|
104
|
+
button.newgame:hover { border-color: var(--accent); }
|
|
105
|
+
dialog {
|
|
106
|
+
width: min(430px, calc(100vw - 2rem));
|
|
107
|
+
border: 1px solid var(--track);
|
|
108
|
+
border-radius: 10px;
|
|
109
|
+
padding: 0;
|
|
110
|
+
background: var(--card);
|
|
111
|
+
color: var(--ink);
|
|
112
|
+
box-shadow: 0 18px 55px rgba(0, 0, 0, 0.35);
|
|
113
|
+
}
|
|
114
|
+
dialog::backdrop { background: rgba(20, 17, 14, 0.62); }
|
|
115
|
+
.new-game-form { padding: 1rem; }
|
|
116
|
+
.new-game-form h2 {
|
|
117
|
+
font-family: Georgia, 'PT Serif', 'Times New Roman', serif;
|
|
118
|
+
font-size: 1.1rem;
|
|
119
|
+
margin: 0;
|
|
120
|
+
}
|
|
121
|
+
.dialog-intro { color: var(--muted); margin: 0.2rem 0 0.9rem; font-size: 0.85rem; }
|
|
122
|
+
.rule-fieldset { border: 0; margin: 0; padding: 0; }
|
|
123
|
+
.rule-fieldset legend {
|
|
124
|
+
color: var(--muted);
|
|
125
|
+
font-size: 0.72rem;
|
|
126
|
+
font-weight: 700;
|
|
127
|
+
letter-spacing: 0.05em;
|
|
128
|
+
margin-bottom: 0.35rem;
|
|
129
|
+
text-transform: uppercase;
|
|
130
|
+
}
|
|
131
|
+
.rule-tray {
|
|
132
|
+
display: grid;
|
|
133
|
+
grid-template-columns: 1fr 1fr;
|
|
134
|
+
gap: 0.35rem;
|
|
135
|
+
padding: 0.35rem;
|
|
136
|
+
border: 1px solid var(--track);
|
|
137
|
+
border-radius: 10px;
|
|
138
|
+
background: var(--track);
|
|
139
|
+
}
|
|
140
|
+
.rule-key {
|
|
141
|
+
min-width: 0;
|
|
142
|
+
border: 1px solid transparent;
|
|
143
|
+
border-radius: 6px;
|
|
144
|
+
padding: 0.55rem 0.6rem;
|
|
145
|
+
background: var(--card);
|
|
146
|
+
color: var(--ink);
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
font: inherit;
|
|
149
|
+
text-align: left;
|
|
150
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
|
|
151
|
+
}
|
|
152
|
+
.rule-key:hover { border-color: var(--accent); }
|
|
153
|
+
.rule-key[aria-checked='true'] {
|
|
154
|
+
border-color: var(--accent);
|
|
155
|
+
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
156
|
+
transform: translateY(1px);
|
|
157
|
+
}
|
|
158
|
+
.rule-key strong { display: block; font-size: 0.88rem; }
|
|
159
|
+
.rule-key span { display: block; color: var(--muted); font-size: 0.75rem; line-height: 1.3; margin-top: 0.1rem; }
|
|
160
|
+
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.45rem; margin-top: 1rem; }
|
|
161
|
+
.dialog-button {
|
|
162
|
+
border: 1px solid var(--accent);
|
|
163
|
+
border-radius: 6px;
|
|
164
|
+
padding: 0.4rem 0.75rem;
|
|
165
|
+
background: var(--accent);
|
|
166
|
+
color: var(--bg);
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
font: inherit;
|
|
169
|
+
font-size: 0.85rem;
|
|
170
|
+
}
|
|
171
|
+
.dialog-button.secondary { border-color: var(--track); background: var(--card); color: var(--ink); }
|
|
172
|
+
.table { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 0.9rem; }
|
|
173
|
+
.boardwrap {
|
|
174
|
+
background: linear-gradient(145deg, var(--frame-a), var(--frame-b));
|
|
175
|
+
border: 1px solid var(--frame-edge);
|
|
176
|
+
border-radius: 14px;
|
|
177
|
+
padding: 0.85rem;
|
|
178
|
+
box-shadow:
|
|
179
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.24),
|
|
180
|
+
inset 0 -4px 8px rgba(0, 0, 0, 0.24),
|
|
181
|
+
0 10px 24px rgba(31, 21, 15, 0.22);
|
|
182
|
+
}
|
|
183
|
+
.board {
|
|
184
|
+
position: relative;
|
|
185
|
+
display: grid;
|
|
186
|
+
grid-template-columns: repeat(8, 1fr);
|
|
187
|
+
grid-template-rows: repeat(8, minmax(0, 1fr));
|
|
188
|
+
aspect-ratio: 1;
|
|
189
|
+
border: 1px solid var(--frame-edge);
|
|
190
|
+
border-radius: 8px;
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
user-select: none;
|
|
193
|
+
box-shadow:
|
|
194
|
+
inset 0 0 0 1px rgba(255, 255, 255, 0.08),
|
|
195
|
+
0 5px 12px rgba(0, 0, 0, 0.3);
|
|
196
|
+
}
|
|
197
|
+
.cell { position: relative; display: grid; min-width: 0; min-height: 0; place-items: center; }
|
|
198
|
+
.cell.light { background: var(--sq-light); }
|
|
199
|
+
.cell.dark { background: var(--sq-dark); cursor: default; }
|
|
200
|
+
.cell::before {
|
|
201
|
+
content: '';
|
|
202
|
+
position: absolute;
|
|
203
|
+
inset: 0;
|
|
204
|
+
background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), transparent 46%, rgba(0, 0, 0, 0.09));
|
|
205
|
+
pointer-events: none;
|
|
206
|
+
}
|
|
207
|
+
.cell.dark.selectable { cursor: pointer; }
|
|
208
|
+
.cell.last-move { box-shadow: inset 0 0 0 999px var(--last-move); }
|
|
209
|
+
.cell.last-move-from { box-shadow: inset 0 0 0 2px var(--last-move); }
|
|
210
|
+
.cell.dark.selected {
|
|
211
|
+
outline: 3px solid var(--accent);
|
|
212
|
+
outline-offset: -3px;
|
|
213
|
+
box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.16);
|
|
214
|
+
}
|
|
215
|
+
.cell.dark.hint { box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.08); cursor: pointer; }
|
|
216
|
+
.coord {
|
|
217
|
+
position: absolute;
|
|
218
|
+
top: 6%;
|
|
219
|
+
left: 7%;
|
|
220
|
+
z-index: 2;
|
|
221
|
+
font-size: clamp(0.45rem, 1.25vw, 0.65rem);
|
|
222
|
+
font-weight: 600;
|
|
223
|
+
letter-spacing: 0.01em;
|
|
224
|
+
line-height: 1;
|
|
225
|
+
pointer-events: none;
|
|
226
|
+
user-select: none;
|
|
227
|
+
}
|
|
228
|
+
.cell.light .coord { color: var(--coord-on-light); }
|
|
229
|
+
.cell.dark .coord { color: var(--coord-on-dark); }
|
|
230
|
+
.cell.dark.hint::after {
|
|
231
|
+
content: '';
|
|
232
|
+
width: 26%;
|
|
233
|
+
height: 26%;
|
|
234
|
+
z-index: 3;
|
|
235
|
+
border-radius: 50%;
|
|
236
|
+
background: var(--sq-hint);
|
|
237
|
+
box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16), 0 2px 6px rgba(0, 0, 0, 0.24);
|
|
238
|
+
opacity: 0.92;
|
|
239
|
+
animation: hint-breathe 1.6s ease-in-out infinite;
|
|
240
|
+
}
|
|
241
|
+
.piece {
|
|
242
|
+
position: relative;
|
|
243
|
+
z-index: 1;
|
|
244
|
+
width: 76%;
|
|
245
|
+
height: 76%;
|
|
246
|
+
border: 1px solid rgba(30, 20, 14, 0.45);
|
|
247
|
+
border-radius: 50%;
|
|
248
|
+
display: grid;
|
|
249
|
+
place-items: center;
|
|
250
|
+
font-weight: 700;
|
|
251
|
+
font-size: clamp(0.62rem, 1.7vw, 0.9rem);
|
|
252
|
+
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
|
|
253
|
+
box-shadow:
|
|
254
|
+
inset 0 4px 5px rgba(255, 255, 255, 0.23),
|
|
255
|
+
inset 0 -6px 8px rgba(0, 0, 0, 0.32),
|
|
256
|
+
0 5px 7px rgba(0, 0, 0, 0.34);
|
|
257
|
+
transition: transform 150ms ease-out, box-shadow 150ms ease-out, opacity 120ms ease-out;
|
|
258
|
+
}
|
|
259
|
+
.piece::before {
|
|
260
|
+
content: '';
|
|
261
|
+
position: absolute;
|
|
262
|
+
inset: 12%;
|
|
263
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
264
|
+
border-radius: 50%;
|
|
265
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.17);
|
|
266
|
+
pointer-events: none;
|
|
267
|
+
}
|
|
268
|
+
.piece.red { background: radial-gradient(circle at 32% 25%, var(--red-a), var(--red-b) 72%); color: #f8e8de; }
|
|
269
|
+
.piece.black { background: radial-gradient(circle at 32% 25%, var(--black-a), var(--black-b) 72%); color: #d9d2c7; }
|
|
270
|
+
.piece.king::before { inset: 16%; border: 2px double currentColor; opacity: 0.72; }
|
|
271
|
+
.cell.selectable .piece:hover,
|
|
272
|
+
.cell.selected .piece { transform: translateY(-2px) scale(1.025); }
|
|
273
|
+
.piece.draggable { cursor: grab; touch-action: none; }
|
|
274
|
+
.piece.dragging {
|
|
275
|
+
z-index: 9;
|
|
276
|
+
cursor: grabbing;
|
|
277
|
+
opacity: 0.94;
|
|
278
|
+
transition: none;
|
|
279
|
+
filter: drop-shadow(0 10px 7px rgba(0, 0, 0, 0.34));
|
|
280
|
+
}
|
|
281
|
+
.piece.moving-piece {
|
|
282
|
+
position: absolute;
|
|
283
|
+
z-index: 10;
|
|
284
|
+
margin: 0;
|
|
285
|
+
pointer-events: none;
|
|
286
|
+
transition: none;
|
|
287
|
+
}
|
|
288
|
+
.piece.move-source { opacity: 0; }
|
|
289
|
+
@keyframes hint-breathe {
|
|
290
|
+
0%, 100% { transform: scale(0.9); opacity: 0.7; }
|
|
291
|
+
50% { transform: scale(1.06); opacity: 1; }
|
|
292
|
+
}
|
|
293
|
+
.aside { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
|
|
294
|
+
.panel {
|
|
295
|
+
background: var(--card);
|
|
296
|
+
border: 1px solid var(--track);
|
|
297
|
+
border-radius: 10px;
|
|
298
|
+
padding: 0.7rem 0.85rem;
|
|
299
|
+
font-size: 0.85rem;
|
|
300
|
+
}
|
|
301
|
+
.panel h2 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 0.35rem; }
|
|
302
|
+
.moveThought { font-style: italic; }
|
|
303
|
+
.moveThought .who { color: var(--muted); font-style: normal; font-size: 0.78rem; display: block; margin-bottom: 0.15rem; }
|
|
304
|
+
.log { margin: 0; padding-left: 1.05rem; max-height: 200px; overflow-y: auto; }
|
|
305
|
+
.log li { margin: 0.15rem 0; color: var(--muted); }
|
|
306
|
+
.log li.latest { color: var(--ink); }
|
|
307
|
+
.banner {
|
|
308
|
+
border: 1px solid var(--accent);
|
|
309
|
+
border-radius: 6px;
|
|
310
|
+
padding: 0.45rem 0.7rem;
|
|
311
|
+
font-size: 0.85rem;
|
|
312
|
+
margin-bottom: 0.75rem;
|
|
313
|
+
display: none;
|
|
314
|
+
}
|
|
315
|
+
.banner.show { display: block; }
|
|
316
|
+
.note {
|
|
317
|
+
margin: 0 0 0.85rem;
|
|
318
|
+
padding: 0.5rem 0.65rem;
|
|
319
|
+
border: 1px solid var(--track);
|
|
320
|
+
border-radius: 6px;
|
|
321
|
+
background: var(--card);
|
|
322
|
+
color: var(--muted);
|
|
323
|
+
font-size: 0.8rem;
|
|
324
|
+
}
|
|
325
|
+
@media (prefers-reduced-motion: reduce) {
|
|
326
|
+
.cell.dark.hint::after { animation: none; }
|
|
327
|
+
.piece { transition: none; }
|
|
328
|
+
}
|
|
329
|
+
@media (max-width: 640px) { .table { grid-template-columns: 1fr; } }
|
|
330
|
+
.demo-banner {
|
|
331
|
+
display: flex;
|
|
332
|
+
align-items: center;
|
|
333
|
+
justify-content: space-between;
|
|
334
|
+
gap: 0.75rem;
|
|
335
|
+
margin: 0 0 0.85rem;
|
|
336
|
+
padding: 0.5rem 0.65rem;
|
|
337
|
+
border: 1px solid var(--accent);
|
|
338
|
+
border-radius: 6px;
|
|
339
|
+
background: color-mix(in srgb, var(--card) 88%, var(--accent));
|
|
340
|
+
color: var(--ink);
|
|
341
|
+
font-size: 0.8rem;
|
|
342
|
+
}
|
|
343
|
+
.demo-banner[hidden] { display: none; }
|
|
344
|
+
.demo-banner strong { font-weight: 700; }
|
|
345
|
+
.demo-reset {
|
|
346
|
+
flex: none;
|
|
347
|
+
padding: 0.25rem 0.5rem;
|
|
348
|
+
border: 1px solid var(--accent);
|
|
349
|
+
border-radius: 6px;
|
|
350
|
+
background: var(--card);
|
|
351
|
+
color: var(--ink);
|
|
352
|
+
cursor: pointer;
|
|
353
|
+
font: inherit;
|
|
354
|
+
}
|
|
355
|
+
.demo-reset:hover { border-color: var(--ink); }
|
|
356
|
+
</style>
|
|
357
|
+
</head>
|
|
358
|
+
<body>
|
|
359
|
+
<main>
|
|
360
|
+
<div class="demo-banner" data-gezel-demo-banner hidden>
|
|
361
|
+
<span><strong>Demo mode</strong> — hot-seat play, sample data stays in this page.</span>
|
|
362
|
+
<button type="button" class="demo-reset" onclick="location.reload()">Reset demo</button>
|
|
363
|
+
</div>
|
|
364
|
+
<p class="note" id="browser-note" hidden>
|
|
365
|
+
Viewing from a browser tab — the board stays live, but moves happen in the app's Output pane.
|
|
366
|
+
</p>
|
|
367
|
+
<div class="banner" id="banner"></div>
|
|
368
|
+
<header>
|
|
369
|
+
<h1>Checkers</h1>
|
|
370
|
+
<button type="button" class="newgame" id="newgame">New game</button>
|
|
371
|
+
</header>
|
|
372
|
+
<p class="status" id="status">Setting up the board…</p>
|
|
373
|
+
<div class="table">
|
|
374
|
+
<div class="boardwrap"><div class="board" id="board"></div></div>
|
|
375
|
+
<div class="aside">
|
|
376
|
+
<div class="panel moveThought" id="moveThought-panel" hidden>
|
|
377
|
+
<span class="who">Checkers player says</span>
|
|
378
|
+
<span id="moveThought"></span>
|
|
379
|
+
</div>
|
|
380
|
+
<div class="panel">
|
|
381
|
+
<h2>Moves</h2>
|
|
382
|
+
<ol class="log" id="log"><li>No moves yet — red opens.</li></ol>
|
|
383
|
+
</div>
|
|
384
|
+
</div>
|
|
385
|
+
</div>
|
|
386
|
+
<dialog id="new-game-dialog" aria-labelledby="new-game-title">
|
|
387
|
+
<form class="new-game-form" id="new-game-form">
|
|
388
|
+
<h2 id="new-game-title">New game</h2>
|
|
389
|
+
<p class="dialog-intro">Choose the capture rule for this game.</p>
|
|
390
|
+
<fieldset class="rule-fieldset">
|
|
391
|
+
<legend>Captures</legend>
|
|
392
|
+
<div class="rule-tray" role="radiogroup" aria-label="Capture rule">
|
|
393
|
+
<button type="button" class="rule-key" role="radio" aria-checked="true" data-force-captures="true">
|
|
394
|
+
<strong>Required</strong>
|
|
395
|
+
<span>Standard rules. Take a capture when one is available.</span>
|
|
396
|
+
</button>
|
|
397
|
+
<button type="button" class="rule-key" role="radio" aria-checked="false" data-force-captures="false">
|
|
398
|
+
<strong>Optional</strong>
|
|
399
|
+
<span>Ordinary moves stay available when you can capture.</span>
|
|
400
|
+
</button>
|
|
401
|
+
</div>
|
|
402
|
+
</fieldset>
|
|
403
|
+
<div class="dialog-actions">
|
|
404
|
+
<button type="button" class="dialog-button secondary" id="cancel-new-game">Cancel</button>
|
|
405
|
+
<button type="button" class="dialog-button" id="start-new-game">Start game</button>
|
|
406
|
+
</div>
|
|
407
|
+
</form>
|
|
408
|
+
</dialog>
|
|
409
|
+
</main>
|
|
410
|
+
<script>
|
|
411
|
+
/* gezel-page-demo-stub v1 */
|
|
412
|
+
/*
|
|
413
|
+
* The canonical demo stub for Gezel type pages. MIT License.
|
|
414
|
+
*
|
|
415
|
+
* Paste this file's bytes verbatim into a <script> block ahead of the
|
|
416
|
+
* page's own code, then call makeDemoGezel({ page, tools, data }) with the
|
|
417
|
+
* page's demo handlers. Served by Gezel, the real window.gezel is already
|
|
418
|
+
* injected and the stub steps aside; opened as a raw file (the live demos
|
|
419
|
+
* on gezelgilde.com), it installs a window.gezel whose tools and data are
|
|
420
|
+
* the page-supplied handler maps — one code path in every mode. `tools`
|
|
421
|
+
* and `data` map a tool name / declared read path to a function; data
|
|
422
|
+
* handlers back read() and list(), and url() returns the handler's value
|
|
423
|
+
* or passes a data: URI through. See docs/page-authoring.md.
|
|
424
|
+
*/
|
|
425
|
+
(function () {
|
|
426
|
+
'use strict';
|
|
427
|
+
window.makeDemoGezel = function (opts) {
|
|
428
|
+
if (window.gezel) return window.gezel;
|
|
429
|
+
var page = (opts && opts.page) || {};
|
|
430
|
+
var tools = (opts && opts.tools) || {};
|
|
431
|
+
var data = (opts && opts.data) || {};
|
|
432
|
+
var themeListeners = [];
|
|
433
|
+
var media = window.matchMedia ? window.matchMedia('(prefers-color-scheme: dark)') : null;
|
|
434
|
+
var ui = {
|
|
435
|
+
theme: { mode: media && media.matches ? 'dark' : 'light' },
|
|
436
|
+
onTheme: function (cb) {
|
|
437
|
+
themeListeners.push(cb);
|
|
438
|
+
return function () {
|
|
439
|
+
var at = themeListeners.indexOf(cb);
|
|
440
|
+
if (at >= 0) themeListeners.splice(at, 1);
|
|
441
|
+
};
|
|
442
|
+
},
|
|
443
|
+
};
|
|
444
|
+
if (media && media.addEventListener) {
|
|
445
|
+
media.addEventListener('change', function (ev) {
|
|
446
|
+
ui.theme = { mode: ev.matches ? 'dark' : 'light' };
|
|
447
|
+
themeListeners.slice().forEach(function (cb) { cb(ui.theme); });
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
function fail(code, message) {
|
|
451
|
+
var err = new Error(message);
|
|
452
|
+
err.code = code;
|
|
453
|
+
return Promise.reject(err);
|
|
454
|
+
}
|
|
455
|
+
function run(map, key, arg) {
|
|
456
|
+
if (!Object.prototype.hasOwnProperty.call(map, key)) return null;
|
|
457
|
+
return Promise.resolve().then(function () { return map[key](arg); });
|
|
458
|
+
}
|
|
459
|
+
window.gezel = {
|
|
460
|
+
page: {
|
|
461
|
+
api: 1,
|
|
462
|
+
projectId: 'demo',
|
|
463
|
+
source: 'type',
|
|
464
|
+
entry: page.entry || 'index.html',
|
|
465
|
+
typeName: page.typeName || 'demo',
|
|
466
|
+
params: page.params || {},
|
|
467
|
+
mode: 'demo',
|
|
468
|
+
},
|
|
469
|
+
tools: {
|
|
470
|
+
list: function () { return Promise.resolve(Object.keys(tools)); },
|
|
471
|
+
invoke: function (name, input) {
|
|
472
|
+
var call = run(tools, name, input || {});
|
|
473
|
+
if (!call) return fail('not-allowed', "The demo does not handle the tool '" + name + "'.");
|
|
474
|
+
return call.then(function (output) { return { output: output }; });
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
data: {
|
|
478
|
+
read: function (path, o) {
|
|
479
|
+
return run(data, path, o || {}) || fail('not-allowed', "The demo has no data for '" + path + "'.");
|
|
480
|
+
},
|
|
481
|
+
list: function (path, o) {
|
|
482
|
+
return run(data, path, o || {}) || Promise.resolve([]);
|
|
483
|
+
},
|
|
484
|
+
watch: function () { return function () {}; },
|
|
485
|
+
url: function (path) {
|
|
486
|
+
if (Object.prototype.hasOwnProperty.call(data, path)) return String(data[path]({}));
|
|
487
|
+
return typeof path === 'string' && path.indexOf('data:') === 0 ? path : '';
|
|
488
|
+
},
|
|
489
|
+
},
|
|
490
|
+
ui: ui,
|
|
491
|
+
refresh: function () {},
|
|
492
|
+
};
|
|
493
|
+
return window.gezel;
|
|
494
|
+
};
|
|
495
|
+
})();
|
|
496
|
+
</script>
|
|
497
|
+
<script>
|
|
498
|
+
(function () {
|
|
499
|
+
'use strict';
|
|
500
|
+
var FILES = 'abcdefgh';
|
|
501
|
+
|
|
502
|
+
function sqName(x, y) { return FILES[x] + String(8 - y); }
|
|
503
|
+
function parseSquare(name) {
|
|
504
|
+
return { x: FILES.indexOf(name[0].toLowerCase()), y: 8 - Number(name[1]) };
|
|
505
|
+
}
|
|
506
|
+
function withPiece(squares, x, y, ch) {
|
|
507
|
+
var index = y * 8 + x;
|
|
508
|
+
return squares.slice(0, index) + ch + squares.slice(index + 1);
|
|
509
|
+
}
|
|
510
|
+
function applyPreviewHop(squares, from, to) {
|
|
511
|
+
var start = parseSquare(from);
|
|
512
|
+
var end = parseSquare(to);
|
|
513
|
+
var ch = squares[start.y * 8 + start.x];
|
|
514
|
+
var next = withPiece(squares, start.x, start.y, '.');
|
|
515
|
+
if (Math.abs(start.x - end.x) === 2) {
|
|
516
|
+
next = withPiece(next, (start.x + end.x) / 2, (start.y + end.y) / 2, '.');
|
|
517
|
+
}
|
|
518
|
+
if (ch === 'r' && end.y === 0) ch = 'R';
|
|
519
|
+
if (ch === 'b' && end.y === 7) ch = 'B';
|
|
520
|
+
return withPiece(next, end.x, end.y, ch);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
// ── demo rules engine: hot-seat play when the page opens as a raw file ──
|
|
524
|
+
function demoSide(ch) {
|
|
525
|
+
if (ch === 'r' || ch === 'R') return 'user';
|
|
526
|
+
if (ch === 'b' || ch === 'B') return 'ai';
|
|
527
|
+
return null;
|
|
528
|
+
}
|
|
529
|
+
function demoDirections(ch) {
|
|
530
|
+
if (ch === 'R' || ch === 'B') return [[-1,-1],[1,-1],[-1,1],[1,1]];
|
|
531
|
+
return ch === 'r' ? [[-1,-1],[1,-1]] : [[-1,1],[1,1]];
|
|
532
|
+
}
|
|
533
|
+
function demoCaptures(squares, x, y, ch, origin, path, captures, out) {
|
|
534
|
+
var found = false;
|
|
535
|
+
demoDirections(ch).forEach(function (d) {
|
|
536
|
+
var mx = x + d[0]; var my = y + d[1];
|
|
537
|
+
var tx = x + d[0] * 2; var ty = y + d[1] * 2;
|
|
538
|
+
if (tx < 0 || tx > 7 || ty < 0 || ty > 7 || mx < 0 || mx > 7 || my < 0 || my > 7) return;
|
|
539
|
+
var middle = squares[my * 8 + mx];
|
|
540
|
+
if (demoSide(middle) === null || demoSide(middle) === demoSide(ch) || squares[ty * 8 + tx] !== '.') return;
|
|
541
|
+
found = true;
|
|
542
|
+
var next = withPiece(withPiece(withPiece(squares, x, y, '.'), mx, my, '.'), tx, ty, ch);
|
|
543
|
+
demoCaptures(next, tx, ty, ch, origin, path.concat(sqName(tx, ty)), captures.concat(sqName(mx, my)), out);
|
|
544
|
+
});
|
|
545
|
+
if (!found && captures.length) out.push({ from: origin, to: path[path.length - 1], path: path, captures: captures });
|
|
546
|
+
}
|
|
547
|
+
function demoMoves(game) {
|
|
548
|
+
var captures = []; var simple = [];
|
|
549
|
+
for (var y = 0; y < 8; y += 1) {
|
|
550
|
+
for (var x = 0; x < 8; x += 1) {
|
|
551
|
+
var ch = game.squares[y * 8 + x];
|
|
552
|
+
if (demoSide(ch) !== game.turn) continue;
|
|
553
|
+
var from = sqName(x, y);
|
|
554
|
+
demoCaptures(game.squares, x, y, ch, from, [from], [], captures);
|
|
555
|
+
demoDirections(ch).forEach(function (d) {
|
|
556
|
+
var tx = x + d[0]; var ty = y + d[1];
|
|
557
|
+
if (tx >= 0 && tx < 8 && ty >= 0 && ty < 8 && game.squares[ty * 8 + tx] === '.') {
|
|
558
|
+
simple.push({ from: from, to: sqName(tx, ty), path: [from, sqName(tx, ty)], captures: [] });
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
return captures.length && game.forceCaptures !== false ? captures : captures.concat(simple);
|
|
564
|
+
}
|
|
565
|
+
function demoNewGame(forceCaptures) {
|
|
566
|
+
var game = {
|
|
567
|
+
version: 1,
|
|
568
|
+
squares: '.b.b.b.bb.b.b.b..b.b.b.b................r.r.r.r..r.r.r.rr.r.r.r.',
|
|
569
|
+
turn: 'user', status: 'playing', userColor: 'red', forceCaptures: forceCaptures !== false,
|
|
570
|
+
legalMoves: [], lastMove: null, lastMoveThought: '', moveLog: [],
|
|
571
|
+
};
|
|
572
|
+
game.legalMoves = demoMoves(game);
|
|
573
|
+
return game;
|
|
574
|
+
}
|
|
575
|
+
var demoGame = demoNewGame(true);
|
|
576
|
+
|
|
577
|
+
makeDemoGezel({
|
|
578
|
+
page: { entry: 'board/index.html', typeName: 'Checkers' },
|
|
579
|
+
tools: {
|
|
580
|
+
user_move: function (input) {
|
|
581
|
+
var move = demoGame.legalMoves.find(function (m) { return m.from === input.from && m.to === input.to; });
|
|
582
|
+
if (!move) throw new Error('That move is not available in the hot-seat demo.');
|
|
583
|
+
var next = demoGame.squares;
|
|
584
|
+
for (var i = 1; i < move.path.length; i += 1) next = applyPreviewHop(next, move.path[i - 1], move.path[i]);
|
|
585
|
+
demoGame.squares = next;
|
|
586
|
+
demoGame.lastMove = { by: demoGame.turn, from: move.from, to: move.to };
|
|
587
|
+
demoGame.moveLog.push({ by: demoGame.turn, from: move.from, to: move.to, captures: move.captures.slice() });
|
|
588
|
+
demoGame.turn = demoGame.turn === 'user' ? 'ai' : 'user';
|
|
589
|
+
demoGame.legalMoves = demoMoves(demoGame);
|
|
590
|
+
if (demoGame.legalMoves.length === 0) demoGame.status = demoGame.turn === 'user' ? 'ai_won' : 'user_won';
|
|
591
|
+
return { status: demoGame.status, turn: demoGame.turn, summary: 'Move played.' };
|
|
592
|
+
},
|
|
593
|
+
new_game: function (input) {
|
|
594
|
+
demoGame = demoNewGame(input && input.forceCaptures);
|
|
595
|
+
return { status: demoGame.status, turn: demoGame.turn, summary: 'New game.' };
|
|
596
|
+
},
|
|
597
|
+
},
|
|
598
|
+
data: {
|
|
599
|
+
'game.json': function () { return demoGame; },
|
|
600
|
+
},
|
|
601
|
+
});
|
|
602
|
+
|
|
603
|
+
// ── one code path from here: window.gezel exists in every mode ──
|
|
604
|
+
var demoMode = gezel.page.mode === 'demo';
|
|
605
|
+
var browserMode = gezel.page.mode === 'browser';
|
|
606
|
+
|
|
607
|
+
function applyTheme(mode) {
|
|
608
|
+
document.documentElement.setAttribute('data-theme', mode === 'dark' ? 'dark' : 'light');
|
|
609
|
+
}
|
|
610
|
+
applyTheme(gezel.ui.theme.mode);
|
|
611
|
+
gezel.ui.onTheme(function (theme) { applyTheme(theme.mode); });
|
|
612
|
+
|
|
613
|
+
if (demoMode) document.querySelector('[data-gezel-demo-banner]').hidden = false;
|
|
614
|
+
if (browserMode) document.getElementById('browser-note').hidden = false;
|
|
615
|
+
|
|
616
|
+
var state = null;
|
|
617
|
+
var selected = null;
|
|
618
|
+
var moveOrigin = null;
|
|
619
|
+
var movePath = [];
|
|
620
|
+
var previewSquares = null;
|
|
621
|
+
var animationSquares = null;
|
|
622
|
+
var busy = false;
|
|
623
|
+
var animating = false;
|
|
624
|
+
var suppressClickUntil = 0;
|
|
625
|
+
var newGameForceCaptures = true;
|
|
626
|
+
|
|
627
|
+
function squaresForRender() {
|
|
628
|
+
return previewSquares || animationSquares || (state && state.squares) || '.'.repeat(64);
|
|
629
|
+
}
|
|
630
|
+
function resetMovePreview() {
|
|
631
|
+
selected = null;
|
|
632
|
+
moveOrigin = null;
|
|
633
|
+
movePath = [];
|
|
634
|
+
previewSquares = null;
|
|
635
|
+
}
|
|
636
|
+
function beginMove(name) {
|
|
637
|
+
selected = name;
|
|
638
|
+
moveOrigin = name;
|
|
639
|
+
movePath = [name];
|
|
640
|
+
previewSquares = null;
|
|
641
|
+
}
|
|
642
|
+
function matchingMoves() {
|
|
643
|
+
if (!state || !moveOrigin || movePath.length === 0) return [];
|
|
644
|
+
return state.legalMoves.filter(function (move) {
|
|
645
|
+
if (move.from !== moveOrigin || move.path.length < movePath.length) return false;
|
|
646
|
+
for (var i = 0; i < movePath.length; i += 1) {
|
|
647
|
+
if (move.path[i] !== movePath[i]) return false;
|
|
648
|
+
}
|
|
649
|
+
return true;
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
function currentHints() {
|
|
653
|
+
var hints = {};
|
|
654
|
+
matchingMoves().forEach(function (move) {
|
|
655
|
+
var landing = move.path[movePath.length];
|
|
656
|
+
if (!landing) return;
|
|
657
|
+
if (!hints[landing]) hints[landing] = [];
|
|
658
|
+
hints[landing].push(move);
|
|
659
|
+
});
|
|
660
|
+
return hints;
|
|
661
|
+
}
|
|
662
|
+
function originMap() {
|
|
663
|
+
var origins = {};
|
|
664
|
+
if (!state) return origins;
|
|
665
|
+
if (movePath.length > 1 && selected) {
|
|
666
|
+
origins[selected] = true;
|
|
667
|
+
return origins;
|
|
668
|
+
}
|
|
669
|
+
state.legalMoves.forEach(function (move) { origins[move.from] = true; });
|
|
670
|
+
return origins;
|
|
671
|
+
}
|
|
672
|
+
function esc(s) {
|
|
673
|
+
return String(s).replace(/[&<>"]/g, function (c) {
|
|
674
|
+
return { '&': '&', '<': '<', '>': '>', '"': '"' }[c];
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
function setBanner(text) {
|
|
679
|
+
var el = document.getElementById('banner');
|
|
680
|
+
el.textContent = text || '';
|
|
681
|
+
el.className = text ? 'banner show' : 'banner';
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
function invokeErrorText(err) {
|
|
685
|
+
if (err && err.code === 'unavailable') {
|
|
686
|
+
return "Moves happen in the app's Output pane — this browser tab stays view-only.";
|
|
687
|
+
}
|
|
688
|
+
return String(err && err.message ? err.message : err);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
function statusLine() {
|
|
692
|
+
if (!state) return 'Setting up the board…';
|
|
693
|
+
if (demoMode && state.status === 'playing') {
|
|
694
|
+
var demoCaps = state.legalMoves.some(function (m) { return m.captures.length > 0; });
|
|
695
|
+
return 'Hot seat — ' + (state.turn === 'user' ? 'red' : 'black') + ' to move' + (demoCaps ? ' (capture available).' : '.');
|
|
696
|
+
}
|
|
697
|
+
if (demoMode && state.status === 'user_won') return 'Red wins the hot-seat demo.';
|
|
698
|
+
if (demoMode && state.status === 'ai_won') return 'Black wins the hot-seat demo.';
|
|
699
|
+
if (state.status === 'user_won') return 'You won! A gracious rematch awaits.';
|
|
700
|
+
if (state.status === 'ai_won') return 'The checkers player takes this one — rematch?';
|
|
701
|
+
if (animating) return 'Piece in motion…';
|
|
702
|
+
if (busy) return 'Sending your move…';
|
|
703
|
+
if (movePath.length > 1) return 'Keep jumping — choose the next landing square.';
|
|
704
|
+
if (state.turn === 'ai') return 'Checkers player is thinking…';
|
|
705
|
+
var caps = state.legalMoves.some(function (m) { return m.captures.length > 0; });
|
|
706
|
+
if (caps && state.forceCaptures !== false) {
|
|
707
|
+
return 'Your move — a capture is available (captures are forced).';
|
|
708
|
+
}
|
|
709
|
+
if (caps) return 'Your move — a capture is available, but optional.';
|
|
710
|
+
return state.forceCaptures === false ? 'Your move — captures are optional.' : 'Your move.';
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
function render() {
|
|
714
|
+
document.getElementById('status').innerHTML =
|
|
715
|
+
state && !demoMode && state.turn === 'ai' && state.status === 'playing'
|
|
716
|
+
? '<span class="thinking">' + esc(statusLine()) + '</span>'
|
|
717
|
+
: esc(statusLine());
|
|
718
|
+
|
|
719
|
+
var moveThoughtPanel = document.getElementById('moveThought-panel');
|
|
720
|
+
if (state && state.lastMoveThought) {
|
|
721
|
+
moveThoughtPanel.hidden = false;
|
|
722
|
+
document.getElementById('moveThought').textContent = state.lastMoveThought;
|
|
723
|
+
} else {
|
|
724
|
+
moveThoughtPanel.hidden = true;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
var log = document.getElementById('log');
|
|
728
|
+
if (state && state.moveLog.length) {
|
|
729
|
+
log.innerHTML = state.moveLog
|
|
730
|
+
.slice(-8)
|
|
731
|
+
.map(function (m, i, arr) {
|
|
732
|
+
var text = (m.by === 'user' ? 'Red ' : 'Black ') + m.from +
|
|
733
|
+
(m.captures.length ? 'x' : '-') + m.to;
|
|
734
|
+
return '<li' + (i === arr.length - 1 ? ' class="latest"' : '') + '>' + esc(text) + '</li>';
|
|
735
|
+
})
|
|
736
|
+
.join('');
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
var board = document.getElementById('board');
|
|
740
|
+
board.innerHTML = '';
|
|
741
|
+
if (!state) return;
|
|
742
|
+
var myTurn = (demoMode || state.turn === 'user') && state.status === 'playing' && !busy && !animating;
|
|
743
|
+
var origins = myTurn ? originMap() : {};
|
|
744
|
+
var hints = myTurn && selected ? currentHints() : {};
|
|
745
|
+
var shownSquares = squaresForRender();
|
|
746
|
+
for (var y = 0; y < 8; y += 1) {
|
|
747
|
+
for (var x = 0; x < 8; x += 1) {
|
|
748
|
+
(function (x, y) {
|
|
749
|
+
var name = sqName(x, y);
|
|
750
|
+
var ch = shownSquares[y * 8 + x];
|
|
751
|
+
var dark = (x + y) % 2 === 1;
|
|
752
|
+
var cell = document.createElement('div');
|
|
753
|
+
cell.dataset.square = name;
|
|
754
|
+
var cls = 'cell ' + (dark ? 'dark' : 'light');
|
|
755
|
+
if (name === selected) cls += ' selected';
|
|
756
|
+
if (hints[name]) cls += ' hint';
|
|
757
|
+
if (myTurn && origins[name]) cls += ' selectable';
|
|
758
|
+
if (!previewSquares && !animationSquares && state.lastMove) {
|
|
759
|
+
if (name === state.lastMove.to) cls += ' last-move';
|
|
760
|
+
if (name === state.lastMove.from) cls += ' last-move-from';
|
|
761
|
+
}
|
|
762
|
+
cell.className = cls;
|
|
763
|
+
var coord = document.createElement('span');
|
|
764
|
+
coord.className = 'coord';
|
|
765
|
+
coord.textContent = name.toUpperCase();
|
|
766
|
+
coord.setAttribute('aria-hidden', 'true');
|
|
767
|
+
cell.appendChild(coord);
|
|
768
|
+
if (ch !== '.') {
|
|
769
|
+
var piece = document.createElement('div');
|
|
770
|
+
var red = ch === 'r' || ch === 'R';
|
|
771
|
+
piece.className = 'piece ' + (red ? 'red' : 'black');
|
|
772
|
+
if (ch === 'R' || ch === 'B') {
|
|
773
|
+
piece.className += ' king';
|
|
774
|
+
piece.textContent = 'K';
|
|
775
|
+
}
|
|
776
|
+
if (myTurn && origins[name]) {
|
|
777
|
+
piece.className += ' draggable';
|
|
778
|
+
enablePieceDrag(piece, name);
|
|
779
|
+
}
|
|
780
|
+
cell.appendChild(piece);
|
|
781
|
+
}
|
|
782
|
+
cell.addEventListener('click', function () {
|
|
783
|
+
if (!myTurn || Date.now() < suppressClickUntil) return;
|
|
784
|
+
if (hints[name]) {
|
|
785
|
+
playLanding(name);
|
|
786
|
+
} else if (origins[name]) {
|
|
787
|
+
if (selected === name && movePath.length <= 1) resetMovePreview();
|
|
788
|
+
else beginMove(name);
|
|
789
|
+
render();
|
|
790
|
+
} else if (selected && movePath.length <= 1) {
|
|
791
|
+
resetMovePreview();
|
|
792
|
+
render();
|
|
793
|
+
}
|
|
794
|
+
});
|
|
795
|
+
board.appendChild(cell);
|
|
796
|
+
})(x, y);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
function prefersReducedMotion() {
|
|
802
|
+
return window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
function capturedSquare(from, to) {
|
|
806
|
+
var start = parseSquare(from);
|
|
807
|
+
var end = parseSquare(to);
|
|
808
|
+
if (Math.abs(start.x - end.x) !== 2) return null;
|
|
809
|
+
return sqName((start.x + end.x) / 2, (start.y + end.y) / 2);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
function animateHop(from, to) {
|
|
813
|
+
if (prefersReducedMotion()) return Promise.resolve();
|
|
814
|
+
var board = document.getElementById('board');
|
|
815
|
+
var sourceCell = board.querySelector('[data-square="' + from + '"]');
|
|
816
|
+
var targetCell = board.querySelector('[data-square="' + to + '"]');
|
|
817
|
+
var sourcePiece = sourceCell && sourceCell.querySelector('.piece');
|
|
818
|
+
if (!sourcePiece || !targetCell) return Promise.resolve();
|
|
819
|
+
|
|
820
|
+
var boardRect = board.getBoundingClientRect();
|
|
821
|
+
var sourceRect = sourcePiece.getBoundingClientRect();
|
|
822
|
+
var targetRect = targetCell.getBoundingClientRect();
|
|
823
|
+
var clone = sourcePiece.cloneNode(true);
|
|
824
|
+
clone.classList.remove('draggable', 'dragging', 'move-source');
|
|
825
|
+
clone.classList.add('moving-piece');
|
|
826
|
+
clone.style.left = sourceRect.left - boardRect.left + 'px';
|
|
827
|
+
clone.style.top = sourceRect.top - boardRect.top + 'px';
|
|
828
|
+
clone.style.width = sourceRect.width + 'px';
|
|
829
|
+
clone.style.height = sourceRect.height + 'px';
|
|
830
|
+
board.appendChild(clone);
|
|
831
|
+
sourcePiece.classList.add('move-source');
|
|
832
|
+
|
|
833
|
+
var dx = targetRect.left + targetRect.width / 2 - (sourceRect.left + sourceRect.width / 2);
|
|
834
|
+
var dy = targetRect.top + targetRect.height / 2 - (sourceRect.top + sourceRect.height / 2);
|
|
835
|
+
var turn = dx >= 0 ? 5 : -5;
|
|
836
|
+
var motion = clone.animate(
|
|
837
|
+
[
|
|
838
|
+
{ transform: 'translate(0, 0) rotate(0deg) scale(1)' },
|
|
839
|
+
{ transform: 'translate(' + dx * 0.55 + 'px, ' + dy * 0.55 + 'px) rotate(' + turn + 'deg) scale(1.1)', offset: 0.55 },
|
|
840
|
+
{ transform: 'translate(' + dx + 'px, ' + dy + 'px) rotate(0deg) scale(1)' },
|
|
841
|
+
],
|
|
842
|
+
{ duration: 320, easing: 'cubic-bezier(.2,.76,.25,1)' },
|
|
843
|
+
);
|
|
844
|
+
|
|
845
|
+
var capture = capturedSquare(from, to);
|
|
846
|
+
var capturedPiece = capture && board.querySelector('[data-square="' + capture + '"] .piece');
|
|
847
|
+
var captureFinished = Promise.resolve();
|
|
848
|
+
if (capturedPiece) {
|
|
849
|
+
var captureMotion = capturedPiece.animate(
|
|
850
|
+
[
|
|
851
|
+
{ transform: 'scale(1)', opacity: 1 },
|
|
852
|
+
{ transform: 'scale(0.72) rotate(7deg)', opacity: 0 },
|
|
853
|
+
],
|
|
854
|
+
{ duration: 190, delay: 100, easing: 'ease-in' },
|
|
855
|
+
);
|
|
856
|
+
captureFinished = captureMotion.finished.catch(function () {});
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
return Promise.all([motion.finished.catch(function () {}), captureFinished]).then(function () {
|
|
860
|
+
clone.remove();
|
|
861
|
+
sourcePiece.classList.remove('move-source');
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
function paintCurrentMove() {
|
|
866
|
+
var board = document.getElementById('board');
|
|
867
|
+
Array.prototype.forEach.call(board.querySelectorAll('.cell.selected, .cell.hint'), function (cell) {
|
|
868
|
+
cell.classList.remove('selected', 'hint');
|
|
869
|
+
});
|
|
870
|
+
if (selected) {
|
|
871
|
+
var selectedCell = board.querySelector('[data-square="' + selected + '"]');
|
|
872
|
+
if (selectedCell) selectedCell.classList.add('selected');
|
|
873
|
+
}
|
|
874
|
+
var hints = currentHints();
|
|
875
|
+
Object.keys(hints).forEach(function (name) {
|
|
876
|
+
var cell = board.querySelector('[data-square="' + name + '"]');
|
|
877
|
+
if (cell) cell.classList.add('hint');
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
function landingAtPoint(piece, x, y) {
|
|
882
|
+
var oldPointerEvents = piece.style.pointerEvents;
|
|
883
|
+
piece.style.pointerEvents = 'none';
|
|
884
|
+
var hit = document.elementFromPoint(x, y);
|
|
885
|
+
piece.style.pointerEvents = oldPointerEvents;
|
|
886
|
+
var cell = hit && hit.closest ? hit.closest('.cell') : null;
|
|
887
|
+
var name = cell && cell.dataset.square;
|
|
888
|
+
return name && currentHints()[name] ? name : null;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
function nearestThrownLanding(x, y, vx, vy) {
|
|
892
|
+
var speed = Math.sqrt(vx * vx + vy * vy);
|
|
893
|
+
if (speed < 0.18) return null;
|
|
894
|
+
var travel = Math.min(100, speed * 105);
|
|
895
|
+
var px = x + (vx / speed) * travel;
|
|
896
|
+
var py = y + (vy / speed) * travel;
|
|
897
|
+
var best = null;
|
|
898
|
+
var bestDistance = Infinity;
|
|
899
|
+
Object.keys(currentHints()).forEach(function (name) {
|
|
900
|
+
var cell = document.querySelector('[data-square="' + name + '"]');
|
|
901
|
+
if (!cell) return;
|
|
902
|
+
var rect = cell.getBoundingClientRect();
|
|
903
|
+
var cx = rect.left + rect.width / 2;
|
|
904
|
+
var cy = rect.top + rect.height / 2;
|
|
905
|
+
var distance = Math.sqrt((cx - px) * (cx - px) + (cy - py) * (cy - py));
|
|
906
|
+
if (distance < bestDistance && distance < rect.width * 0.9) {
|
|
907
|
+
best = name;
|
|
908
|
+
bestDistance = distance;
|
|
909
|
+
}
|
|
910
|
+
});
|
|
911
|
+
return best;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
function enablePieceDrag(piece, name) {
|
|
915
|
+
piece.addEventListener('pointerdown', function (event) {
|
|
916
|
+
if (event.button !== 0 || busy || animating) return;
|
|
917
|
+
var start = { x: event.clientX, y: event.clientY, at: event.timeStamp };
|
|
918
|
+
var previous = start;
|
|
919
|
+
var last = start;
|
|
920
|
+
var moved = false;
|
|
921
|
+
piece.setPointerCapture(event.pointerId);
|
|
922
|
+
|
|
923
|
+
function onMove(moveEvent) {
|
|
924
|
+
var dx = moveEvent.clientX - start.x;
|
|
925
|
+
var dy = moveEvent.clientY - start.y;
|
|
926
|
+
if (!moved && Math.sqrt(dx * dx + dy * dy) < 4) return;
|
|
927
|
+
if (!moved) {
|
|
928
|
+
moved = true;
|
|
929
|
+
if (movePath.length <= 1 && moveOrigin !== name) beginMove(name);
|
|
930
|
+
paintCurrentMove();
|
|
931
|
+
piece.classList.add('dragging');
|
|
932
|
+
}
|
|
933
|
+
previous = last;
|
|
934
|
+
last = { x: moveEvent.clientX, y: moveEvent.clientY, at: moveEvent.timeStamp };
|
|
935
|
+
piece.style.transform =
|
|
936
|
+
'translate(' + dx + 'px, ' + dy + 'px) rotate(' + dx * 0.035 + 'deg) scale(1.06)';
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
function onEnd(endEvent) {
|
|
940
|
+
piece.removeEventListener('pointermove', onMove);
|
|
941
|
+
piece.removeEventListener('pointerup', onEnd);
|
|
942
|
+
piece.removeEventListener('pointercancel', onEnd);
|
|
943
|
+
try { piece.releasePointerCapture(event.pointerId); } catch (_) {}
|
|
944
|
+
if (!moved) return;
|
|
945
|
+
|
|
946
|
+
// Swallow only the synthetic click emitted with this drag;
|
|
947
|
+
// the next deliberate hop should be available immediately.
|
|
948
|
+
suppressClickUntil = Date.now() + 80;
|
|
949
|
+
var elapsed = Math.max(1, last.at - previous.at);
|
|
950
|
+
var vx = (last.x - previous.x) / elapsed;
|
|
951
|
+
var vy = (last.y - previous.y) / elapsed;
|
|
952
|
+
var landing = landingAtPoint(piece, endEvent.clientX, endEvent.clientY) ||
|
|
953
|
+
nearestThrownLanding(endEvent.clientX, endEvent.clientY, vx, vy);
|
|
954
|
+
var currentTransform = piece.style.transform;
|
|
955
|
+
piece.classList.remove('dragging');
|
|
956
|
+
piece.style.transform = '';
|
|
957
|
+
if (landing) {
|
|
958
|
+
playLanding(landing);
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
var rebound = piece.animate(
|
|
963
|
+
[
|
|
964
|
+
{ transform: currentTransform },
|
|
965
|
+
{ transform: 'translate(0, 0) rotate(0deg) scale(1)' },
|
|
966
|
+
],
|
|
967
|
+
{ duration: 180, easing: 'cubic-bezier(.2,.8,.3,1)' },
|
|
968
|
+
);
|
|
969
|
+
rebound.finished.catch(function () {}).then(render);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
piece.addEventListener('pointermove', onMove);
|
|
973
|
+
piece.addEventListener('pointerup', onEnd);
|
|
974
|
+
piece.addEventListener('pointercancel', onEnd);
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
function playLanding(landing) {
|
|
979
|
+
var candidates = currentHints()[landing];
|
|
980
|
+
if (!candidates || !selected || busy || animating) return;
|
|
981
|
+
var from = selected;
|
|
982
|
+
var before = squaresForRender();
|
|
983
|
+
animating = true;
|
|
984
|
+
document.getElementById('status').textContent = statusLine();
|
|
985
|
+
animateHop(from, landing).then(function () {
|
|
986
|
+
previewSquares = applyPreviewHop(before, from, landing);
|
|
987
|
+
movePath.push(landing);
|
|
988
|
+
selected = landing;
|
|
989
|
+
animating = false;
|
|
990
|
+
var remaining = matchingMoves();
|
|
991
|
+
var hasNext = remaining.some(function (move) { return move.path.length > movePath.length; });
|
|
992
|
+
if (hasNext) {
|
|
993
|
+
render();
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
996
|
+
var complete = remaining.find(function (move) { return move.path.length === movePath.length; });
|
|
997
|
+
if (!complete) {
|
|
998
|
+
resetMovePreview();
|
|
999
|
+
setBanner('That jump sequence is no longer available. Please choose again.');
|
|
1000
|
+
render();
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
1003
|
+
submitMove(complete);
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
function submitMove(move) {
|
|
1008
|
+
busy = true;
|
|
1009
|
+
render();
|
|
1010
|
+
gezel.tools
|
|
1011
|
+
.invoke('user_move', { from: move.from, to: move.to })
|
|
1012
|
+
.then(function (res) {
|
|
1013
|
+
busy = false;
|
|
1014
|
+
if (res.reaction && res.reaction.delivered === false && res.reaction.reason === 'engagement-off') {
|
|
1015
|
+
setBanner('Move played — but the AI is off in Settings, so the checkers player cannot reply.');
|
|
1016
|
+
}
|
|
1017
|
+
return loadGame();
|
|
1018
|
+
})
|
|
1019
|
+
.catch(function (err) {
|
|
1020
|
+
busy = false;
|
|
1021
|
+
resetMovePreview();
|
|
1022
|
+
setBanner(invokeErrorText(err));
|
|
1023
|
+
render();
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
function animateServerMove(sequence, next) {
|
|
1028
|
+
animating = true;
|
|
1029
|
+
resetMovePreview();
|
|
1030
|
+
animationSquares = state.squares;
|
|
1031
|
+
render();
|
|
1032
|
+
var index = 1;
|
|
1033
|
+
|
|
1034
|
+
function nextHop() {
|
|
1035
|
+
if (index >= sequence.path.length) return Promise.resolve();
|
|
1036
|
+
var from = sequence.path[index - 1];
|
|
1037
|
+
var to = sequence.path[index];
|
|
1038
|
+
return animateHop(from, to).then(function () {
|
|
1039
|
+
animationSquares = applyPreviewHop(animationSquares, from, to);
|
|
1040
|
+
index += 1;
|
|
1041
|
+
render();
|
|
1042
|
+
return nextHop();
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
return nextHop().then(function () {
|
|
1047
|
+
animationSquares = null;
|
|
1048
|
+
state = next;
|
|
1049
|
+
animating = false;
|
|
1050
|
+
render();
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
function syncCaptureChoice() {
|
|
1055
|
+
Array.prototype.forEach.call(document.querySelectorAll('.rule-key'), function (button) {
|
|
1056
|
+
button.setAttribute(
|
|
1057
|
+
'aria-checked',
|
|
1058
|
+
String((button.dataset.forceCaptures === 'true') === newGameForceCaptures),
|
|
1059
|
+
);
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
function openNewGameDialog() {
|
|
1064
|
+
if (busy || animating) return;
|
|
1065
|
+
newGameForceCaptures = !state || state.forceCaptures !== false;
|
|
1066
|
+
syncCaptureChoice();
|
|
1067
|
+
document.getElementById('new-game-dialog').showModal();
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
function newGame(forceCaptures) {
|
|
1071
|
+
resetMovePreview();
|
|
1072
|
+
animationSquares = null;
|
|
1073
|
+
busy = true;
|
|
1074
|
+
render();
|
|
1075
|
+
gezel.tools
|
|
1076
|
+
.invoke('new_game', { forceCaptures: forceCaptures })
|
|
1077
|
+
.then(function () {
|
|
1078
|
+
busy = false;
|
|
1079
|
+
setBanner('');
|
|
1080
|
+
return loadGame();
|
|
1081
|
+
})
|
|
1082
|
+
.catch(function (err) {
|
|
1083
|
+
busy = false;
|
|
1084
|
+
setBanner(invokeErrorText(err));
|
|
1085
|
+
render();
|
|
1086
|
+
});
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
function transitionState(next) {
|
|
1090
|
+
if (!state) {
|
|
1091
|
+
state = next;
|
|
1092
|
+
resetMovePreview();
|
|
1093
|
+
render();
|
|
1094
|
+
return Promise.resolve();
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
var addedMove = next.moveLog.length > state.moveLog.length;
|
|
1098
|
+
if (!addedMove) {
|
|
1099
|
+
state = next;
|
|
1100
|
+
render();
|
|
1101
|
+
return Promise.resolve();
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
if (previewSquares) {
|
|
1105
|
+
state = next;
|
|
1106
|
+
resetMovePreview();
|
|
1107
|
+
render();
|
|
1108
|
+
return Promise.resolve();
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
var last = next.lastMove;
|
|
1112
|
+
if (last && last.by === 'ai') {
|
|
1113
|
+
var sequence = state.legalMoves.find(function (move) {
|
|
1114
|
+
return move.from === last.from && move.to === last.to;
|
|
1115
|
+
});
|
|
1116
|
+
if (sequence) return animateServerMove(sequence, next);
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
state = next;
|
|
1120
|
+
resetMovePreview();
|
|
1121
|
+
render();
|
|
1122
|
+
return Promise.resolve();
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
// Reads are serialized so a watch change landing mid-animation
|
|
1126
|
+
// cannot start a second transition from stale state.
|
|
1127
|
+
var loading = Promise.resolve();
|
|
1128
|
+
function loadGame() {
|
|
1129
|
+
loading = loading.then(function () {
|
|
1130
|
+
return gezel.data.read('game.json').then(
|
|
1131
|
+
function (next) { return transitionState(next); },
|
|
1132
|
+
function () {},
|
|
1133
|
+
);
|
|
1134
|
+
});
|
|
1135
|
+
return loading;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
Array.prototype.forEach.call(document.querySelectorAll('.rule-key'), function (button) {
|
|
1139
|
+
button.addEventListener('click', function () {
|
|
1140
|
+
newGameForceCaptures = button.dataset.forceCaptures === 'true';
|
|
1141
|
+
syncCaptureChoice();
|
|
1142
|
+
});
|
|
1143
|
+
});
|
|
1144
|
+
document.getElementById('newgame').addEventListener('click', openNewGameDialog);
|
|
1145
|
+
document.getElementById('cancel-new-game').addEventListener('click', function () {
|
|
1146
|
+
document.getElementById('new-game-dialog').close();
|
|
1147
|
+
});
|
|
1148
|
+
document.getElementById('start-new-game').addEventListener('click', function () {
|
|
1149
|
+
document.getElementById('new-game-dialog').close();
|
|
1150
|
+
newGame(newGameForceCaptures);
|
|
1151
|
+
});
|
|
1152
|
+
|
|
1153
|
+
loadGame();
|
|
1154
|
+
gezel.data.watch('game.json', function () { loadGame(); });
|
|
1155
|
+
})();
|
|
1156
|
+
</script>
|
|
1157
|
+
</body>
|
|
1158
|
+
</html>
|