| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 1x 4x 1x 1x 1x 1x 1x 1x 1x 1x | // @flow
const delay = (ms: number = 15): Promise<void> => {
return new Promise(r => setTimeout(r, ms));
};
export default async (el: HTMLElement): (() => Promise<void>) => {
const defaultTransition: string = getComputedStyle(el).transition;
await delay();
Object.assign(el.style, {
webkitTransition: null,
transition: null
});
await delay();
return async () => {
await delay();
Object.assign(el.style, {
webkitTransition: defaultTransition,
transition: defaultTransition
});
await delay();
};
};
|