|
| 1 | +<script setup lang="ts"> |
| 2 | +import { Swiper, SwiperSlide } from 'swiper/vue'; |
| 3 | +import { Autoplay, Pagination, Navigation } from 'swiper/modules'; |
| 4 | +import { ChevronLeft, ChevronRight } from 'lucide-vue-next'; |
| 5 | +
|
| 6 | +import 'swiper/css'; |
| 7 | +import 'swiper/css/pagination'; |
| 8 | +import 'swiper/css/navigation'; |
| 9 | +
|
| 10 | +const modules = [Autoplay, Pagination, Navigation]; |
| 11 | +
|
| 12 | +const screenshots = [ |
| 13 | + '/screenshots/s1-0412.png', |
| 14 | + '/screenshots/s2-0412.png', |
| 15 | + '/screenshots/s3-0412.png', |
| 16 | + '/screenshots/s4-0412.png', |
| 17 | + '/screenshots/s5-0412.png', |
| 18 | + '/screenshots/s6-0412.png', |
| 19 | + '/screenshots/s7-0412.png', |
| 20 | + '/screenshots/s8-0412.png', |
| 21 | + '/screenshots/s9-0412.png', |
| 22 | + '/screenshots/s10-0412.png', |
| 23 | +]; |
| 24 | +</script> |
| 25 | + |
| 26 | +<template> |
| 27 | + <div class="carousel-section"> |
| 28 | + <Swiper |
| 29 | + :modules="modules" |
| 30 | + :slides-per-view="1" |
| 31 | + :space-between="16" |
| 32 | + :loop="true" |
| 33 | + :autoplay="{ delay: 4000, disableOnInteraction: false, pauseOnMouseEnter: true }" |
| 34 | + :pagination="{ clickable: true }" |
| 35 | + :navigation="{ nextEl: '.carousel-next', prevEl: '.carousel-prev' }" |
| 36 | + class="screenshots-swiper" |
| 37 | + > |
| 38 | + <SwiperSlide v-for="(src, idx) in screenshots" :key="idx"> |
| 39 | + <div class="slide-wrapper"> |
| 40 | + <img :src="src" :alt="`AQBot Screenshot ${idx + 1}`" loading="lazy" /> |
| 41 | + </div> |
| 42 | + </SwiperSlide> |
| 43 | + </Swiper> |
| 44 | + <button class="carousel-nav carousel-prev" aria-label="Previous slide"> |
| 45 | + <ChevronLeft :size="24" /> |
| 46 | + </button> |
| 47 | + <button class="carousel-nav carousel-next" aria-label="Next slide"> |
| 48 | + <ChevronRight :size="24" /> |
| 49 | + </button> |
| 50 | + </div> |
| 51 | +</template> |
| 52 | + |
| 53 | +<style scoped> |
| 54 | +.carousel-section { |
| 55 | + position: relative; |
| 56 | + max-width: 960px; |
| 57 | + margin: 40px auto 24px; |
| 58 | + padding: 0 24px; |
| 59 | + overflow: hidden; |
| 60 | +} |
| 61 | +
|
| 62 | +@media (min-width: 640px) { |
| 63 | + .carousel-section { |
| 64 | + padding: 0 48px; |
| 65 | + } |
| 66 | +} |
| 67 | +
|
| 68 | +@media (min-width: 960px) { |
| 69 | + .carousel-section { |
| 70 | + padding: 0 64px; |
| 71 | + } |
| 72 | +} |
| 73 | +
|
| 74 | +.screenshots-swiper { |
| 75 | + border-radius: 12px; |
| 76 | + overflow: hidden; |
| 77 | + padding-bottom: 40px; |
| 78 | +} |
| 79 | +
|
| 80 | +.slide-wrapper { |
| 81 | + border-radius: 12px; |
| 82 | + overflow: hidden; |
| 83 | + box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1); |
| 84 | + background: var(--vp-c-bg-soft); |
| 85 | + transition: transform 0.3s ease, box-shadow 0.3s ease; |
| 86 | +} |
| 87 | +
|
| 88 | +.slide-wrapper:hover { |
| 89 | + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); |
| 90 | +} |
| 91 | +
|
| 92 | +.dark .slide-wrapper { |
| 93 | + box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3); |
| 94 | +} |
| 95 | +.dark .slide-wrapper:hover { |
| 96 | + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); |
| 97 | +} |
| 98 | +
|
| 99 | +.slide-wrapper img { |
| 100 | + width: 100%; |
| 101 | + height: auto; |
| 102 | + display: block; |
| 103 | +} |
| 104 | +
|
| 105 | +/* Navigation arrows */ |
| 106 | +.carousel-nav { |
| 107 | + position: absolute; |
| 108 | + top: calc(50% - 20px); |
| 109 | + transform: translateY(-50%); |
| 110 | + z-index: 10; |
| 111 | + width: 44px; |
| 112 | + height: 44px; |
| 113 | + border-radius: 50%; |
| 114 | + border: 1px solid var(--vp-c-divider); |
| 115 | + background: var(--vp-c-bg); |
| 116 | + color: var(--vp-c-text-2); |
| 117 | + display: flex; |
| 118 | + align-items: center; |
| 119 | + justify-content: center; |
| 120 | + cursor: pointer; |
| 121 | + transition: all 0.2s ease; |
| 122 | + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); |
| 123 | +} |
| 124 | +
|
| 125 | +.carousel-nav:hover { |
| 126 | + border-color: var(--vp-c-brand-1); |
| 127 | + color: var(--vp-c-brand-1); |
| 128 | + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); |
| 129 | +} |
| 130 | +
|
| 131 | +.dark .carousel-nav { |
| 132 | + background: var(--vp-c-bg-soft); |
| 133 | + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); |
| 134 | +} |
| 135 | +
|
| 136 | +.carousel-prev { |
| 137 | + left: 4px; |
| 138 | +} |
| 139 | +
|
| 140 | +.carousel-next { |
| 141 | + right: 4px; |
| 142 | +} |
| 143 | +
|
| 144 | +@media (min-width: 640px) { |
| 145 | + .carousel-prev { left: 16px; } |
| 146 | + .carousel-next { right: 16px; } |
| 147 | +} |
| 148 | +
|
| 149 | +@media (min-width: 960px) { |
| 150 | + .carousel-prev { left: 28px; } |
| 151 | + .carousel-next { right: 28px; } |
| 152 | +} |
| 153 | +
|
| 154 | +@media (max-width: 640px) { |
| 155 | + .carousel-nav { |
| 156 | + display: none; |
| 157 | + } |
| 158 | +} |
| 159 | +
|
| 160 | +/* Swiper pagination bullets */ |
| 161 | +:deep(.swiper-pagination-bullet) { |
| 162 | + background: var(--vp-c-text-3); |
| 163 | + opacity: 0.4; |
| 164 | + width: 8px; |
| 165 | + height: 8px; |
| 166 | + transition: all 0.25s ease; |
| 167 | +} |
| 168 | +
|
| 169 | +:deep(.swiper-pagination-bullet-active) { |
| 170 | + background: var(--vp-c-brand-1); |
| 171 | + opacity: 1; |
| 172 | + width: 24px; |
| 173 | + border-radius: 4px; |
| 174 | +} |
| 175 | +</style> |
0 commit comments