@cyberpunk-vue/theme-chalk 1.14.0 → 1.14.2
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/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +1 -1
- package/src/common/var.scss +247 -247
- package/src/components/avatar-group.scss +113 -113
- package/src/components/avatar.scss +123 -123
- package/src/components/badge.scss +210 -210
- package/src/components/breadcrumb.scss +203 -203
- package/src/components/button.scss +975 -975
- package/src/components/card.scss +699 -696
- package/src/components/checkbox-group.scss +22 -22
- package/src/components/checkbox.scss +320 -320
- package/src/components/col.scss +43 -43
- package/src/components/dialog.scss +360 -360
- package/src/components/divider.scss +250 -250
- package/src/components/empty.scss +99 -99
- package/src/components/form-item.scss +189 -189
- package/src/components/form.scss +59 -59
- package/src/components/icon.scss +83 -83
- package/src/components/image-preview.scss +147 -147
- package/src/components/image.scss +351 -351
- package/src/components/input-number.scss +129 -129
- package/src/components/input.scss +362 -362
- package/src/components/loading.scss +64 -64
- package/src/components/notification.scss +348 -348
- package/src/components/pagination.scss +287 -280
- package/src/components/pattern-background.scss +18 -18
- package/src/components/popover.scss +438 -438
- package/src/components/progress.scss +438 -438
- package/src/components/radio-group.scss +22 -22
- package/src/components/radio.scss +286 -286
- package/src/components/row.scss +12 -12
- package/src/components/scrollbar.scss +40 -40
- package/src/components/segmented.scss +566 -566
- package/src/components/select.scss +15 -1
- package/src/components/slider.scss +421 -421
- package/src/components/status-indicator.scss +206 -206
- package/src/components/switch.scss +405 -405
- package/src/components/table.scss +474 -474
- package/src/components/tag.scss +416 -416
- package/src/components/text.scss +310 -271
- package/src/components/textarea.scss +106 -104
- package/src/components/timeline.scss +379 -379
- package/src/components/tree.scss +397 -397
- package/src/components/upload.scss +509 -509
- package/src/index.scss +60 -60
- package/src/mixins/mixins.scss +156 -156
|
@@ -1,379 +1,379 @@
|
|
|
1
|
-
// CpTimeline & CpTimelineItem 组件样式
|
|
2
|
-
// 赛博朋克风格时间轴
|
|
3
|
-
|
|
4
|
-
@use 'sass:map';
|
|
5
|
-
@use '../common/var' as *;
|
|
6
|
-
@use '../mixins/mixins' as *;
|
|
7
|
-
|
|
8
|
-
// 节点尺寸映射
|
|
9
|
-
$timeline-dot-sizes: (
|
|
10
|
-
sm: 10px,
|
|
11
|
-
md: 14px,
|
|
12
|
-
lg: 18px,
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
// 图标尺寸映射
|
|
16
|
-
$timeline-icon-sizes: (
|
|
17
|
-
sm: 20px,
|
|
18
|
-
md: 26px,
|
|
19
|
-
lg: 32px,
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
// 字体尺寸映射
|
|
23
|
-
$timeline-font-sizes: (
|
|
24
|
-
sm: 12px,
|
|
25
|
-
md: 13px,
|
|
26
|
-
lg: 14px,
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
@include b(timeline) {
|
|
30
|
-
// CSS 变量默认值
|
|
31
|
-
--cp-timeline-color: var(--cp-text-secondary);
|
|
32
|
-
--cp-timeline-line-color: var(--cp-border);
|
|
33
|
-
--cp-timeline-line-style: solid;
|
|
34
|
-
--cp-timeline-line-width: 2px;
|
|
35
|
-
// 轴线定位基准尺寸(容器级常量,不随子项变化)
|
|
36
|
-
--cp-timeline-axis-size: #{map.get($timeline-icon-sizes, lg)};
|
|
37
|
-
--cp-timeline-dot-size: 14px;
|
|
38
|
-
--cp-timeline-gap: 24px;
|
|
39
|
-
--cp-timeline-content-gap: 16px;
|
|
40
|
-
--cp-timeline-animation-duration: 1.5s;
|
|
41
|
-
--cp-timeline-animation-intensity: 1;
|
|
42
|
-
|
|
43
|
-
list-style: none;
|
|
44
|
-
margin: 0;
|
|
45
|
-
padding: 0;
|
|
46
|
-
position: relative;
|
|
47
|
-
|
|
48
|
-
// ===== 时间轴子项 =====
|
|
49
|
-
@include e(item) {
|
|
50
|
-
position: relative;
|
|
51
|
-
display: flex;
|
|
52
|
-
gap: var(--cp-timeline-content-gap);
|
|
53
|
-
padding-bottom: var(--cp-timeline-gap);
|
|
54
|
-
min-height: 60px;
|
|
55
|
-
|
|
56
|
-
// 最后一项不需要间距
|
|
57
|
-
&:last-child {
|
|
58
|
-
padding-bottom: 0;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// ===== 尺寸(只影响节点视觉大小,不影响轴线位置) =====
|
|
62
|
-
@each $name, $size in $timeline-dot-sizes {
|
|
63
|
-
&.is-#{$name} {
|
|
64
|
-
--cp-timeline-dot-size: #{$size};
|
|
65
|
-
|
|
66
|
-
.cp-timeline__item-icon {
|
|
67
|
-
width: map.get($timeline-icon-sizes, $name);
|
|
68
|
-
height: map.get($timeline-icon-sizes, $name);
|
|
69
|
-
font-size: calc(#{map.get($timeline-icon-sizes, $name)} * 0.56);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.cp-timeline__item-timestamp {
|
|
73
|
-
font-size: map.get($timeline-font-sizes, $name);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// ===== 颜色类型 =====
|
|
79
|
-
&.is-primary {
|
|
80
|
-
--cp-timeline-item-color: var(--cp-color-primary);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
&.is-success {
|
|
84
|
-
--cp-timeline-item-color: var(--cp-color-success);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
&.is-warning {
|
|
88
|
-
--cp-timeline-item-color: var(--cp-color-warning);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
&.is-error {
|
|
92
|
-
--cp-timeline-item-color: var(--cp-color-error);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&.is-info {
|
|
96
|
-
--cp-timeline-item-color: var(--cp-color-info);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
&.is-default {
|
|
100
|
-
--cp-timeline-item-color: var(--cp-text-secondary);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// ===== 自定义颜色 =====
|
|
104
|
-
@include when(custom-color) {
|
|
105
|
-
.cp-timeline__item-node {
|
|
106
|
-
background-color: var(--cp-timeline-item-color);
|
|
107
|
-
border-color: var(--cp-timeline-item-color);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.cp-timeline__item-icon {
|
|
111
|
-
background-color: var(--cp-timeline-item-color);
|
|
112
|
-
border-color: var(--cp-timeline-item-color);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.cp-timeline__item-pulse {
|
|
116
|
-
background-color: var(--cp-timeline-item-color);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// ===== 空心节点 =====
|
|
121
|
-
@include when(hollow) {
|
|
122
|
-
.cp-timeline__item-node {
|
|
123
|
-
background-color: var(--cp-bg-base, #0a0a14);
|
|
124
|
-
border: 2px solid var(--cp-timeline-item-color, var(--cp-text-secondary));
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// ===== 图标节点 =====
|
|
129
|
-
@include when(has-icon) {
|
|
130
|
-
.cp-timeline__item-node {
|
|
131
|
-
display: none;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// ===== 激活态 =====
|
|
136
|
-
@include when(active) {
|
|
137
|
-
.cp-timeline__item-node,
|
|
138
|
-
.cp-timeline__item-icon {
|
|
139
|
-
box-shadow:
|
|
140
|
-
0 0 6px var(--cp-timeline-item-color, var(--cp-text-secondary)),
|
|
141
|
-
0 0 14px color-mix(in srgb, var(--cp-timeline-item-color, var(--cp-text-secondary)) 40%, transparent);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.cp-timeline__item-body {
|
|
145
|
-
color: var(--cp-text-primary);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// ===== 动画 - 发光呼吸 =====
|
|
150
|
-
&.is-animation-glow {
|
|
151
|
-
.cp-timeline__item-node,
|
|
152
|
-
.cp-timeline__item-icon {
|
|
153
|
-
animation: cp-timeline-glow var(--cp-timeline-animation-duration) ease-in-out infinite;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// ===== 动画 - 闪烁 =====
|
|
158
|
-
&.is-animation-blink {
|
|
159
|
-
.cp-timeline__item-node,
|
|
160
|
-
.cp-timeline__item-icon {
|
|
161
|
-
animation: cp-timeline-blink var(--cp-timeline-animation-duration) ease-in-out infinite;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// ===== 连线(尾巴)=====
|
|
167
|
-
// 始终基于 axis-size 定位,保证轴线在不同节点大小下稳定
|
|
168
|
-
@include e(item-tail) {
|
|
169
|
-
position: absolute;
|
|
170
|
-
// 从当前节点的正中心开始
|
|
171
|
-
top: calc(var(--cp-timeline-axis-size) / 2);
|
|
172
|
-
// 高度延伸该项目的总高度(等于一直画到下一个节点的正中心)
|
|
173
|
-
height: 100%;
|
|
174
|
-
// 基于 axis-size 居中(容器级常量)
|
|
175
|
-
left: calc(var(--cp-timeline-axis-size) / 2 - var(--cp-timeline-line-width) / 2);
|
|
176
|
-
width: var(--cp-timeline-line-width);
|
|
177
|
-
border-left: var(--cp-timeline-line-width) var(--cp-timeline-line-style) var(--cp-timeline-line-color);
|
|
178
|
-
|
|
179
|
-
// 最后一项隐藏连线
|
|
180
|
-
.cp-timeline__item:last-child & {
|
|
181
|
-
display: none;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// ===== 节点容器 =====
|
|
186
|
-
// 固定宽度为 axis-size,使所有节点(无论大小)都居中对齐在轴线上
|
|
187
|
-
@include e(item-dot) {
|
|
188
|
-
position: relative;
|
|
189
|
-
display: flex;
|
|
190
|
-
align-items: center;
|
|
191
|
-
justify-content: center;
|
|
192
|
-
flex-shrink: 0;
|
|
193
|
-
z-index: 1;
|
|
194
|
-
width: var(--cp-timeline-axis-size);
|
|
195
|
-
height: var(--cp-timeline-axis-size);
|
|
196
|
-
// 微调使节点中心对齐第一行文版基线
|
|
197
|
-
margin-top: 0px;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// ===== 圆点背景遮罩 =====
|
|
201
|
-
@include e(item-mask) {
|
|
202
|
-
position: absolute;
|
|
203
|
-
width: var(--cp-timeline-dot-size);
|
|
204
|
-
height: var(--cp-timeline-dot-size);
|
|
205
|
-
border-radius: 50%;
|
|
206
|
-
background-color: var(--cp-bg-base, #101014); // 默认底层背景色
|
|
207
|
-
z-index: 0;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// ===== 节点圆点 =====
|
|
211
|
-
@include e(item-node) {
|
|
212
|
-
width: var(--cp-timeline-dot-size);
|
|
213
|
-
height: var(--cp-timeline-dot-size);
|
|
214
|
-
border-radius: 50%;
|
|
215
|
-
background-color: var(--cp-timeline-item-color, var(--cp-text-secondary));
|
|
216
|
-
transition: all 0.3s ease;
|
|
217
|
-
position: relative;
|
|
218
|
-
z-index: 1;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// ===== 图标节点 =====
|
|
222
|
-
@include e(item-icon) {
|
|
223
|
-
display: flex;
|
|
224
|
-
align-items: center;
|
|
225
|
-
justify-content: center;
|
|
226
|
-
border-radius: 50%;
|
|
227
|
-
background-color: var(--cp-timeline-item-color, var(--cp-text-secondary));
|
|
228
|
-
color: var(--cp-text-on-bright);
|
|
229
|
-
transition: all 0.3s ease;
|
|
230
|
-
position: relative;
|
|
231
|
-
z-index: 1;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// ===== 脉冲动画元素 =====
|
|
235
|
-
@include e(item-pulse) {
|
|
236
|
-
position: absolute;
|
|
237
|
-
width: var(--cp-timeline-dot-size);
|
|
238
|
-
height: var(--cp-timeline-dot-size);
|
|
239
|
-
border-radius: 50%;
|
|
240
|
-
background-color: var(--cp-timeline-item-color, var(--cp-text-secondary));
|
|
241
|
-
animation: cp-timeline-pulse var(--cp-timeline-animation-duration) ease-out infinite;
|
|
242
|
-
z-index: 0;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// ===== 内容区域 =====
|
|
246
|
-
@include e(item-content) {
|
|
247
|
-
flex: 1;
|
|
248
|
-
min-width: 0;
|
|
249
|
-
// 垂直居中对齐到节点中心
|
|
250
|
-
padding-top: calc((var(--cp-timeline-axis-size) - 1.6em) / 2);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// ===== 主内容 =====
|
|
254
|
-
@include e(item-body) {
|
|
255
|
-
font-size: 14px;
|
|
256
|
-
color: var(--cp-text-primary);
|
|
257
|
-
line-height: 1.6;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
// ===== 附加区域 =====
|
|
261
|
-
@include e(item-extra) {
|
|
262
|
-
margin-top: 8px;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// ===== 时间戳 =====
|
|
266
|
-
@include e(item-timestamp) {
|
|
267
|
-
font-size: 13px;
|
|
268
|
-
color: var(--cp-text-muted);
|
|
269
|
-
font-family: var(--cp-font-family-mono);
|
|
270
|
-
letter-spacing: 0.02em;
|
|
271
|
-
line-height: 1.4;
|
|
272
|
-
margin-top: 4px;
|
|
273
|
-
margin-bottom: 4px;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// ===== 排列模式 =====
|
|
277
|
-
|
|
278
|
-
// 左对齐(默认) — tail 已经由 axis-size 居中,无需额外调整
|
|
279
|
-
@include m(mode-left) {
|
|
280
|
-
// 默认即可
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
// 右对齐
|
|
284
|
-
@include m(mode-right) {
|
|
285
|
-
.cp-timeline__item {
|
|
286
|
-
flex-direction: row-reverse;
|
|
287
|
-
text-align: right;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
.cp-timeline__item-tail {
|
|
291
|
-
left: auto;
|
|
292
|
-
right: calc(var(--cp-timeline-axis-size) / 2 - var(--cp-timeline-line-width) / 2);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// 交替排列
|
|
297
|
-
@include m(mode-alternate) {
|
|
298
|
-
.cp-timeline__item {
|
|
299
|
-
justify-content: flex-start;
|
|
300
|
-
width: 100%;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.cp-timeline__item-tail {
|
|
304
|
-
left: calc(50% - var(--cp-timeline-line-width) / 2);
|
|
305
|
-
transform: none;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.cp-timeline__item-dot {
|
|
309
|
-
position: absolute;
|
|
310
|
-
left: calc(50% - var(--cp-timeline-axis-size) / 2);
|
|
311
|
-
transform: none;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
.cp-timeline__item-content {
|
|
315
|
-
width: calc(50% - var(--cp-timeline-content-gap) - var(--cp-timeline-axis-size) / 2);
|
|
316
|
-
flex: none;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
// 奇数项(内容在右侧)
|
|
320
|
-
.cp-timeline__item:nth-child(odd) {
|
|
321
|
-
justify-content: flex-end;
|
|
322
|
-
text-align: left;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
// 偶数项(内容在左侧)
|
|
326
|
-
.cp-timeline__item:nth-child(even) {
|
|
327
|
-
justify-content: flex-start;
|
|
328
|
-
text-align: right;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
// ===== 倒序 =====
|
|
333
|
-
@include when(reverse) {
|
|
334
|
-
display: flex;
|
|
335
|
-
flex-direction: column;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// ===== 动画关键帧 =====
|
|
340
|
-
|
|
341
|
-
// 脉冲扩散
|
|
342
|
-
@keyframes cp-timeline-pulse {
|
|
343
|
-
0% {
|
|
344
|
-
transform: scale(1);
|
|
345
|
-
opacity: 0.6;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
100% {
|
|
349
|
-
transform: scale(calc(1 + 1.5 * var(--cp-timeline-animation-intensity, 1)));
|
|
350
|
-
opacity: 0;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
// 发光呼吸
|
|
355
|
-
@keyframes cp-timeline-glow {
|
|
356
|
-
0%,
|
|
357
|
-
100% {
|
|
358
|
-
filter: drop-shadow(0 0 calc(2px * var(--cp-timeline-animation-intensity, 1)) currentColor);
|
|
359
|
-
opacity: 1;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
50% {
|
|
363
|
-
filter: drop-shadow(0 0 calc(8px * var(--cp-timeline-animation-intensity, 1)) currentColor)
|
|
364
|
-
drop-shadow(0 0 calc(12px * var(--cp-timeline-animation-intensity, 1)) currentColor);
|
|
365
|
-
opacity: 0.85;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
// 闪烁
|
|
370
|
-
@keyframes cp-timeline-blink {
|
|
371
|
-
0%,
|
|
372
|
-
100% {
|
|
373
|
-
opacity: 1;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
50% {
|
|
377
|
-
opacity: calc(0.3 / var(--cp-timeline-animation-intensity, 1));
|
|
378
|
-
}
|
|
379
|
-
}
|
|
1
|
+
// CpTimeline & CpTimelineItem 组件样式
|
|
2
|
+
// 赛博朋克风格时间轴
|
|
3
|
+
|
|
4
|
+
@use 'sass:map';
|
|
5
|
+
@use '../common/var' as *;
|
|
6
|
+
@use '../mixins/mixins' as *;
|
|
7
|
+
|
|
8
|
+
// 节点尺寸映射
|
|
9
|
+
$timeline-dot-sizes: (
|
|
10
|
+
sm: 10px,
|
|
11
|
+
md: 14px,
|
|
12
|
+
lg: 18px,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
// 图标尺寸映射
|
|
16
|
+
$timeline-icon-sizes: (
|
|
17
|
+
sm: 20px,
|
|
18
|
+
md: 26px,
|
|
19
|
+
lg: 32px,
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
// 字体尺寸映射
|
|
23
|
+
$timeline-font-sizes: (
|
|
24
|
+
sm: 12px,
|
|
25
|
+
md: 13px,
|
|
26
|
+
lg: 14px,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
@include b(timeline) {
|
|
30
|
+
// CSS 变量默认值
|
|
31
|
+
--cp-timeline-color: var(--cp-text-secondary);
|
|
32
|
+
--cp-timeline-line-color: var(--cp-border);
|
|
33
|
+
--cp-timeline-line-style: solid;
|
|
34
|
+
--cp-timeline-line-width: 2px;
|
|
35
|
+
// 轴线定位基准尺寸(容器级常量,不随子项变化)
|
|
36
|
+
--cp-timeline-axis-size: #{map.get($timeline-icon-sizes, lg)};
|
|
37
|
+
--cp-timeline-dot-size: 14px;
|
|
38
|
+
--cp-timeline-gap: 24px;
|
|
39
|
+
--cp-timeline-content-gap: 16px;
|
|
40
|
+
--cp-timeline-animation-duration: 1.5s;
|
|
41
|
+
--cp-timeline-animation-intensity: 1;
|
|
42
|
+
|
|
43
|
+
list-style: none;
|
|
44
|
+
margin: 0;
|
|
45
|
+
padding: 0;
|
|
46
|
+
position: relative;
|
|
47
|
+
|
|
48
|
+
// ===== 时间轴子项 =====
|
|
49
|
+
@include e(item) {
|
|
50
|
+
position: relative;
|
|
51
|
+
display: flex;
|
|
52
|
+
gap: var(--cp-timeline-content-gap);
|
|
53
|
+
padding-bottom: var(--cp-timeline-gap);
|
|
54
|
+
min-height: 60px;
|
|
55
|
+
|
|
56
|
+
// 最后一项不需要间距
|
|
57
|
+
&:last-child {
|
|
58
|
+
padding-bottom: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ===== 尺寸(只影响节点视觉大小,不影响轴线位置) =====
|
|
62
|
+
@each $name, $size in $timeline-dot-sizes {
|
|
63
|
+
&.is-#{$name} {
|
|
64
|
+
--cp-timeline-dot-size: #{$size};
|
|
65
|
+
|
|
66
|
+
.cp-timeline__item-icon {
|
|
67
|
+
width: map.get($timeline-icon-sizes, $name);
|
|
68
|
+
height: map.get($timeline-icon-sizes, $name);
|
|
69
|
+
font-size: calc(#{map.get($timeline-icon-sizes, $name)} * 0.56);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.cp-timeline__item-timestamp {
|
|
73
|
+
font-size: map.get($timeline-font-sizes, $name);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ===== 颜色类型 =====
|
|
79
|
+
&.is-primary {
|
|
80
|
+
--cp-timeline-item-color: var(--cp-color-primary);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&.is-success {
|
|
84
|
+
--cp-timeline-item-color: var(--cp-color-success);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&.is-warning {
|
|
88
|
+
--cp-timeline-item-color: var(--cp-color-warning);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&.is-error {
|
|
92
|
+
--cp-timeline-item-color: var(--cp-color-error);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&.is-info {
|
|
96
|
+
--cp-timeline-item-color: var(--cp-color-info);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&.is-default {
|
|
100
|
+
--cp-timeline-item-color: var(--cp-text-secondary);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// ===== 自定义颜色 =====
|
|
104
|
+
@include when(custom-color) {
|
|
105
|
+
.cp-timeline__item-node {
|
|
106
|
+
background-color: var(--cp-timeline-item-color);
|
|
107
|
+
border-color: var(--cp-timeline-item-color);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.cp-timeline__item-icon {
|
|
111
|
+
background-color: var(--cp-timeline-item-color);
|
|
112
|
+
border-color: var(--cp-timeline-item-color);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.cp-timeline__item-pulse {
|
|
116
|
+
background-color: var(--cp-timeline-item-color);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// ===== 空心节点 =====
|
|
121
|
+
@include when(hollow) {
|
|
122
|
+
.cp-timeline__item-node {
|
|
123
|
+
background-color: var(--cp-bg-base, #0a0a14);
|
|
124
|
+
border: 2px solid var(--cp-timeline-item-color, var(--cp-text-secondary));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// ===== 图标节点 =====
|
|
129
|
+
@include when(has-icon) {
|
|
130
|
+
.cp-timeline__item-node {
|
|
131
|
+
display: none;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// ===== 激活态 =====
|
|
136
|
+
@include when(active) {
|
|
137
|
+
.cp-timeline__item-node,
|
|
138
|
+
.cp-timeline__item-icon {
|
|
139
|
+
box-shadow:
|
|
140
|
+
0 0 6px var(--cp-timeline-item-color, var(--cp-text-secondary)),
|
|
141
|
+
0 0 14px color-mix(in srgb, var(--cp-timeline-item-color, var(--cp-text-secondary)) 40%, transparent);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.cp-timeline__item-body {
|
|
145
|
+
color: var(--cp-text-primary);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// ===== 动画 - 发光呼吸 =====
|
|
150
|
+
&.is-animation-glow {
|
|
151
|
+
.cp-timeline__item-node,
|
|
152
|
+
.cp-timeline__item-icon {
|
|
153
|
+
animation: cp-timeline-glow var(--cp-timeline-animation-duration) ease-in-out infinite;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// ===== 动画 - 闪烁 =====
|
|
158
|
+
&.is-animation-blink {
|
|
159
|
+
.cp-timeline__item-node,
|
|
160
|
+
.cp-timeline__item-icon {
|
|
161
|
+
animation: cp-timeline-blink var(--cp-timeline-animation-duration) ease-in-out infinite;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// ===== 连线(尾巴)=====
|
|
167
|
+
// 始终基于 axis-size 定位,保证轴线在不同节点大小下稳定
|
|
168
|
+
@include e(item-tail) {
|
|
169
|
+
position: absolute;
|
|
170
|
+
// 从当前节点的正中心开始
|
|
171
|
+
top: calc(var(--cp-timeline-axis-size) / 2);
|
|
172
|
+
// 高度延伸该项目的总高度(等于一直画到下一个节点的正中心)
|
|
173
|
+
height: 100%;
|
|
174
|
+
// 基于 axis-size 居中(容器级常量)
|
|
175
|
+
left: calc(var(--cp-timeline-axis-size) / 2 - var(--cp-timeline-line-width) / 2);
|
|
176
|
+
width: var(--cp-timeline-line-width);
|
|
177
|
+
border-left: var(--cp-timeline-line-width) var(--cp-timeline-line-style) var(--cp-timeline-line-color);
|
|
178
|
+
|
|
179
|
+
// 最后一项隐藏连线
|
|
180
|
+
.cp-timeline__item:last-child & {
|
|
181
|
+
display: none;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// ===== 节点容器 =====
|
|
186
|
+
// 固定宽度为 axis-size,使所有节点(无论大小)都居中对齐在轴线上
|
|
187
|
+
@include e(item-dot) {
|
|
188
|
+
position: relative;
|
|
189
|
+
display: flex;
|
|
190
|
+
align-items: center;
|
|
191
|
+
justify-content: center;
|
|
192
|
+
flex-shrink: 0;
|
|
193
|
+
z-index: 1;
|
|
194
|
+
width: var(--cp-timeline-axis-size);
|
|
195
|
+
height: var(--cp-timeline-axis-size);
|
|
196
|
+
// 微调使节点中心对齐第一行文版基线
|
|
197
|
+
margin-top: 0px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// ===== 圆点背景遮罩 =====
|
|
201
|
+
@include e(item-mask) {
|
|
202
|
+
position: absolute;
|
|
203
|
+
width: var(--cp-timeline-dot-size);
|
|
204
|
+
height: var(--cp-timeline-dot-size);
|
|
205
|
+
border-radius: 50%;
|
|
206
|
+
background-color: var(--cp-bg-base, #101014); // 默认底层背景色
|
|
207
|
+
z-index: 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// ===== 节点圆点 =====
|
|
211
|
+
@include e(item-node) {
|
|
212
|
+
width: var(--cp-timeline-dot-size);
|
|
213
|
+
height: var(--cp-timeline-dot-size);
|
|
214
|
+
border-radius: 50%;
|
|
215
|
+
background-color: var(--cp-timeline-item-color, var(--cp-text-secondary));
|
|
216
|
+
transition: all 0.3s ease;
|
|
217
|
+
position: relative;
|
|
218
|
+
z-index: 1;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// ===== 图标节点 =====
|
|
222
|
+
@include e(item-icon) {
|
|
223
|
+
display: flex;
|
|
224
|
+
align-items: center;
|
|
225
|
+
justify-content: center;
|
|
226
|
+
border-radius: 50%;
|
|
227
|
+
background-color: var(--cp-timeline-item-color, var(--cp-text-secondary));
|
|
228
|
+
color: var(--cp-text-on-bright);
|
|
229
|
+
transition: all 0.3s ease;
|
|
230
|
+
position: relative;
|
|
231
|
+
z-index: 1;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// ===== 脉冲动画元素 =====
|
|
235
|
+
@include e(item-pulse) {
|
|
236
|
+
position: absolute;
|
|
237
|
+
width: var(--cp-timeline-dot-size);
|
|
238
|
+
height: var(--cp-timeline-dot-size);
|
|
239
|
+
border-radius: 50%;
|
|
240
|
+
background-color: var(--cp-timeline-item-color, var(--cp-text-secondary));
|
|
241
|
+
animation: cp-timeline-pulse var(--cp-timeline-animation-duration) ease-out infinite;
|
|
242
|
+
z-index: 0;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// ===== 内容区域 =====
|
|
246
|
+
@include e(item-content) {
|
|
247
|
+
flex: 1;
|
|
248
|
+
min-width: 0;
|
|
249
|
+
// 垂直居中对齐到节点中心
|
|
250
|
+
padding-top: calc((var(--cp-timeline-axis-size) - 1.6em) / 2);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// ===== 主内容 =====
|
|
254
|
+
@include e(item-body) {
|
|
255
|
+
font-size: 14px;
|
|
256
|
+
color: var(--cp-text-primary);
|
|
257
|
+
line-height: 1.6;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// ===== 附加区域 =====
|
|
261
|
+
@include e(item-extra) {
|
|
262
|
+
margin-top: 8px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// ===== 时间戳 =====
|
|
266
|
+
@include e(item-timestamp) {
|
|
267
|
+
font-size: 13px;
|
|
268
|
+
color: var(--cp-text-muted);
|
|
269
|
+
font-family: var(--cp-font-family-mono);
|
|
270
|
+
letter-spacing: 0.02em;
|
|
271
|
+
line-height: 1.4;
|
|
272
|
+
margin-top: 4px;
|
|
273
|
+
margin-bottom: 4px;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// ===== 排列模式 =====
|
|
277
|
+
|
|
278
|
+
// 左对齐(默认) — tail 已经由 axis-size 居中,无需额外调整
|
|
279
|
+
@include m(mode-left) {
|
|
280
|
+
// 默认即可
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// 右对齐
|
|
284
|
+
@include m(mode-right) {
|
|
285
|
+
.cp-timeline__item {
|
|
286
|
+
flex-direction: row-reverse;
|
|
287
|
+
text-align: right;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.cp-timeline__item-tail {
|
|
291
|
+
left: auto;
|
|
292
|
+
right: calc(var(--cp-timeline-axis-size) / 2 - var(--cp-timeline-line-width) / 2);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// 交替排列
|
|
297
|
+
@include m(mode-alternate) {
|
|
298
|
+
.cp-timeline__item {
|
|
299
|
+
justify-content: flex-start;
|
|
300
|
+
width: 100%;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.cp-timeline__item-tail {
|
|
304
|
+
left: calc(50% - var(--cp-timeline-line-width) / 2);
|
|
305
|
+
transform: none;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.cp-timeline__item-dot {
|
|
309
|
+
position: absolute;
|
|
310
|
+
left: calc(50% - var(--cp-timeline-axis-size) / 2);
|
|
311
|
+
transform: none;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.cp-timeline__item-content {
|
|
315
|
+
width: calc(50% - var(--cp-timeline-content-gap) - var(--cp-timeline-axis-size) / 2);
|
|
316
|
+
flex: none;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// 奇数项(内容在右侧)
|
|
320
|
+
.cp-timeline__item:nth-child(odd) {
|
|
321
|
+
justify-content: flex-end;
|
|
322
|
+
text-align: left;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// 偶数项(内容在左侧)
|
|
326
|
+
.cp-timeline__item:nth-child(even) {
|
|
327
|
+
justify-content: flex-start;
|
|
328
|
+
text-align: right;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// ===== 倒序 =====
|
|
333
|
+
@include when(reverse) {
|
|
334
|
+
display: flex;
|
|
335
|
+
flex-direction: column;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// ===== 动画关键帧 =====
|
|
340
|
+
|
|
341
|
+
// 脉冲扩散
|
|
342
|
+
@keyframes cp-timeline-pulse {
|
|
343
|
+
0% {
|
|
344
|
+
transform: scale(1);
|
|
345
|
+
opacity: 0.6;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
100% {
|
|
349
|
+
transform: scale(calc(1 + 1.5 * var(--cp-timeline-animation-intensity, 1)));
|
|
350
|
+
opacity: 0;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// 发光呼吸
|
|
355
|
+
@keyframes cp-timeline-glow {
|
|
356
|
+
0%,
|
|
357
|
+
100% {
|
|
358
|
+
filter: drop-shadow(0 0 calc(2px * var(--cp-timeline-animation-intensity, 1)) currentColor);
|
|
359
|
+
opacity: 1;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
50% {
|
|
363
|
+
filter: drop-shadow(0 0 calc(8px * var(--cp-timeline-animation-intensity, 1)) currentColor)
|
|
364
|
+
drop-shadow(0 0 calc(12px * var(--cp-timeline-animation-intensity, 1)) currentColor);
|
|
365
|
+
opacity: 0.85;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// 闪烁
|
|
370
|
+
@keyframes cp-timeline-blink {
|
|
371
|
+
0%,
|
|
372
|
+
100% {
|
|
373
|
+
opacity: 1;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
50% {
|
|
377
|
+
opacity: calc(0.3 / var(--cp-timeline-animation-intensity, 1));
|
|
378
|
+
}
|
|
379
|
+
}
|