

    function getMousePosition(event) {
      const parentContainer = event.currentTarget
      const containerRect = parentContainer.getBoundingClientRect()
      let offset = Math.floor(event.clientX - containerRect.x - 8)
      offset = Math.min(Math.max(0, offset), containerRect.width - 16)

      const segment = (containerRect.width - 16) / 10
      const value = Math.round(offset / segment)
      offset = value * segment

      return { offset, value }
    }

    document.addEventListener('pointerup'