Use Thanos snap to destory your DOM elements.
npm install html2canvas ramda @wellwind/thanos-snap
or
yarn add html2canvas ramda @wellwind/thanos-snap
Then import the scripts.
import { thanosSnap, thanosRewind } from '@wellwind/thanos-snap';
// destroy the element, and rewind it after 3s.
const element = document.querySelector('someElm');
thanosSnap(element).then(() => {
setTimeout(() => {
thanosRewind(element);
}, 3000);
});
There is also an Angular library called @wellwind/ngx-thanos. You can simple add a directive to your element, and enjoy the Thanos snap effect.