stellar-ui-v2 1.35.3
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/common/css/common.scss +61 -0
- package/components/ste-animate/README.md +117 -0
- package/components/ste-animate/animate.scss +247 -0
- package/components/ste-animate/ste-animate.vue +200 -0
- package/components/ste-badge/README.md +171 -0
- package/components/ste-badge/ste-badge.vue +238 -0
- package/components/ste-barcode/README.md +36 -0
- package/components/ste-barcode/encode2.js +317 -0
- package/components/ste-barcode/ste-barcode.vue +213 -0
- package/components/ste-button/README.md +129 -0
- package/components/ste-button/ste-button.vue +345 -0
- package/components/ste-calendar/README.md +304 -0
- package/components/ste-calendar/self-date.js +119 -0
- package/components/ste-calendar/ste-calendar.vue +578 -0
- package/components/ste-checkbox/README.md +297 -0
- package/components/ste-checkbox/ste-checkbox.vue +305 -0
- package/components/ste-checkbox-group/ste-checkbox-group.vue +133 -0
- package/components/ste-code-input/README.md +67 -0
- package/components/ste-code-input/ste-code-input.vue +302 -0
- package/components/ste-date-picker/README.md +135 -0
- package/components/ste-date-picker/ste-date-picker.vue +407 -0
- package/components/ste-drag/README.md +103 -0
- package/components/ste-drag/ste-drag.vue +203 -0
- package/components/ste-dropdown-menu/README.md +358 -0
- package/components/ste-dropdown-menu/ste-dropdown-menu.vue +405 -0
- package/components/ste-dropdown-menu-item/ste-dropdown-menu-item.vue +176 -0
- package/components/ste-icon/README.md +90 -0
- package/components/ste-icon/iconfont.css +8 -0
- package/components/ste-icon/ste-icon.vue +147 -0
- package/components/ste-image/README.md +154 -0
- package/components/ste-image/ste-image.vue +218 -0
- package/components/ste-index-item/ste-index-item.vue +96 -0
- package/components/ste-index-list/README.md +153 -0
- package/components/ste-index-list/ste-index-list.vue +128 -0
- package/components/ste-input/README.md +146 -0
- package/components/ste-input/ste-input.vue +480 -0
- package/components/ste-loading/README.md +81 -0
- package/components/ste-loading/ste-loading.vue +166 -0
- package/components/ste-media-preview/README.md +243 -0
- package/components/ste-media-preview/TouchScaleing.js +102 -0
- package/components/ste-media-preview/ste-media-preview.vue +267 -0
- package/components/ste-message-box/README.md +217 -0
- package/components/ste-message-box/ste-message-box.js +72 -0
- package/components/ste-message-box/ste-message-box.vue +380 -0
- package/components/ste-notice-bar/README.md +129 -0
- package/components/ste-notice-bar/ste-notice-bar.vue +331 -0
- package/components/ste-number-keyboard/README.md +246 -0
- package/components/ste-number-keyboard/keyboard.vue +140 -0
- package/components/ste-number-keyboard/ste-number-keyboard.vue +240 -0
- package/components/ste-picker/ste-picker.vue +258 -0
- package/components/ste-popup/README.md +148 -0
- package/components/ste-popup/ste-popup.vue +337 -0
- package/components/ste-price/README.md +129 -0
- package/components/ste-price/ste-price.vue +258 -0
- package/components/ste-progress/README.md +87 -0
- package/components/ste-progress/ste-progress.vue +200 -0
- package/components/ste-qrcode/README.md +50 -0
- package/components/ste-qrcode/ste-qrcode.vue +164 -0
- package/components/ste-qrcode/uqrcode.js +34 -0
- package/components/ste-radio/README.md +286 -0
- package/components/ste-radio/ste-radio.vue +293 -0
- package/components/ste-radio-group/ste-radio-group.vue +128 -0
- package/components/ste-rate/README.md +115 -0
- package/components/ste-rate/ste-rate.vue +202 -0
- package/components/ste-read-more/README.md +111 -0
- package/components/ste-read-more/ste-read-more.vue +133 -0
- package/components/ste-rich-text/README.md +31 -0
- package/components/ste-rich-text/ste-rich-text.vue +70 -0
- package/components/ste-scroll-to/README.md +68 -0
- package/components/ste-scroll-to/mixin.js +173 -0
- package/components/ste-scroll-to/ste-scroll-to.vue +45 -0
- package/components/ste-scroll-to-item/ste-scroll-to-item.vue +25 -0
- package/components/ste-search/README.md +262 -0
- package/components/ste-search/ste-search.vue +547 -0
- package/components/ste-select/README.md +434 -0
- package/components/ste-select/datapager.vue +62 -0
- package/components/ste-select/datetime.vue +106 -0
- package/components/ste-select/defaultDate.js +142 -0
- package/components/ste-select/ste-select.vue +843 -0
- package/components/ste-signature/README.md +105 -0
- package/components/ste-signature/ste-signature.vue +220 -0
- package/components/ste-slider/README.md +165 -0
- package/components/ste-slider/ste-slider.vue +544 -0
- package/components/ste-step/ste-step.vue +264 -0
- package/components/ste-stepper/README.md +170 -0
- package/components/ste-stepper/ste-stepper.vue +373 -0
- package/components/ste-steps/README.md +132 -0
- package/components/ste-steps/ste-steps.vue +65 -0
- package/components/ste-sticky/README.md +52 -0
- package/components/ste-sticky/ste-sticky.vue +127 -0
- package/components/ste-swipe-action/README.md +197 -0
- package/components/ste-swipe-action/ste-swipe-action.vue +303 -0
- package/components/ste-swipe-action-group/ste-swipe-action-group.vue +104 -0
- package/components/ste-swiper/README.md +173 -0
- package/components/ste-swiper/ste-swiper.vue +462 -0
- package/components/ste-swiper-item/ste-swiper-item.vue +41 -0
- package/components/ste-switch/README.md +110 -0
- package/components/ste-switch/ste-switch.vue +144 -0
- package/components/ste-tab/ste-tab.vue +87 -0
- package/components/ste-table/README.md +785 -0
- package/components/ste-table/common.js +8 -0
- package/components/ste-table/ste-table.vue +666 -0
- package/components/ste-table/utils.js +20 -0
- package/components/ste-table-column/checkbox-icon.vue +65 -0
- package/components/ste-table-column/common.scss +65 -0
- package/components/ste-table-column/radio-icon.vue +110 -0
- package/components/ste-table-column/ste-table-column.vue +255 -0
- package/components/ste-table-column/sub-table.vue +116 -0
- package/components/ste-table-column/table-popover.vue +204 -0
- package/components/ste-table-column/var.scss +1 -0
- package/components/ste-tabs/README.md +475 -0
- package/components/ste-tabs/props.js +212 -0
- package/components/ste-tabs/ste-tabs.vue +758 -0
- package/components/ste-text/README.md +66 -0
- package/components/ste-text/ste-text.vue +72 -0
- package/components/ste-toast/README.md +243 -0
- package/components/ste-toast/ste-toast.js +69 -0
- package/components/ste-toast/ste-toast.vue +231 -0
- package/components/ste-touch-swipe/README.md +104 -0
- package/components/ste-touch-swipe/TouchEvent.js +72 -0
- package/components/ste-touch-swipe/ste-touch-swipe.vue +327 -0
- package/components/ste-touch-swipe-item/ste-touch-swipe-item.vue +33 -0
- package/components/ste-tour/README.md +194 -0
- package/components/ste-tour/ste-tour.vue +355 -0
- package/components/ste-tree/README.md +240 -0
- package/components/ste-tree/ste-tree.vue +350 -0
- package/components/ste-upload/README.md +276 -0
- package/components/ste-upload/ReadFile.js +229 -0
- package/components/ste-upload/ste-upload.vue +526 -0
- package/components/ste-video/README.md +60 -0
- package/components/ste-video/props.js +149 -0
- package/components/ste-video/ste-video.vue +647 -0
- package/config/color.js +22 -0
- package/index.js +2 -0
- package/package.json +19 -0
- package/utils/Color.js +66 -0
- package/utils/System.js +110 -0
- package/utils/dayjs.min.js +1 -0
- package/utils/mixin.js +67 -0
- package/utils/store.js +7 -0
- package/utils/utils.js +604 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
image {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
line-height: 0;
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
display: block;
|
|
8
|
+
vertical-align: middle;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
movable-area,
|
|
12
|
+
movable-view,
|
|
13
|
+
page-container,
|
|
14
|
+
scroll-view,
|
|
15
|
+
share-element,
|
|
16
|
+
swiper,
|
|
17
|
+
swiper-item,
|
|
18
|
+
view icon,
|
|
19
|
+
progress,
|
|
20
|
+
rich-text,
|
|
21
|
+
text,
|
|
22
|
+
button,
|
|
23
|
+
checkbox,
|
|
24
|
+
checkbox-group,
|
|
25
|
+
editor,
|
|
26
|
+
form,
|
|
27
|
+
input,
|
|
28
|
+
keyboard-accessory,
|
|
29
|
+
label,
|
|
30
|
+
picker,
|
|
31
|
+
picker-view,
|
|
32
|
+
picker-view-column,
|
|
33
|
+
radio,
|
|
34
|
+
radio-group,
|
|
35
|
+
slider,
|
|
36
|
+
switch,
|
|
37
|
+
textarea,
|
|
38
|
+
functional-page-navigator,
|
|
39
|
+
navigator,
|
|
40
|
+
audio,
|
|
41
|
+
camera,
|
|
42
|
+
image,
|
|
43
|
+
live-player,
|
|
44
|
+
live-pusher,
|
|
45
|
+
videovoip-room,
|
|
46
|
+
map,
|
|
47
|
+
canvas,
|
|
48
|
+
ad,
|
|
49
|
+
ad-custom,
|
|
50
|
+
official-account,
|
|
51
|
+
open-data,
|
|
52
|
+
view {
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
background-repeat: no-repeat;
|
|
55
|
+
background-size: 100% 100%;
|
|
56
|
+
}
|
|
57
|
+
// #ifdef H5
|
|
58
|
+
.disabled {
|
|
59
|
+
cursor: no-drop !important;
|
|
60
|
+
}
|
|
61
|
+
// #endif
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Animate 动画
|
|
2
|
+
|
|
3
|
+
给子元素添加动画效果
|
|
4
|
+
|
|
5
|
+
---$
|
|
6
|
+
|
|
7
|
+
### 代码演示
|
|
8
|
+
#### 基础使用
|
|
9
|
+
```html
|
|
10
|
+
<ste-animate type="shakeX" loop>
|
|
11
|
+
<ste-button>shakeX-横向</ste-button>
|
|
12
|
+
</ste-animate>
|
|
13
|
+
<ste-animate type="shakeY" loop>
|
|
14
|
+
<ste-button>shakeY-竖向</ste-button>
|
|
15
|
+
</ste-animate>
|
|
16
|
+
<ste-animate type="ripple" loop>
|
|
17
|
+
<ste-button>ripple-心跳</ste-button>
|
|
18
|
+
</ste-animate>
|
|
19
|
+
<ste-animate type="breath" loop>
|
|
20
|
+
<ste-button>breath-呼吸灯</ste-button>
|
|
21
|
+
</ste-animate>
|
|
22
|
+
<ste-animate type="twinkle" loop>
|
|
23
|
+
<ste-button>twinkle-水波</ste-button>
|
|
24
|
+
</ste-animate>
|
|
25
|
+
<ste-animate type="flicker" loop>
|
|
26
|
+
<ste-button>flicker-擦亮</ste-button>
|
|
27
|
+
</ste-animate>
|
|
28
|
+
<ste-animate type="jump" loop>
|
|
29
|
+
<ste-button>jump-跳跃</ste-button>
|
|
30
|
+
</ste-animate>
|
|
31
|
+
<ste-animate type="float" loop>
|
|
32
|
+
<ste-button>float-漂浮</ste-button>
|
|
33
|
+
</ste-animate>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### 点击触发
|
|
37
|
+
设置`action`为`click`
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<ste-animate type="slide-right" action="click">
|
|
41
|
+
<ste-button :stopPropagation="false">由右向左划入</ste-button>
|
|
42
|
+
</ste-animate>
|
|
43
|
+
<ste-animate type="slide-left" action="click">
|
|
44
|
+
<ste-button :stopPropagation="false">由左向右划入</ste-button>
|
|
45
|
+
</ste-animate>
|
|
46
|
+
<ste-animate type="slide-top" action="click">
|
|
47
|
+
<ste-button :stopPropagation="false">由上向下划入</ste-button>
|
|
48
|
+
</ste-animate>
|
|
49
|
+
<ste-animate type="slide-bottom" action="click">
|
|
50
|
+
<ste-button :stopPropagation="false">由下向上划入</ste-button>
|
|
51
|
+
</ste-animate>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### 属性触发
|
|
55
|
+
可通过属性`show`来自定义触发动画执行
|
|
56
|
+
```html
|
|
57
|
+
<view>
|
|
58
|
+
<ste-animate type="shakeY" :show="show">
|
|
59
|
+
<ste-button :stopPropagation="false">动画</ste-button>
|
|
60
|
+
</ste-animate>
|
|
61
|
+
</view>
|
|
62
|
+
<view>
|
|
63
|
+
<ste-button @click="click">触发</ste-button>
|
|
64
|
+
</view>
|
|
65
|
+
<script>
|
|
66
|
+
export default {
|
|
67
|
+
data() {
|
|
68
|
+
return {
|
|
69
|
+
show: false,
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
methods: {
|
|
73
|
+
click() {
|
|
74
|
+
this.show = false;
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
this.show = true;
|
|
77
|
+
}, 50);
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
</script>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---$
|
|
85
|
+
### API
|
|
86
|
+
#### 组件属性(Props)
|
|
87
|
+
|
|
88
|
+
| 参数 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
89
|
+
| --- | --- | --- | --- | --- | --- |
|
|
90
|
+
| `show` | 控制动画,当值从`false`变为`true`时会触发一次动画 | `Boolean` | `false` | - | - |
|
|
91
|
+
| `type` | 动画类型,见下方`type`值说明 | `String` | - | - | - |
|
|
92
|
+
| `loop` | 是否循环执行。 | `Boolean` | `false` | - | - |
|
|
93
|
+
| `duration`| 动画时长,单位 ms | `Number` | | - | - |
|
|
94
|
+
| `action` | 不能与 show 同时使用)触发方式,`initial`初始化执行; `click`点击执行 | `String` | - | - | - |
|
|
95
|
+
|
|
96
|
+
#### 动画类型(type)
|
|
97
|
+
| 参数名称 |参数说明 |
|
|
98
|
+
| --- |--- |
|
|
99
|
+
| `shake` | 抖动,建议 loop 为 true |
|
|
100
|
+
| `ripple` | 不循环则是放大后缩小,循环则是心跳 |
|
|
101
|
+
| `breath` | 呼吸灯,建议 loop 为 true |
|
|
102
|
+
| `float` | 漂浮,建议 loop 为 true |
|
|
103
|
+
| `slide-right` | 由右向左划入 |
|
|
104
|
+
| `slide-left` | 由左向右划入 |
|
|
105
|
+
| `slide-top` | 由上至下划入 |
|
|
106
|
+
| `slide-bottom`| 由下至上划入 |
|
|
107
|
+
| `jump` | 跳跃,建议 loop 为 true |
|
|
108
|
+
| `twinkle` | 水波,建议 loop 为 true |
|
|
109
|
+
| `flicker` | 擦亮按钮,建议 loop 为 true |
|
|
110
|
+
|
|
111
|
+
#### 组件插槽(Slots)
|
|
112
|
+
| 名称 | 说明 | 支持版本 |
|
|
113
|
+
| --- | --- | --- |
|
|
114
|
+
| `default` | 默认插槽 | - |
|
|
115
|
+
|
|
116
|
+
---$
|
|
117
|
+
{{fuyuwei}}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
// 横向抖动动画
|
|
2
|
+
@keyframes shakeX {
|
|
3
|
+
0%,
|
|
4
|
+
100% {
|
|
5
|
+
transform: translateX(0);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
10% {
|
|
9
|
+
transform: translateX(-9px);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
20% {
|
|
13
|
+
transform: translateX(8px);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
30% {
|
|
17
|
+
transform: translateX(-7px);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
40% {
|
|
21
|
+
transform: translateX(6px);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
50% {
|
|
25
|
+
transform: translateX(-5px);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
60% {
|
|
29
|
+
transform: translateX(4px);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
70% {
|
|
33
|
+
transform: translateX(-3px);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
80% {
|
|
37
|
+
transform: translateX(2px);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
90% {
|
|
41
|
+
transform: translateX(-1px);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// 竖向抖动动画
|
|
46
|
+
@keyframes shakeY {
|
|
47
|
+
0%,
|
|
48
|
+
100% {
|
|
49
|
+
transform: translateY(0);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
10% {
|
|
53
|
+
transform: translateY(-9px);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
20% {
|
|
57
|
+
transform: translateY(8px);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
30% {
|
|
61
|
+
transform: translateY(-7px);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
40% {
|
|
65
|
+
transform: translateY(6px);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
50% {
|
|
69
|
+
transform: translateY(-5px);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
60% {
|
|
73
|
+
transform: translateY(4px);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
70% {
|
|
77
|
+
transform: translateY(-3px);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
80% {
|
|
81
|
+
transform: translateY(2px);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
90% {
|
|
85
|
+
transform: translateY(-1px);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// 心跳
|
|
90
|
+
@keyframes ripple {
|
|
91
|
+
0% {
|
|
92
|
+
// box-shadow: 0 0.5em 0.5em rgba(0, 0, 0, 0.4);
|
|
93
|
+
|
|
94
|
+
transform: scale(1);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
50% {
|
|
98
|
+
// box-shadow: 0 1em 1em rgba(0, 0, 0, 0.4);
|
|
99
|
+
transform: scale(1.1);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// 呼吸
|
|
104
|
+
@keyframes breath {
|
|
105
|
+
0% {
|
|
106
|
+
transform: scale(1);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
50% {
|
|
110
|
+
transform: scale(1.1);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
100% {
|
|
114
|
+
transform: scale(1);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// 右侧向左侧划入
|
|
119
|
+
@keyframes slide-right {
|
|
120
|
+
0% {
|
|
121
|
+
opacity: 0;
|
|
122
|
+
transform: translateX(100%);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
100% {
|
|
126
|
+
opacity: 1;
|
|
127
|
+
transform: translateX(0);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// 左侧向右侧划入
|
|
132
|
+
@keyframes slide-left {
|
|
133
|
+
0% {
|
|
134
|
+
opacity: 0;
|
|
135
|
+
transform: translateX(-100%);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
100% {
|
|
139
|
+
opacity: 1;
|
|
140
|
+
transform: translateX(0);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// 上面向下面划入
|
|
145
|
+
@keyframes slide-top {
|
|
146
|
+
0% {
|
|
147
|
+
opacity: 0;
|
|
148
|
+
transform: translateY(-100%);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
100% {
|
|
152
|
+
opacity: 1;
|
|
153
|
+
transform: translateY(0);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// 下面向上面划入
|
|
158
|
+
@keyframes slide-bottom {
|
|
159
|
+
0% {
|
|
160
|
+
opacity: 0;
|
|
161
|
+
transform: translateY(100%);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
100% {
|
|
165
|
+
opacity: 1;
|
|
166
|
+
transform: translateY(0);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// 漂浮 float
|
|
171
|
+
@keyframes floatPop {
|
|
172
|
+
0% {
|
|
173
|
+
top: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
25% {
|
|
177
|
+
top: 1px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
50% {
|
|
181
|
+
top: 4px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
75% {
|
|
185
|
+
top: 1px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
100% {
|
|
189
|
+
top: 0;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// 跳跃
|
|
194
|
+
@keyframes jump {
|
|
195
|
+
0% {
|
|
196
|
+
transform: rotate(0deg) translateY(0);
|
|
197
|
+
animation-timing-function: ease-in;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
25% {
|
|
201
|
+
transform: rotate(10deg) translateY(20 * 1px);
|
|
202
|
+
animation-timing-function: ease-out;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
50% {
|
|
206
|
+
transform: rotate(0deg) translateY(-10 * 1px);
|
|
207
|
+
animation-timing-function: ease-in;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
75% {
|
|
211
|
+
transform: rotate(-10deg) translateY(20 * 1px);
|
|
212
|
+
animation-timing-function: ease-out;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
100% {
|
|
216
|
+
transform: rotate(0deg) translateY(0);
|
|
217
|
+
animation-timing-function: ease-in;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// 水波
|
|
222
|
+
@keyframes twinkle {
|
|
223
|
+
0% {
|
|
224
|
+
transform: scale(0);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
20% {
|
|
228
|
+
opacity: 1;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
50%,
|
|
232
|
+
100% {
|
|
233
|
+
opacity: 0;
|
|
234
|
+
transform: scale(1.4);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
@keyframes flicker {
|
|
239
|
+
0% {
|
|
240
|
+
transform: translateX(-100 * 1px) skewX(-20deg);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
40%,
|
|
244
|
+
100% {
|
|
245
|
+
transform: translateX(150 * 1px) skewX(-20deg);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="ste-animate-root ste-animate" :class="[cmpRootClass]" :style="[cmpRootStyle]" @click="handleClick">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
group: '展示组件',
|
|
10
|
+
title: 'Animate 动画',
|
|
11
|
+
name: 'ste-animate',
|
|
12
|
+
options: {
|
|
13
|
+
virtualHost: true,
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
show: {
|
|
17
|
+
type: [Boolean, null],
|
|
18
|
+
default: false,
|
|
19
|
+
},
|
|
20
|
+
type: {
|
|
21
|
+
type: [String, null],
|
|
22
|
+
default: '',
|
|
23
|
+
},
|
|
24
|
+
loop: {
|
|
25
|
+
type: [Boolean, null],
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
duration: {
|
|
29
|
+
type: [Number, null],
|
|
30
|
+
default: 300,
|
|
31
|
+
},
|
|
32
|
+
action: {
|
|
33
|
+
type: [String, null],
|
|
34
|
+
default: '',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
animationFlag: false, // 通过此标识控制动画执行
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
computed: {
|
|
43
|
+
cmpRootClass() {
|
|
44
|
+
let classArr = [];
|
|
45
|
+
if (this.type && (this.action === 'initial' || this.animationFlag || this.loop)) {
|
|
46
|
+
classArr.push(`ste-animate-${this.type}`);
|
|
47
|
+
}
|
|
48
|
+
if (this.loop) {
|
|
49
|
+
classArr.push('loop');
|
|
50
|
+
}
|
|
51
|
+
return classArr.join(' ');
|
|
52
|
+
},
|
|
53
|
+
cmpRootStyle() {
|
|
54
|
+
let style = {};
|
|
55
|
+
if (this.duration) {
|
|
56
|
+
style.animationDuration = this.duration;
|
|
57
|
+
}
|
|
58
|
+
return style;
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
watch: {
|
|
62
|
+
show: {
|
|
63
|
+
handler(val) {
|
|
64
|
+
if (val) {
|
|
65
|
+
this.animated();
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
methods: {
|
|
71
|
+
handleClick() {
|
|
72
|
+
if (this.action === 'click') {
|
|
73
|
+
this.animated();
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
animated() {
|
|
77
|
+
this.animationFlag = false;
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
this.animationFlag = true;
|
|
80
|
+
}, 10);
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<style lang="scss" scoped>
|
|
87
|
+
@import './animate.scss'; // 所有动画
|
|
88
|
+
.ste-animate-root {
|
|
89
|
+
display: inline-block;
|
|
90
|
+
|
|
91
|
+
&.ste-animate {
|
|
92
|
+
animation-duration: 0.5s;
|
|
93
|
+
animation-timing-function: ease-out;
|
|
94
|
+
animation-fill-mode: both;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// 循环
|
|
98
|
+
&.loop {
|
|
99
|
+
animation-iteration-count: infinite !important;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// 横向抖动
|
|
103
|
+
&.ste-animate-shakeX {
|
|
104
|
+
animation-name: shakeX;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// 竖向抖动
|
|
108
|
+
&.ste-animate-shakeY {
|
|
109
|
+
animation-name: shakeY;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// 心跳
|
|
113
|
+
&.ste-animate-ripple {
|
|
114
|
+
animation-name: ripple;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// 漂浮
|
|
118
|
+
&.ste-animate-float {
|
|
119
|
+
position: relative;
|
|
120
|
+
animation-name: floatPop;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// 呼吸灯
|
|
124
|
+
&.ste-animate-breath {
|
|
125
|
+
animation-name: breath;
|
|
126
|
+
animation-duration: 2700ms;
|
|
127
|
+
animation-timing-function: ease-in-out;
|
|
128
|
+
animation-direction: alternate;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// 右侧向左侧划入
|
|
132
|
+
&.ste-animate-slide-right {
|
|
133
|
+
animation-name: slide-right;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// 右侧向左侧划入
|
|
137
|
+
&.ste-animate-slide-left {
|
|
138
|
+
animation-name: slide-left;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// 上面向下面划入
|
|
142
|
+
&.ste-animate-slide-top {
|
|
143
|
+
animation-name: slide-top;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// 下面向上面划入
|
|
147
|
+
&.ste-animate-slide-bottom {
|
|
148
|
+
animation-name: slide-bottom;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&.ste-animate-jump {
|
|
152
|
+
transform-origin: center center;
|
|
153
|
+
animation: jump 0.7s linear;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&.ste-animate-twinkle {
|
|
157
|
+
position: relative;
|
|
158
|
+
|
|
159
|
+
&::after,
|
|
160
|
+
&::before {
|
|
161
|
+
position: absolute;
|
|
162
|
+
right: 50%;
|
|
163
|
+
z-index: 1;
|
|
164
|
+
box-sizing: border-box;
|
|
165
|
+
width: 60px;
|
|
166
|
+
height: 60px;
|
|
167
|
+
margin-top: -15px;
|
|
168
|
+
margin-right: -30px;
|
|
169
|
+
content: '';
|
|
170
|
+
border: 4rpx solid rgba(255, 255, 255, 0.6);
|
|
171
|
+
border-radius: 30px;
|
|
172
|
+
transform: scale(0);
|
|
173
|
+
animation: twinkle 2s ease-out infinite;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&::after {
|
|
177
|
+
animation-delay: 0.4s;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&.ste-animate-flicker {
|
|
182
|
+
position: relative;
|
|
183
|
+
overflow: hidden;
|
|
184
|
+
|
|
185
|
+
&::after {
|
|
186
|
+
position: absolute;
|
|
187
|
+
top: -2rpx;
|
|
188
|
+
left: 0;
|
|
189
|
+
width: 200rpx;
|
|
190
|
+
height: 102%;
|
|
191
|
+
content: '';
|
|
192
|
+
background-image: linear-gradient(106deg, rgba(232, 224, 255, 0) 24%, #e8e0ff 91%);
|
|
193
|
+
filter: blur(6rpx);
|
|
194
|
+
opacity: 0.73;
|
|
195
|
+
transform: skew(-20deg);
|
|
196
|
+
animation: flicker 1.5s linear infinite;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
</style>
|