yifaneye / react-gallery-carousel

Carousel component 🎠🎠🎠 supporting touch, mouse, keyboard, thumbnails, fullscreen, lazy loading, SSR and customisations. 👉 Live editor: https://yifanai.com/rgcd1
https://yifanai.com/rgc
MIT License
215 stars 30 forks source link

Allow thumbnails to be at the side #55

Closed KMouratidis closed 2 years ago

KMouratidis commented 3 years ago

Is your feature request related to a problem? Please describe. I'm trying to move the thumbnails from the bottom to the right, like the image below which I did by modifying the CSS, but the problem is that mouse events (useMouse/useMouseDrag ?) only work on the X direction.

Describe the solution you'd like Allow a new prop (orientation?) to be passed to mouse event handers (possibly separate for thumbnails and images).

Describe alternatives you've considered None, not sure what I could try.

Additional context

What I want to do: image

CSS, roughly:

<thumbnail> ul {
  display: flex;
  flex-direction: column;
}

<thumbnail> ul li {
  min-width: 100%;
  min-height: 10%;
}
yifaneye commented 3 years ago

Hi @KMouratidis ! Thanks for raising this issue up! 😀

I agree that you can override the CSS but you can not do much on the event listeners. So you would like to have the thumbnails be placed vertically and be scrolled vertically right?

KMouratidis commented 3 years ago

Yes, that's what I wanted to do. I did try messing with the X/Ys a little but couldn't get it to work (being a JS newbie). If you don't have the time, I don't mind giving it another try later this month.

yifaneye commented 3 years ago

@KMouratidis Thanks for the clarification. I am happy to have a look at this month.

yifaneye commented 3 years ago

Hi @KMouratidis ! There was a lot of logic done on the thumbnails to allow them to be scrolled horizontally with "inertia" and to center the thumbnail of the currently active slide. So, allowing the thumbnails to be at the side is simple, but the logic will not work anymore. Free feel to have a try! 😀