@fy-/fws-vue 2.0.89 → 2.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ui/DefaultGallery.vue +38 -37
- package/package.json +1 -1
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
} from "@heroicons/vue/24/solid";
|
|
13
13
|
import DefaultPaging from "./DefaultPaging.vue";
|
|
14
14
|
import type { Component } from "vue";
|
|
15
|
-
import CollapseTransition from "./transitions/CollapseTransition.vue";
|
|
16
15
|
|
|
17
16
|
const isGalleryOpen = ref<boolean>(false);
|
|
18
17
|
const eventBus = useEventBus();
|
|
@@ -65,7 +64,7 @@ const modelValue = computed({
|
|
|
65
64
|
},
|
|
66
65
|
});
|
|
67
66
|
|
|
68
|
-
const direction = ref<"
|
|
67
|
+
const direction = ref<"next" | "prev">("next");
|
|
69
68
|
|
|
70
69
|
const setModal = (value: boolean) => {
|
|
71
70
|
if (value === true) {
|
|
@@ -85,7 +84,7 @@ const openGalleryImage = (index: number | undefined) => {
|
|
|
85
84
|
};
|
|
86
85
|
|
|
87
86
|
const goNextImage = () => {
|
|
88
|
-
direction.value = "
|
|
87
|
+
direction.value = "next";
|
|
89
88
|
if (modelValue.value < props.images.length - 1) {
|
|
90
89
|
modelValue.value++;
|
|
91
90
|
} else {
|
|
@@ -94,7 +93,7 @@ const goNextImage = () => {
|
|
|
94
93
|
};
|
|
95
94
|
|
|
96
95
|
const goPrevImage = () => {
|
|
97
|
-
direction.value = "
|
|
96
|
+
direction.value = "prev";
|
|
98
97
|
if (modelValue.value > 0) {
|
|
99
98
|
modelValue.value--;
|
|
100
99
|
} else {
|
|
@@ -128,10 +127,10 @@ const touchEnd = (event: TouchEvent) => {
|
|
|
128
127
|
// Add a threshold to prevent accidental swipes
|
|
129
128
|
if (Math.abs(diffX) > Math.abs(diffY) && Math.abs(diffX) > 50) {
|
|
130
129
|
if (diffX > 0) {
|
|
131
|
-
direction.value = "
|
|
130
|
+
direction.value = "next";
|
|
132
131
|
goNextImage();
|
|
133
132
|
} else {
|
|
134
|
-
direction.value = "
|
|
133
|
+
direction.value = "prev";
|
|
135
134
|
goPrevImage();
|
|
136
135
|
}
|
|
137
136
|
}
|
|
@@ -151,12 +150,12 @@ const handleKeyboardInput = (event: KeyboardEvent) => {
|
|
|
151
150
|
switch (event.key) {
|
|
152
151
|
case "ArrowRight":
|
|
153
152
|
isKeyPressed.value = true;
|
|
154
|
-
direction.value = "
|
|
153
|
+
direction.value = "next";
|
|
155
154
|
goNextImage();
|
|
156
155
|
break;
|
|
157
156
|
case "ArrowLeft":
|
|
158
157
|
isKeyPressed.value = true;
|
|
159
|
-
direction.value = "
|
|
158
|
+
direction.value = "prev";
|
|
160
159
|
goPrevImage();
|
|
161
160
|
break;
|
|
162
161
|
default:
|
|
@@ -242,15 +241,18 @@ onUnmounted(() => {
|
|
|
242
241
|
</button>
|
|
243
242
|
</div>
|
|
244
243
|
<div
|
|
245
|
-
class="flex-1 flex flex-col items-center justify-center max-w-full lg:max-w-[calc(100vw - 256px)] overflow-hidden"
|
|
244
|
+
class="flex-1 flex flex-col items-center justify-center max-w-full lg:max-w-[calc(100vw - 256px)] relative overflow-hidden"
|
|
246
245
|
@touchstart="touchStart"
|
|
247
246
|
@touchend="touchEnd"
|
|
248
247
|
>
|
|
249
|
-
<transition
|
|
248
|
+
<transition
|
|
249
|
+
:name="direction === 'next' ? 'slide-next' : 'slide-prev'"
|
|
250
|
+
mode="out-in"
|
|
251
|
+
>
|
|
250
252
|
<div
|
|
251
253
|
v-if="true"
|
|
252
254
|
:key="`image-display-${modelValue}`"
|
|
253
|
-
class="flex-1 w-full max-w-full flex flex-col items-center justify-center"
|
|
255
|
+
class="flex-1 w-full max-w-full flex flex-col items-center justify-center absolute inset-0"
|
|
254
256
|
>
|
|
255
257
|
<div
|
|
256
258
|
class="flex-1 w-full max-w-full flex items-center justify-center"
|
|
@@ -367,6 +369,7 @@ onUnmounted(() => {
|
|
|
367
369
|
</DialogPanel>
|
|
368
370
|
</Dialog>
|
|
369
371
|
</TransitionRoot>
|
|
372
|
+
|
|
370
373
|
<template v-if="mode == 'grid' || mode == 'mason' || mode == 'custom'">
|
|
371
374
|
<div
|
|
372
375
|
:class="{
|
|
@@ -455,27 +458,32 @@ onUnmounted(() => {
|
|
|
455
458
|
.slide-next-leave-active {
|
|
456
459
|
transition:
|
|
457
460
|
opacity 0.5s,
|
|
458
|
-
transform 0.5s
|
|
461
|
+
transform 0.5s,
|
|
462
|
+
filter 0.5s;
|
|
459
463
|
}
|
|
460
464
|
|
|
461
465
|
.slide-next-enter-from {
|
|
462
466
|
opacity: 0;
|
|
463
467
|
transform: translateX(100%);
|
|
468
|
+
filter: blur(10px);
|
|
464
469
|
}
|
|
465
470
|
|
|
466
471
|
.slide-next-enter-to {
|
|
467
472
|
opacity: 1;
|
|
468
473
|
transform: translateX(0);
|
|
474
|
+
filter: blur(0);
|
|
469
475
|
}
|
|
470
476
|
|
|
471
477
|
.slide-next-leave-from {
|
|
472
478
|
opacity: 1;
|
|
473
479
|
transform: translateX(0);
|
|
480
|
+
filter: blur(0);
|
|
474
481
|
}
|
|
475
482
|
|
|
476
483
|
.slide-next-leave-to {
|
|
477
484
|
opacity: 0;
|
|
478
485
|
transform: translateX(-100%);
|
|
486
|
+
filter: blur(10px);
|
|
479
487
|
}
|
|
480
488
|
|
|
481
489
|
/* Transition styles for prev (left) navigation */
|
|
@@ -483,53 +491,46 @@ onUnmounted(() => {
|
|
|
483
491
|
.slide-prev-leave-active {
|
|
484
492
|
transition:
|
|
485
493
|
opacity 0.5s,
|
|
486
|
-
transform 0.5s
|
|
494
|
+
transform 0.5s,
|
|
495
|
+
filter 0.5s;
|
|
487
496
|
}
|
|
488
497
|
|
|
489
498
|
.slide-prev-enter-from {
|
|
490
499
|
opacity: 0;
|
|
491
500
|
transform: translateX(-100%);
|
|
501
|
+
filter: blur(10px);
|
|
492
502
|
}
|
|
493
503
|
|
|
494
504
|
.slide-prev-enter-to {
|
|
495
505
|
opacity: 1;
|
|
496
506
|
transform: translateX(0);
|
|
507
|
+
filter: blur(0);
|
|
497
508
|
}
|
|
498
509
|
|
|
499
510
|
.slide-prev-leave-from {
|
|
500
511
|
opacity: 1;
|
|
501
512
|
transform: translateX(0);
|
|
513
|
+
filter: blur(0);
|
|
502
514
|
}
|
|
503
515
|
|
|
504
516
|
.slide-prev-leave-to {
|
|
505
517
|
opacity: 0;
|
|
506
518
|
transform: translateX(100%);
|
|
507
|
-
|
|
508
|
-
</style>
|
|
509
|
-
<style scoped>
|
|
510
|
-
.slide-left-enter-active,
|
|
511
|
-
.slide-left-leave-active {
|
|
512
|
-
transition: transform 0.3s ease;
|
|
513
|
-
}
|
|
514
|
-
.slide-left-enter-from,
|
|
515
|
-
.slide-left-leave-to {
|
|
516
|
-
transform: translateX(100%);
|
|
517
|
-
}
|
|
518
|
-
.slide-left-enter-to,
|
|
519
|
-
.slide-left-leave-from {
|
|
520
|
-
transform: translateX(0);
|
|
519
|
+
filter: blur(10px);
|
|
521
520
|
}
|
|
522
521
|
|
|
523
|
-
|
|
524
|
-
.
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
.slide-right-leave-to {
|
|
529
|
-
transform: translateX(-100%);
|
|
522
|
+
/* Ensure the images are positioned correctly to prevent overlap */
|
|
523
|
+
.relative-container {
|
|
524
|
+
position: relative;
|
|
525
|
+
width: 100%;
|
|
526
|
+
height: 100%;
|
|
530
527
|
}
|
|
531
|
-
|
|
532
|
-
.
|
|
533
|
-
|
|
528
|
+
|
|
529
|
+
.relative-container > div {
|
|
530
|
+
position: absolute;
|
|
531
|
+
top: 0;
|
|
532
|
+
left: 0;
|
|
533
|
+
width: 100%;
|
|
534
|
+
height: 100%;
|
|
534
535
|
}
|
|
535
536
|
</style>
|