diff options
author | dan <dan.abramov@gmail.com> | 2024-11-13 21:13:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-13 21:13:07 +0000 |
commit | 4ca5267b98f0ef0b9a831f7e71ae05f9f138bbb2 (patch) | |
tree | 8ff126c62952f61832e78b184cb083d923ebd5d8 /src/view/com/lightbox/ImageViewing | |
parent | 3bab7f7540273a50501780b2f92076fbe41c8022 (diff) | |
download | voidsky-4ca5267b98f0ef0b9a831f7e71ae05f9f138bbb2.tar.zst |
[Lightbox] Small tweaks (#6301)
* Tweak lightbox springs * Speed up dismiss speed * Don't scroll to top while active lightbox * Make Android a bit faster
Diffstat (limited to 'src/view/com/lightbox/ImageViewing')
-rw-r--r-- | src/view/com/lightbox/ImageViewing/index.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/view/com/lightbox/ImageViewing/index.tsx b/src/view/com/lightbox/ImageViewing/index.tsx index ab8306b36..e9bc1523d 100644 --- a/src/view/com/lightbox/ImageViewing/index.tsx +++ b/src/view/com/lightbox/ImageViewing/index.tsx @@ -62,7 +62,7 @@ const EDGES = ? (['top', 'bottom', 'left', 'right'] satisfies Edge[]) : (['left', 'right'] satisfies Edge[]) // iOS, so no top/bottom safe area -const SLOW_SPRING = {stiffness: 120} +const SLOW_SPRING = {stiffness: isIOS ? 180 : 250} const FAST_SPRING = {stiffness: 700} export default function ImageViewRoot({ @@ -433,7 +433,7 @@ function LightboxImage({ if (openProgress.value !== 1 || isFlyingAway.value) { return } - if (Math.abs(e.velocityY) > 1000) { + if (Math.abs(e.velocityY) > 200) { isFlyingAway.value = true if (dismissSwipeTranslateY.value === 0) { // HACK: If the initial value is 0, withDecay() animation doesn't start. @@ -442,7 +442,7 @@ function LightboxImage({ } dismissSwipeTranslateY.value = withDecay({ velocity: e.velocityY, - velocityFactor: Math.max(3000 / Math.abs(e.velocityY), 1), // Speed up if it's too slow. + velocityFactor: Math.max(3500 / Math.abs(e.velocityY), 1), // Speed up if it's too slow. deceleration: 1, // Danger! This relies on the reaction below stopping it. }) } else { |