Skip to content

Commit

Permalink
Improved dragging to hide when cards have no image
Browse files Browse the repository at this point in the history
  • Loading branch information
Albermonte committed Sep 6, 2023
1 parent 1c6ad14 commit ce21874
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/atoms/SheetModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function onMove(event: PointerEvent) {
newProgress = Math.min(yDelta, heightDifference.value) / heightDifference.value
else
// Dragging down to close list
newProgress = Math.min(yDelta, heightDifference.value) / heightDifference.value
newProgress = Math.min(yDelta, initialHeight.value) / initialHeight.value
}
emit('update:progress', newProgress)
}
Expand Down Expand Up @@ -146,7 +146,7 @@ function onCardDrag(progress: number) {
style.value = {
height: isOpen.value ? 'min-content' : progress > 0 ? `${initialHeight.value + heightDifference.value * progress}px` : 'min-content',
// Set to -8 for closing list, -10 would be more "accurate" more -8 feels more natural
// Set to -6 for closing list, -8 would be more "accurate" more -6 feels more natural
marginBottom: `${(1 - (progress >= 0 ? progress : progress * -6)) * props.initialGapToScreen}px`,
borderBottomRightRadius: `${radius}px`,
borderBottomLeftRadius: `${radius}px`,
Expand Down

0 comments on commit ce21874

Please sign in to comment.