Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions components/BookCoverCarousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<UModal
v-model:open="isModalOpen"
:ui="{
content: 'max-w-4xl bg-black',
content: 'relative max-w-4xl bg-black',
}"
:close="{ color: 'neutral', variant: 'ghost', class: 'text-white' }"
>
Expand Down Expand Up @@ -91,6 +91,25 @@
playsinline
class="w-full max-h-[80vh]"
/>

<template v-if="carouselItems.length > 1">
<UButton
icon="i-material-symbols-chevron-left"
color="neutral"
variant="ghost"
aria-label="Previous"
class="absolute left-2 top-1/2 -translate-y-1/2 rounded-full bg-black/50 text-white hover:bg-black/70 cursor-pointer"
@click="navigateModal(-1)"
/>
<UButton
icon="i-material-symbols-chevron-right"
color="neutral"
variant="ghost"
aria-label="Next"
class="absolute right-2 top-1/2 -translate-y-1/2 rounded-full bg-black/50 text-white hover:bg-black/70 cursor-pointer"
@click="navigateModal(1)"
/>
Comment on lines +101 to +111
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cursor-pointer class is redundant for UButton components as buttons already have pointer cursor by default. This is a minor styling nit and doesn't affect functionality.

Copilot uses AI. Check for mistakes.
</template>
</template>
</UModal>
</div>
Expand Down Expand Up @@ -141,13 +160,20 @@ const props = defineProps({
})

const isModalOpen = ref(false)
const modalItem = ref<CarouselItem | null>(null)
const modalItemIndex = ref(0)
const modalItem = computed(() => carouselItems.value[modalItemIndex.value] || null)

function openModal(item: CarouselItem) {
modalItem.value = item
const index = carouselItems.value.indexOf(item)
modalItemIndex.value = index >= 0 ? index : 0
isModalOpen.value = true
}

function navigateModal(direction: number) {
const len = carouselItems.value.length
modalItemIndex.value = (modalItemIndex.value + direction + len) % len
}
Comment on lines +172 to +175
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding keyboard navigation support (ArrowLeft/ArrowRight keys) for improved accessibility and user experience. The PDFReader component (components/PDFReader.vue:571-593) implements keyboard navigation using event listeners. This would allow users to navigate through carousel items using keyboard shortcuts in addition to clicking the arrow buttons.

Copilot uses AI. Check for mistakes.

const carouselItems = computed<CarouselItem[]>(() => {
const items: CarouselItem[] = []

Expand Down
Loading