From 53bc6517f2bd3668614d178f8aac1d391cc0267b Mon Sep 17 00:00:00 2001
From: Jed <510374040@qq.com>
Date: Thu, 29 Feb 2024 14:54:06 +0800
Subject: [PATCH] feat(components): [Carousel] Add motion blur functionality
(#15603)
* feat(components): [Carousel] Add motion blur functionality
docs(components): [Carousel] Add example properties
docs(components): [Carousel] Add docs properties
* fix(components): [Carousel] change the id name in filter in svg
fix(components): [Carousel] button to remove motion blur effect
fix(components): [Carousel] svg hides when motion blur is false
* update(components): [Carousel] docs/en-US/component/carousel.md
Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com>
* update(components): [Carousel] docs/examples/carousel/motion-blur.vue
Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com>
* update(components): [Carousel] docs/examples/carousel/motion-blur.vue
Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com>
* update(components): [Carousel] packages/components/carousel/src/carousel.ts
Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com>
* docs(components): [Carousel] add feature version labels
---------
Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com>
---
docs/en-US/component/carousel.md | 37 +++---
docs/examples/carousel/motion-blur.vue | 43 +++++++
.../carousel/__tests__/carousel.test.tsx | 22 ++++
packages/components/carousel/src/carousel.ts | 4 +
packages/components/carousel/src/carousel.vue | 105 ++++++++++++------
.../components/carousel/src/use-carousel.ts | 26 +++++
packages/theme-chalk/src/carousel.scss | 8 ++
7 files changed, 196 insertions(+), 49 deletions(-)
create mode 100644 docs/examples/carousel/motion-blur.vue
diff --git a/docs/en-US/component/carousel.md b/docs/en-US/component/carousel.md
index 1789ec5b33..5af7d7d47a 100644
--- a/docs/en-US/component/carousel.md
+++ b/docs/en-US/component/carousel.md
@@ -15,6 +15,16 @@ carousel/basic
:::
+## Motion blur ^(2.6.0)
+
+Add motion blur to infuse dynamism and smoothness into the carousel.
+
+:::demo Enabling motion blur enhances the dynamism and smoothness of the carousel. By default, the `motion-blur` parameter is set to `false`, activating this feature and providing a visually engaging experience.
+
+carousel/motion-blur
+
+:::
+
## Indicators
Indicators can be displayed outside the carousel
@@ -67,19 +77,20 @@ carousel/vertical
## Carousel Attributes
-| Name | Description | Type | Accepted Values | Default |
-| ------------------ | ----------------------------------------------------- | ------- | ------------------- | ---------- |
-| height | height of the carousel | string | — | — |
-| initial-index | index of the initially active slide (starting from 0) | number | — | 0 |
-| trigger | how indicators are triggered | string | hover/click | hover |
-| autoplay | whether automatically loop the slides | boolean | — | true |
-| interval | interval of the auto loop, in milliseconds | number | — | 3000 |
-| indicator-position | position of the indicators | string | outside/none | — |
-| arrow | when arrows are shown | string | always/hover/never | hover |
-| type | type of the Carousel | string | card | — |
-| loop | display the items in loop | boolean | - | true |
-| direction | display direction | string | horizontal/vertical | horizontal |
-| pause-on-hover | pause autoplay when hover | boolean | - | true |
+| Name | Description | Type | Accepted Values | Default |
+| ---------------------- | ----------------------------------------------------- | ------- | ------------------- | ---------- |
+| height | height of the carousel | string | — | — |
+| initial-index | index of the initially active slide (starting from 0) | number | — | 0 |
+| trigger | how indicators are triggered | string | hover/click | hover |
+| autoplay | whether automatically loop the slides | boolean | — | true |
+| interval | interval of the auto loop, in milliseconds | number | — | 3000 |
+| indicator-position | position of the indicators | string | outside/none | — |
+| arrow | when arrows are shown | string | always/hover/never | hover |
+| type | type of the Carousel | string | card | — |
+| loop | display the items in loop | boolean | - | true |
+| direction | display direction | string | horizontal/vertical | horizontal |
+| pause-on-hover | pause autoplay when hover | boolean | - | true |
+| motion-blur ^(2.6.0) | infuse dynamism and smoothness into the carousel | boolean | - | false |
## Carousel Events
diff --git a/docs/examples/carousel/motion-blur.vue b/docs/examples/carousel/motion-blur.vue
new file mode 100644
index 0000000000..9f5acbc9bc
--- /dev/null
+++ b/docs/examples/carousel/motion-blur.vue
@@ -0,0 +1,43 @@
+
+ Vertical effect{{ item }}
+ {{ item }}
+