mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-25 17:24:48 +10:00
Carousel UI improvements (#258)
* make carousel pagination clickable * make carousel in game pages wrap around * make items in store fit the row when the filter menu is visible --------- Co-authored-by: udifogiel <udifogiel@proton.me>
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
<button
|
||||
v-for="(_, i) in amount"
|
||||
:key="i"
|
||||
@click="slideTo(i)"
|
||||
:class="[
|
||||
carousel.currentSlide == i ? 'bg-blue-600 w-6' : 'bg-zinc-700 w-3',
|
||||
'transition-all cursor-pointer h-2 rounded-full',
|
||||
carousel.currentSlide === i ? 'bg-blue-600 w-6' : 'bg-zinc-700 w-3',
|
||||
'transition-all cursor-pointer h-2 rounded-full'
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
@@ -18,8 +19,8 @@ const carousel = inject(injectCarousel)!;
|
||||
|
||||
const amount = carousel.maxSlide - carousel.minSlide + 1;
|
||||
|
||||
// function slideTo(index: number) {
|
||||
// const offsetIndex = index + carousel.minSlide;
|
||||
// carousel.nav.slideTo(offsetIndex);
|
||||
// }
|
||||
</script>
|
||||
function slideTo(index: number) {
|
||||
const offsetIndex = index + carousel.minSlide;
|
||||
carousel.nav.slideTo(offsetIndex);
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user