This is my sideThumbcomment feature . this.panos- the number of thumbs, and this.translateX- the number of pixels that are moved by the thumbs.
slideThumbs (direction) {
const thumbWidth = 160 + 6
const visibleThumbsWidth = thumbWidth * 5
const totalThumbsWidth = thumbWidth * (this.panos.length - 1)
if (direction === 'left' && this.translateX !== 0) {
this.translateX += visibleThumbsWidth
}
if (direction === 'right' && this.translateX !== -totalThumbsWidth) {
this.translateX -= visibleThumbsWidth
}
}
Final result:
transform: translate(-830px, 0px);
transform: translate(-1660px, 0px);
Setting the left arrow limit is simple: do not leave the function, if this.translateXany 0. It is harder to set the limit of the right arrow. The use is -totalThumbsWidthnot reliable, since the presence 11and 14panos should lead to the same result (allow the user to press the right arrow 2 times).

What is the best way to solve this problem?
EDIT:
Some math I did:
6 thumbs => can click right arrow 1 time
11 thumbs => can click right arrow 2 times
16 thumbs => can click right arrow 3 times
5 * x + 1 = 16 // this is how I get x in the third example
x = (this.panos.length - 1) / 5 // what to do with this?
I am sure I can use this in mathematical calculation.