悄悄话抽屉:半屏往上划直接拉满
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -340,8 +340,8 @@
|
||||
/* 11-07 用户:「滑了一下又缩回去,要很大力气才上得去」→ 按方向判断:往上动过 24px(或甩一下)就往上一档,
|
||||
拖过半屏再往上就直接拉满;往下同理;只有几像素的小抖动才回原位 */
|
||||
var dy = e.changedTouches[0].clientY - dd.y, h = dd.base - dy, v = dy / Math.max(1, Date.now() - dd.t);
|
||||
if (dy < -24 || v < -.25) snap(state === 'full' || h > hFor('half') + 40 ? 'full' : 'half');
|
||||
else if (dy > 24 || v > .25) snap(state === 'closed' || h < hFor('half') - 40 ? 'closed' : 'half');
|
||||
if (dy < -24 || v < -.25) snap(state !== 'closed' || h > hFor('half') + 40 ? 'full' : 'half');
|
||||
else if (dy > 24 || v > .25) snap(state !== 'full' || h < hFor('half') - 40 ? 'closed' : 'half');
|
||||
else snap(state);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user