const AUTO_SCROLL_THRESHOLD = 50;
const MIN_SCROLL_SPEED = 5;
const MAX_SCROLL_SPEED = 25;
const calculateScrollSpeed = (distanceFromEdge) => {
  if (distanceFromEdge >= AUTO_SCROLL_THRESHOLD) return 0;
  const speedRatio = (AUTO_SCROLL_THRESHOLD - distanceFromEdge) / AUTO_SCROLL_THRESHOLD;
  const easedRatio = Math.pow(speedRatio, 2);
  return MIN_SCROLL_SPEED + (MAX_SCROLL_SPEED - MIN_SCROLL_SPEED) * easedRatio;
};

export { AUTO_SCROLL_THRESHOLD, MAX_SCROLL_SPEED, MIN_SCROLL_SPEED, calculateScrollSpeed };
