|
|
@@ -0,0 +1,90 @@
|
|
|
+<template>
|
|
|
+ <section class="list-page">
|
|
|
+ <Swiper
|
|
|
+ class="list-swiper"
|
|
|
+ :modules="modules"
|
|
|
+ :slides-per-view="3"
|
|
|
+ :slides-per-group="1"
|
|
|
+ :space-between="0"
|
|
|
+ :speed="520"
|
|
|
+ :loop="true"
|
|
|
+ :mousewheel="mousewheelOptions"
|
|
|
+ :simulate-touch="true"
|
|
|
+ :grab-cursor="true"
|
|
|
+ :watch-overflow="false"
|
|
|
+ >
|
|
|
+ <SwiperSlide
|
|
|
+ v-for="(slide, index) in swiperSlides"
|
|
|
+ :key="`${slide.title}-${index}`"
|
|
|
+ class="list-slide"
|
|
|
+ :style="{ background: slide.color }"
|
|
|
+ >
|
|
|
+ <span class="slide-index">{{ (index % slides.length) + 1 }}</span>
|
|
|
+ </SwiperSlide>
|
|
|
+ </Swiper>
|
|
|
+ </section>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { onBeforeUnmount, onMounted } from "vue";
|
|
|
+import { Mousewheel } from "swiper/modules";
|
|
|
+import { Swiper, SwiperSlide } from "swiper/vue";
|
|
|
+import "swiper/css";
|
|
|
+
|
|
|
+const modules = [Mousewheel];
|
|
|
+
|
|
|
+const slides = [
|
|
|
+ { title: "slide-1", color: "#2563eb" },
|
|
|
+ { title: "slide-2", color: "#16a34a" },
|
|
|
+ { title: "slide-3", color: "#f97316" },
|
|
|
+];
|
|
|
+
|
|
|
+const swiperSlides = [...slides, ...slides, ...slides];
|
|
|
+const mousewheelOptions = {
|
|
|
+ enabled: true,
|
|
|
+ forceToAxis: false,
|
|
|
+ thresholdDelta: 20,
|
|
|
+ thresholdTime: 420,
|
|
|
+};
|
|
|
+
|
|
|
+let previousBodyOverflow = "";
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ previousBodyOverflow = document.body.style.overflow;
|
|
|
+ document.body.style.overflow = "hidden";
|
|
|
+});
|
|
|
+
|
|
|
+onBeforeUnmount(() => {
|
|
|
+ document.body.style.overflow = previousBodyOverflow;
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.list-page {
|
|
|
+ position: fixed;
|
|
|
+ inset: 0;
|
|
|
+ z-index: 10;
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ overflow: hidden;
|
|
|
+ background: #111827;
|
|
|
+}
|
|
|
+
|
|
|
+.list-swiper {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.list-slide {
|
|
|
+ display: grid;
|
|
|
+ height: 100vh;
|
|
|
+ place-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.slide-index {
|
|
|
+ color: rgba(255, 255, 255, 0.86);
|
|
|
+ font-size: 72px;
|
|
|
+ font-weight: 800;
|
|
|
+ line-height: 1;
|
|
|
+}
|
|
|
+</style>
|