Files
tp/main_dc/yalarba/easySite/app/components/ImageGallery.vue
T
valitovgaziz 2941b14b38 flatten easySite directory: remove extra easySite/easySite nesting
- Moved contents of main_dc/yalarba/easySite/easySite/ up to easySite/
- Updated docker-compose.yml build context path
- Deleted empty nested easySite/ directory
2026-06-12 11:16:15 +05:00

33 lines
1.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="gallery-overlay" @click="$emit('close')">
<div class="gallery-content" @click.stop>
<button class="gallery-close" @click="$emit('close')"></button>
<img :src="currentImage" :alt="`Image ${currentIndex + 1}`" class="gallery-image" >
<button class="gallery-nav prev" @click="prevImage"></button>
<button class="gallery-nav next" @click="nextImage"></button>
</div>
</div>
</template>
<script setup lang="ts">
const props = defineProps<{
images: string[]
initialIndex: number
}>()
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const emit = defineEmits<{
close: []
}>()
const currentIndex = ref(props.initialIndex)
const currentImage = computed(() => props.images[currentIndex.value])
const nextImage = () => {
currentIndex.value = (currentIndex.value + 1) % props.images.length
}
const prevImage = () => {
currentIndex.value = (currentIndex.value - 1 + props.images.length) % props.images.length
}
</script>