修复特殊节点反馈并强化跟手缩放和选关标题

This commit is contained in:
toshiocn
2026-10-23 12:06:53 +08:00
parent 1ff3a98e7a
commit 29887cb154
25 changed files with 233 additions and 31 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ export class Haptics{
const fallback=()=>{if(generation!==this.generation||request!==this.request||this.now()-sentAt>FEEDBACK.hapticGapMs||!this.enabled)return;this.graded=false;try{this.api.vibrateShort({fail(){}});}catch{}};
try{this.api.vibrateShort(this.graded?{type,fail:fallback}:{fail(){}});}catch{if(this.graded)fallback();}
}
play(kind){if(!['move','checkpoint','complete'].includes(kind))return;this.pulse(kind==='move'?'light':'medium',kind!=='move');
play(kind){if(!['move','undo','checkpoint','complete'].includes(kind))return;this.pulse(kind==='move'||kind==='undo'?'light':'medium',kind!=='move'&&kind!=='undo');
if(kind==='complete'&&this.enabled&&this.graded&&!this.preview&&typeof this.api?.vibrateShort==='function'){const generation=this.generation;const timer=this.later(()=>{this.timers.delete(timer);if(generation===this.generation&&this.graded)this.pulse('light',true);},FEEDBACK.completeHapticDelayMs);this.timers.add(timer);}
}
}