1
1
<template >
2
- <div class =" build-progress" >
2
+ <div
3
+ class =" build-progress"
4
+ :class =" {
5
+ [`mode-${mode}`]: true
6
+ }"
7
+ >
3
8
<div class =" content" >
4
- <loading-progress
5
- :progress =" progress"
6
- size =" 128"
7
- counter-clockwise
8
- />
9
-
10
- <div class =" progress" >
11
- {{ typeof progress === 'number' ? Math.round(progress * 100) : 0 }}
12
- </div >
9
+ <div class =" progress-wrapper" >
10
+ <transition-group
11
+ name =" vue-ui-fade"
12
+ class =" progress-bars"
13
+ >
14
+ <div
15
+ v-for =" (key, index) of Object.keys(progress)"
16
+ :key =" key"
17
+ class =" progress-bar-wrapper"
18
+ >
19
+ <loading-progress
20
+ :key =" key"
21
+ :progress =" progress[key]"
22
+ :size =" 128 - 16 * index"
23
+ class =" progress-bar"
24
+ counter-clockwise
25
+ :class =" {
26
+ 'disable-animation': progress[key] === 0,
27
+ [`mode-${key}`]: true
28
+ }"
29
+ />
30
+ </div >
31
+ </transition-group >
13
32
14
- <transition duration =" 500" >
15
- <div v-if =" status === 'Success'" class =" status-icon done" >
16
- <div class =" wrapper" >
17
- <VueIcon icon =" check_circle" />
33
+ <div class =" progress" >
34
+ <div
35
+ class =" progress-animation"
36
+ :class =" {
37
+ active: status && status !== 'Idle'
38
+ }"
39
+ >
40
+ <div
41
+ v-for =" n in 4"
42
+ :key =" n"
43
+ class =" animation"
44
+ :style =" {
45
+ 'animation-delay': `${n * 0.25}s`
46
+ }"
47
+ />
18
48
</div >
19
49
</div >
20
- </transition >
21
50
22
- <transition duration =" 500" >
23
- <div v-if =" status === 'Failed'" class =" status-icon error" >
24
- <div class =" wrapper" >
25
- <VueIcon icon =" error" />
51
+ <transition duration =" 500" >
52
+ <div v-if =" status === 'Success'" class =" status-icon done" >
53
+ <div class =" wrapper" >
54
+ <VueIcon icon =" check_circle" />
55
+ </div >
26
56
</div >
27
- </div >
28
- </transition >
57
+ </transition >
58
+
59
+ <transition duration =" 500" >
60
+ <div v-if =" status === 'Failed'" class =" status-icon error" >
61
+ <div class =" wrapper" >
62
+ <VueIcon icon =" error" />
63
+ </div >
64
+ </div >
65
+ </transition >
66
+ </div >
29
67
30
68
<div class =" operations" >
31
69
<span v-if =" operations" >{{ operations }}</span >
43
81
import { mapGetters } from ' vuex'
44
82
45
83
export default {
46
- computed: {
47
- ... mapGetters ([
48
- ' mode'
49
- ])
50
- },
51
-
52
84
sharedData () {
53
85
return mapSharedData (' org.vue.webpack.' , {
54
86
status: ` ${ this .mode } -status` ,
55
- progress : ` ${ this .mode } -progress` ,
87
+ rawProgress : ` ${ this .mode } -progress` ,
56
88
operations: ` ${ this .mode } -operations`
57
89
})
90
+ },
91
+
92
+ computed: {
93
+ ... mapGetters ([
94
+ ' mode'
95
+ ]),
96
+
97
+ progress () {
98
+ const raw = this .rawProgress
99
+ return raw && Object .keys (raw).length ? raw : { unknown: 0 }
100
+ }
58
101
}
59
102
}
60
103
</script >
@@ -87,6 +130,12 @@ export default {
87
130
& :first -letter
88
131
text-transform uppercase
89
132
133
+ .progress-wrapper
134
+ width 178px
135
+ height @width
136
+ position relative
137
+
138
+ .progress-bar-wrapper ,
90
139
.progress ,
91
140
.status-icon
92
141
h-box ()
@@ -96,12 +145,36 @@ export default {
96
145
top 0
97
146
left 0
98
147
width 100%
99
- height 178px
148
+ height @width
149
+
150
+ .progress-bar
151
+ & .disable-animation
152
+ >>> path
153
+ transition none
154
+ & .mode-build-modern
155
+ >>> .progress
156
+ stroke $vue-ui-color-info
100
157
101
- .progress
102
- color lighten ($vue-ui-color-dark , 60% )
103
- font-weight lighter
104
- font-size 42px
158
+ .progress-animation
159
+ display grid
160
+ $size = 12px
161
+ grid-template-columns repeat (2 , $size )
162
+ grid-template-rows repeat (2 , $size )
163
+ grid-template-areas "z1 z4" "z2 z3"
164
+ grid-gap 12px
165
+ .animation
166
+ width 100%
167
+ height @width
168
+ border-radius 50%
169
+ background rgba (black, .1 )
170
+ transition background .15s
171
+ for n in (1 .. 4 )
172
+ & :nth-child ({ n } )
173
+ grid-area 'z%s' % n
174
+ & .active
175
+ .animation
176
+ background $vue-ui-color-primary
177
+ animation progress 1s infinite
105
178
106
179
.status-icon
107
180
.wrapper
@@ -161,4 +234,25 @@ export default {
161
234
opacity 0
162
235
& .v-leave-to
163
236
opacity 0
237
+
238
+ & .mode-build-modern
239
+ .progress-animation.active
240
+ .animation
241
+ background $vue-ui-color-info
242
+
243
+ .status-icon
244
+ & .done
245
+ .wrapper ::before
246
+ background $vue-ui-color-info
247
+ >>> svg
248
+ fill $vue-ui-color-info
249
+
250
+ @keyframes progress
251
+ 0% ,
252
+ 30%
253
+ transform none
254
+ 50%
255
+ transform scale (1.5 )
256
+ 80%
257
+ transform none
164
258
</style >
0 commit comments