Custom time controls

未关闭
#159 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
56/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript
领域
frontend, game-dev

调研方向

Start with js/config.js and index.html to see how the existing presets populate #clock-select, then follow the selection handling in js/main.js and clock startup in js/clock.js. Read tests/unit/clock.test.js and run npm ci && npm test to understand current validation. Done when custom controls persist across reloads, invalid values cannot start the clock, and the tests cover the new behavior; bounds and PGN formatting still need decisions.

由索引模型根据 Issue 内容生成。

描述

enhancement help wanted severity: low

Summary

The clock offers only five fixed presets (1+0, 3+2, 5+0, 10+0, 15+10). Common controls such as 3+0, 5+3 or 30+0, and odds games, cannot be chosen.

Where

  • js/config.js:18-25 (TIME_CONTROLS)
  • index.html:166 (#clock-select)

Proposal

Add a "Custom..." option to #clock-select that shows two number inputs (minutes, increment seconds), validated and stored as custom:M+I in the time-control setting. Optionally, a per-side minutes field for odds games.

Who benefits

Players who want a longer game, or an odds game against a stronger friend.

Open questions

  • Bounds (e.g. 1 to 180 minutes, 0 to 60 seconds increment).
  • How a custom control is written to the PGN TimeControl tag.

Acceptance criteria

  • A custom control is kept across reloads and validated by validateSavedGame
  • Invalid input cannot start a clock
  • Tests in tests/unit/clock.test.js

Getting started

  • Relevant files: js/config.js, js/main.js, js/clock.js, index.html
  • How to run tests: npm ci && npm test

Filed by repo-audit/full-audit at 73cd279. Severity: low. Effort: M. audit-key: enhancement|js/config.js|TIME_CONTROLS

主要语言
JavaScript
星标
4
派生
2
平均合并
22 小时 16 分钟
30 天内合并 PR
9

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TMHSDigital/Static_Chess 的其他 Issue

查看 TMHSDigital/Static_Chess 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。