Skip to content

Commit 0c1c245

Browse files
author
Guillaume Chau
committed
feat(ui): Webpack addon: progress status icon
1 parent 53d5d4e commit 0c1c245

File tree

1 file changed

+80
-1
lines changed

1 file changed

+80
-1
lines changed

packages/@vue/cli-ui-addon-webpack/src/components/BuildProgress.vue

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@
1111
{{ typeof progress === 'number' ? Math.round(progress * 100) : 0 }}
1212
</div>
1313

14+
<transition duration="500">
15+
<div v-if="status === 'Success'" class="status-icon done">
16+
<div class="wrapper">
17+
<VueIcon icon="check_circle"/>
18+
</div>
19+
</div>
20+
</transition>
21+
22+
<transition duration="500">
23+
<div v-if="status === 'Failed'" class="status-icon error">
24+
<div class="wrapper">
25+
<VueIcon icon="error"/>
26+
</div>
27+
</div>
28+
</transition>
29+
1430
<div class="operations">
1531
<span v-if="operations">{{ operations }}</span>
1632
<VueIcon
@@ -35,6 +51,7 @@ export default {
3551
3652
sharedData () {
3753
return mapSharedData('webpack-dashboard-', {
54+
status: `${this.mode}-status`,
3855
progress: `${this.mode}-progress`,
3956
operations: `${this.mode}-operations`
4057
})
@@ -65,7 +82,8 @@ export default {
6582
&:first-letter
6683
text-transform uppercase
6784
68-
.progress
85+
.progress,
86+
.status-icon
6987
h-box()
7088
box-center()
7189
flex none
@@ -74,7 +92,68 @@ export default {
7492
left 0
7593
width 100%
7694
height 178px
95+
96+
.progress
7797
color lighten($vue-ui-color-dark, 60%)
7898
font-weight lighter
7999
font-size 42px
100+
101+
.status-icon
102+
.wrapper
103+
position relative
104+
.vue-ui-icon
105+
width 64px
106+
height @width
107+
position relative
108+
z-index 2
109+
display block
110+
&::before,
111+
&::after
112+
display block
113+
content ''
114+
border-radius 50%
115+
position absolute
116+
&::before
117+
top -36px
118+
left @top
119+
width 136px
120+
height @width
121+
&::after
122+
background white
123+
top 7px
124+
left @top
125+
width 50px
126+
height @width
127+
z-index 1
128+
&.done
129+
.wrapper::before
130+
background $vue-ui-color-success
131+
>>> svg
132+
fill $vue-ui-color-success
133+
&.error
134+
.wrapper::before
135+
background $vue-ui-color-danger
136+
>>> svg
137+
fill $vue-ui-color-danger
138+
&.v-enter-active,
139+
&.v-leave-active
140+
transition transform .5s cubic-bezier(0, 1, .3, 1), opacity .2s
141+
.wrapper::after
142+
transition opacity .2s
143+
.vue-ui-icon
144+
transition visibility 0
145+
&.v-enter-active
146+
.wrapper::after,
147+
.vue-ui-icon
148+
transition-delay .3s
149+
&.v-enter,
150+
&.v-leave-to
151+
transform scale(0)
152+
.wrapper::after
153+
opacity 0
154+
&.v-enter
155+
.vue-ui-icon
156+
visibility hidden
157+
&.v-leave-to
158+
opacity 0
80159
</style>

0 commit comments

Comments
 (0)