little-dizzy 2.4.0 → 2.5.0

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.
@@ -1,32 +1,41 @@
1
1
  <template>
2
2
  <div class="Lztext-wrapper">
3
3
  <div class="loader-wrapper">
4
- <span class="loader-letter">G</span>
5
- <span class="loader-letter">e</span>
6
- <span class="loader-letter">n</span>
7
- <span class="loader-letter">e</span>
8
- <span class="loader-letter">r</span>
9
- <span class="loader-letter">a</span>
10
- <span class="loader-letter">t</span>
11
- <span class="loader-letter">i</span>
12
- <span class="loader-letter">n</span>
13
- <span class="loader-letter">g</span>
4
+ <span v-for="(char, index) in characters" :key="index" class="loader-letter"
5
+ :style="{ animationDelay: `${0.1 + index * 0.105}s` }">{{ char === ' ' ? '\u00A0' : char }}</span>
14
6
  <div class="loader"></div>
15
7
  </div>
16
8
  </div>
17
9
  </template>
18
10
 
19
11
  <script setup>
12
+ import { computed } from 'vue'
13
+
20
14
  /**
21
15
  * 渐变文字动画
22
16
  *
23
- * LittleDizzy Demo 自动生成
17
+ * 通过 text 属性传入文字内容
24
18
  * @component Lztext
19
+ * @example <LdLztext text="Hello World" />
25
20
  */
26
21
  defineOptions({
27
22
  name: 'Lztext'
28
23
  })
29
24
 
25
+ const props = defineProps({
26
+ /**
27
+ * 显示的文字内容
28
+ */
29
+ text: {
30
+ type: String,
31
+ default: 'Generating'
32
+ }
33
+ })
34
+
35
+ // 将文字拆分为字符数组
36
+ const characters = computed(() => {
37
+ return props.text.split('')
38
+ })
30
39
  </script>
31
40
 
32
41
  <style scoped>
@@ -57,13 +66,11 @@ defineOptions({
57
66
  z-index: 1;
58
67
 
59
68
  background-color: transparent;
60
- mask: repeating-linear-gradient(
61
- 90deg,
62
- transparent 0,
63
- transparent 6px,
64
- black 7px,
65
- black 8px
66
- );
69
+ mask: repeating-linear-gradient(90deg,
70
+ transparent 0,
71
+ transparent 6px,
72
+ black 7px,
73
+ black 8px);
67
74
  }
68
75
 
69
76
  .loader::after {
@@ -79,12 +86,10 @@ defineOptions({
79
86
  radial-gradient(circle at 55% 55%, #0ff 0%, transparent 45%),
80
87
  radial-gradient(circle at 45% 55%, #0f0 0%, transparent 45%),
81
88
  radial-gradient(circle at 55% 45%, #00f 0%, transparent 45%);
82
- mask: radial-gradient(
83
- circle at 50% 50%,
84
- transparent 0%,
85
- transparent 10%,
86
- black 25%
87
- );
89
+ mask: radial-gradient(circle at 50% 50%,
90
+ transparent 0%,
91
+ transparent 10%,
92
+ black 25%);
88
93
  animation:
89
94
  transform-animation 2s infinite alternate,
90
95
  opacity-animation 4s infinite;
@@ -95,19 +100,23 @@ defineOptions({
95
100
  0% {
96
101
  transform: translate(-55%);
97
102
  }
103
+
98
104
  100% {
99
105
  transform: translate(55%);
100
106
  }
101
107
  }
102
108
 
103
109
  @keyframes opacity-animation {
110
+
104
111
  0%,
105
112
  100% {
106
113
  opacity: 0;
107
114
  }
115
+
108
116
  15% {
109
117
  opacity: 1;
110
118
  }
119
+
111
120
  65% {
112
121
  opacity: 0;
113
122
  }
@@ -120,49 +129,21 @@ defineOptions({
120
129
  z-index: 2;
121
130
  }
122
131
 
123
- .loader-letter:nth-child(1) {
124
- animation-delay: 0.1s;
125
- }
126
- .loader-letter:nth-child(2) {
127
- animation-delay: 0.205s;
128
- }
129
- .loader-letter:nth-child(3) {
130
- animation-delay: 0.31s;
131
- }
132
- .loader-letter:nth-child(4) {
133
- animation-delay: 0.415s;
134
- }
135
- .loader-letter:nth-child(5) {
136
- animation-delay: 0.521s;
137
- }
138
- .loader-letter:nth-child(6) {
139
- animation-delay: 0.626s;
140
- }
141
- .loader-letter:nth-child(7) {
142
- animation-delay: 0.731s;
143
- }
144
- .loader-letter:nth-child(8) {
145
- animation-delay: 0.837s;
146
- }
147
- .loader-letter:nth-child(9) {
148
- animation-delay: 0.942s;
149
- }
150
- .loader-letter:nth-child(10) {
151
- animation-delay: 1.047s;
152
- }
153
-
154
132
  @keyframes loader-letter-anim {
155
133
  0% {
156
134
  opacity: 0;
157
135
  }
136
+
158
137
  5% {
159
138
  opacity: 1;
160
139
  text-shadow: 0 0 4px #fff;
161
140
  transform: scale(1.1) translateY(-2px);
162
141
  }
142
+
163
143
  20% {
164
144
  opacity: 0.2;
165
145
  }
146
+
166
147
  100% {
167
148
  opacity: 0;
168
149
  }
package/src/index.js CHANGED
@@ -24,6 +24,9 @@ import Button from './components/Button.vue'
24
24
  import Card from './components/Card.vue'
25
25
  import Modal from './components/Modal.vue'
26
26
  import Message from './components/Message.vue'
27
+ import Carousel from './components/Carousel.vue'
28
+ import Loading from './components/Loading.vue'
29
+ import Table from './components/Table.vue'
27
30
  import { message } from './components/message.js'
28
31
 
29
32
  // 导入自定义组件(由 Demo 上传生成)
@@ -38,6 +41,9 @@ const components = {
38
41
  Card,
39
42
  Modal,
40
43
  Message,
44
+ Carousel,
45
+ Loading,
46
+ Table,
41
47
  ...customComponents
42
48
  }
43
49
 
@@ -61,7 +67,7 @@ export const registerSnippets = snippetsModule.registerSnippets
61
67
  export const getSnippet = snippetsModule.getSnippet
62
68
 
63
69
  // 导出内置组件(按需引入)
64
- export { Button, Card, Modal, Message, message }
70
+ export { Button, Card, Modal, Message, Carousel, Loading, Table, message }
65
71
 
66
72
  // 重新导出自定义组件
67
73
  export * from './components/custom/index.js'
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Backtop 回到顶部组件示例代码
3
+ */
4
+ export default {
5
+ name: 'Backtop',
6
+ type: 'vue',
7
+ label: 'Backtop 回到顶部',
8
+ code: `<template>
9
+ <!-- 基础用法 -->
10
+ <Backtop />
11
+
12
+ <!-- 指定滚动容器 -->
13
+ <Backtop target=".my-container" :visibility-height="100" />
14
+
15
+ <!-- 自定义内容 -->
16
+ <Backtop>
17
+ <span style="font-size: 12px;">UP</span>
18
+ </Backtop>
19
+ </template>
20
+
21
+ <script setup>
22
+ import { Backtop } from 'little-dizzy'
23
+ </script>`
24
+ }
25
+
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Carousel 轮播图组件示例代码
3
+ */
4
+ export default {
5
+ name: 'Carousel',
6
+ type: 'vue',
7
+ label: 'Carousel 轮播图',
8
+ code: `<template>
9
+ <Carousel :items="items" height="300px" />
10
+ </template>
11
+
12
+ <script setup>
13
+ import { Carousel } from 'little-dizzy'
14
+
15
+ const items = [
16
+ { image: 'https://picsum.photos/800/300?random=1', title: '图片 1' },
17
+ { image: 'https://picsum.photos/800/300?random=2', title: '图片 2' },
18
+ { image: 'https://picsum.photos/800/300?random=3', title: '图片 3' }
19
+ ]
20
+ </script>`
21
+ }
22
+
@@ -8,17 +8,25 @@ import buttonSnippet from './button.js'
8
8
  import cardSnippet from './card.js'
9
9
  import modalSnippet from './modal.js'
10
10
  import messageSnippet from './message.js'
11
+ import carouselSnippet from './carousel.js'
12
+ import loadingSnippet from './loading.js'
13
+ import tableSnippet from './table.js'
14
+ import backtopSnippet from './backtop.js'
11
15
 
12
16
  // 所有预设代码片段
13
17
  export const presetSnippets = [
14
18
  buttonSnippet,
15
19
  cardSnippet,
16
20
  modalSnippet,
17
- messageSnippet
21
+ messageSnippet,
22
+ carouselSnippet,
23
+ loadingSnippet,
24
+ tableSnippet,
25
+ backtopSnippet
18
26
  ]
19
27
 
20
28
  // 单独导出
21
- export { buttonSnippet, cardSnippet, modalSnippet, messageSnippet }
29
+ export { buttonSnippet, cardSnippet, modalSnippet, messageSnippet, carouselSnippet, loadingSnippet, tableSnippet, backtopSnippet }
22
30
 
23
31
  export default presetSnippets
24
32
 
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Loading 加载组件示例代码
3
+ */
4
+ export default {
5
+ name: 'Loading',
6
+ type: 'vue',
7
+ label: 'Loading 加载',
8
+ code: `<template>
9
+ <Loading type="spinner" />
10
+ <Loading type="dots" />
11
+ <Loading type="ring" />
12
+ <Loading type="pulse" />
13
+ <Loading type="bars" />
14
+ </template>
15
+
16
+ <script setup>
17
+ import { Loading } from 'little-dizzy'
18
+ </script>`
19
+ }
20
+
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Table 表格组件示例代码
3
+ */
4
+ export default {
5
+ name: 'Table',
6
+ type: 'vue',
7
+ label: 'Table 表格',
8
+ code: `<template>
9
+ <Table :columns="columns" :data="data" bordered striped />
10
+ </template>
11
+
12
+ <script setup>
13
+ import { Table } from 'little-dizzy'
14
+
15
+ const columns = [
16
+ { key: 'name', title: '姓名', width: '120px' },
17
+ { key: 'age', title: '年龄', width: '80px' },
18
+ { key: 'address', title: '地址' }
19
+ ]
20
+
21
+ const data = [
22
+ { name: '张三', age: 28, address: '北京市朝阳区' },
23
+ { name: '李四', age: 32, address: '上海市浦东新区' },
24
+ { name: '王五', age: 25, address: '广州市天河区' }
25
+ ]
26
+ </script>`
27
+ }
28
+