Skip to content

Commit d8be386

Browse files
committed
fix(dialog-box): dialog pop-up mask layer animation is not working (#3636)
1 parent d3e0d35 commit d8be386

File tree

2 files changed

+60
-3
lines changed

2 files changed

+60
-3
lines changed

packages/theme/src/dialog-box/index.less

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@
205205
top: 0;
206206
width: 100%;
207207
height: 100%;
208-
background: var(--tv-DialogBox-mask-bg-color);
209208
}
210209

211210
.v-modal-enter {
@@ -230,10 +229,16 @@
230229

231230
.dialog-slideRight-enter-active {
232231
animation: slideRight 0.5s ease-in forwards;
232+
&.tiny-dialog-box__wrapper {
233+
animation: modal-fade-in 0.5s;
234+
}
233235
}
234236

235237
.dialog-slideRight-leave-active {
236238
animation: slideRightout 0.5s ease-in forwards;
239+
&.tiny-dialog-box__wrapper {
240+
animation: modal-fade-out 0.5s;
241+
}
237242
}
238243

239244
@keyframes slideRight {
@@ -270,15 +275,43 @@
270275
}
271276
}
272277

278+
.tiny-dialog-box__wrapper.has-modal {
279+
background: var(--tv-DialogBox-mask-bg-color);
280+
}
281+
273282
.dialog-fade-enter-active {
274283
animation: dialog-fade-in 0.3s;
284+
&.tiny-dialog-box__wrapper {
285+
animation: modal-fade-in 0.3s;
286+
}
275287
}
276288

277289
.dialog-fade-leave-active {
278290
.@{dialog-box-prefix-cls} {
279291
animation: dialog-fade-out 3s;
280292
}
281293
animation: dialog-fade-out 0.3s;
294+
&.tiny-dialog-box__wrapper {
295+
animation: modal-fade-out 0.3s;
296+
}
297+
}
298+
299+
@keyframes modal-fade-in {
300+
0% {
301+
opacity: 0;
302+
}
303+
100% {
304+
opacity: 1;
305+
}
306+
}
307+
308+
@keyframes modal-fade-out {
309+
0% {
310+
opacity: 1;
311+
}
312+
100% {
313+
opacity: 0;
314+
}
282315
}
283316

284317
@keyframes dialog-fade-in {
@@ -306,7 +339,17 @@
306339
}
307340

308341
.enlarge-enter-active {
309-
animation: enlarge-in 350ms linear;
342+
animation: enlarge-in 0.35s linear;
343+
&.tiny-dialog-box__wrapper {
344+
animation: modal-fade-in 0.35s;
345+
}
346+
}
347+
348+
.enlarge-leave-active {
349+
animation: enlarge-out 0.35s linear;
350+
&.tiny-dialog-box__wrapper {
351+
animation: modal-fade-out 0.35s;
352+
}
310353
}
311354

312355
@keyframes enlarge-in {
@@ -323,6 +366,20 @@
323366
}
324367
}
325368

369+
@keyframes enlarge-out {
370+
0% {
371+
transform: scale(1);
372+
}
373+
374+
50% {
375+
transform: scale(0.5);
376+
}
377+
378+
100% {
379+
transform: scale(0);
380+
}
381+
}
382+
326383
@media (max-width: 480px) {
327384
.@{dialog-box-prefix-cls} {
328385
width: 100% !important;

packages/vue/src/dialog-box/src/pc.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
>
1919
<div
2020
v-show="visible"
21-
:class="['tiny-dialog-box__wrapper', dialogClass]"
21+
:class="['tiny-dialog-box__wrapper', dialogClass, modal ? 'has-modal' : '']"
2222
@click.self="handleWrapperClick"
2323
@mouseup="useMouseEventUp"
2424
@mousedown="useMouseEventDown"

0 commit comments

Comments
 (0)