@@ -193,6 +193,15 @@ export default class DModal extends Component {
193
193
this .animating = false ;
194
194
}
195
195
196
+ if (this .site .desktopView ) {
197
+ try {
198
+ this .animating = true ;
199
+ await this .#animatePopOff ();
200
+ } finally {
201
+ this .animating = false ;
202
+ }
203
+ }
204
+
196
205
this .args .closeModal ({ initiatedBy });
197
206
}
198
207
@@ -264,6 +273,33 @@ export default class DModal extends Component {
264
273
).finished ;
265
274
}
266
275
276
+ async #animatePopOff () {
277
+ const backdrop = this .wrapperElement .nextElementSibling ;
278
+
279
+ if (! backdrop) {
280
+ return ;
281
+ }
282
+
283
+ await Promise .all ([
284
+ this .modalContainer .animate (
285
+ [
286
+ { transform: " scale(1)" , opacity: 1 , offset: 0 },
287
+ { transform: " scale(0)" , opacity: 0 , offset: 1 },
288
+ ],
289
+ {
290
+ fill: " forwards" ,
291
+ duration: getMaxAnimationTimeMs (300 ),
292
+ easing: " cubic-bezier(0.4, 0, 0.2, 1)" ,
293
+ }
294
+ ).finished ,
295
+ backdrop .animate ([{ opacity: 0.6 }, { opacity: 0 }], {
296
+ fill: " forwards" ,
297
+ duration: getMaxAnimationTimeMs (300 ),
298
+ easing: " cubic-bezier(0.4, 0, 0.2, 1)" ,
299
+ }).finished ,
300
+ ]);
301
+ }
302
+
267
303
<template >
268
304
{{! template-lint-disable no-invalid-interactive }}
269
305
0 commit comments