From fae19436b1c096f938c18d9a80922b80d3ac3bc3 Mon Sep 17 00:00:00 2001 From: padreug Date: Sat, 27 Sep 2025 19:08:07 +0200 Subject: [PATCH] feat: introduce ProgressiveImage component for enhanced image loading - Added a new ProgressiveImage component to handle image loading with a blur effect and loading indicators. - Updated ProductCard and ProductDetailDialog components to utilize ProgressiveImage, improving image loading performance and user experience. - Configured properties such as blur radius, transition duration, and loading indicators for better customization. These changes enhance the visual presentation of images and optimize loading behavior across market components. --- src/components/ui/ProgressiveImage.vue | 334 ++++++++++++++++++ src/modules/market/components/ProductCard.vue | 10 +- .../market/components/ProductDetailDialog.vue | 18 +- 3 files changed, 356 insertions(+), 6 deletions(-) create mode 100644 src/components/ui/ProgressiveImage.vue diff --git a/src/components/ui/ProgressiveImage.vue b/src/components/ui/ProgressiveImage.vue new file mode 100644 index 0000000..6e4dbb0 --- /dev/null +++ b/src/components/ui/ProgressiveImage.vue @@ -0,0 +1,334 @@ + + + + + diff --git a/src/modules/market/components/ProductCard.vue b/src/modules/market/components/ProductCard.vue index 9b669b5..3d2ceb8 100644 --- a/src/modules/market/components/ProductCard.vue +++ b/src/modules/market/components/ProductCard.vue @@ -2,11 +2,16 @@
- @@ -105,6 +110,7 @@ import { ref } from 'vue' import { Card, CardContent, CardFooter, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Badge } from '@/components/ui/badge' +import ProgressiveImage from '@/components/ui/ProgressiveImage.vue' import { ShoppingCart } from 'lucide-vue-next' import type { Product } from '@/modules/market/stores/market' diff --git a/src/modules/market/components/ProductDetailDialog.vue b/src/modules/market/components/ProductDetailDialog.vue index ebe7af5..9023085 100644 --- a/src/modules/market/components/ProductDetailDialog.vue +++ b/src/modules/market/components/ProductDetailDialog.vue @@ -12,12 +12,17 @@
-
@@ -34,10 +39,14 @@ class="relative w-20 h-20 rounded-lg overflow-hidden border-2 transition-all" :class="currentImageIndex === index ? 'border-primary' : 'border-gray-200 hover:border-gray-400'" > - @@ -163,6 +172,7 @@ import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { Badge } from '@/components/ui/badge' +import ProgressiveImage from '@/components/ui/ProgressiveImage.vue' import { Package, ShoppingCart, Store, Plus, Minus, X } from 'lucide-vue-next' import { useToast } from '@/core/composables/useToast' import type { Product } from '../types/market'