for Quatrefoil calcit-js. This lib targets Chrome mobile.
Demo http://r.tiye.me/Quatrefoil-GL/touch-control/ .
Run these commands in a browser entry:
; "renders to body"
touch-control.core/render-control!
; "where you can get states"
println touch-control.core/*control-states
; create looper
touch-control.core/start-control-loop! 300 $ fn (elapsed states delta)
; clear loop on reload
touch-control.core/clear-control-loop!
; alias of clearing and createing
touch-control.core/replace-control-loop! 300 $ fn (elapsed states delta)
The callback receives a typed ControlState and ControlDelta. Their movement fields
contain two numbers:
let
move $ assert-type ([] 0 0) (Tuple Number Number)
delta $ touch-control.core/ControlDelta :left-move move :right-move move
assert= move $ :left-move deltaTo load styles:
npm i @quamolit/touch-control@import url("@quamolit/touch-control/style/touch-control.css");https://github.com/calcit-lang/respo-calcit-workflow
候选 0.0.40 使用正式 Calcit / @calcit/procs 0.42.1 和 JS FFI 0.2.13。使用 Calcit 0.37.0 的项目可继续使用 Touch Control 0.0.39。升级工具链后重新生成 JS。
ControlState 的 :left-move、:left-prev、:right-move、:right-prev,以及
ControlDelta 的 :left-move、:right-move,从 List Number 收紧为
Tuple Number Number。运行时仍是两个数字组成的列表。直接构造这两个结构时,
位移字段需要满足定长元组检查。PointerEventHost、控制回调、按钮、Shift、方向盘和循环清理行为沿用。
Validate the exact toolchain, Snapshot, public types, unit behavior, and production bundle with:
caps --strict --ci
yarn install --immutable
caps verify --toolchain
calcit calcit.cirru edit format
calcit calcit.cirru fix --workflow strict --verify --format json > /tmp/touch-control-strict.json
jq -e '.data.workflow.status == "passed" and (.diagnostics | length == 0)' /tmp/touch-control-strict.json
calcit calcit.cirru --check-only --all-defs
calcit calcit.cirru test --tag unit --require-match --summary-only --format json
yarn buildyarn dev 启动演示,另一个终端运行 yarn watch 监听 Calcit;yarn release
仅为构建别名,不发布模块。只维护 calcit.cirru / deps.cirru,不提交 js-out/。
生产前端通过 VITE_BASE_URL=https://cos-sh.tiye.me/Triadica/touch-control/ 构建,
COS action 的 public-base-url 提供内置内容校验,不增加额外上传验证脚本。
配置 COS_BUCKET、COS_SECRET_ID、COS_SECRET_KEY 和原 rsync_private_key。
原服务器目录和固定 SSH 主机密钥校验保持不变;PR 不上传 COS 或部署服务器,只保留 7 天的 dist / js-out 构建 artifact,用于 Demo 和公开 API 交互验收,不包含凭据,也不将生成文件提交到 Git。
生产任务开始上传前检查 main revision,随后串行完成该 revision 的 COS 和服务器部署;
期间新提交排队,不中途取消,也不承诺与 main 原子同步。
MIT