Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/timeline/src/animation/ |
Upload File : |
import {Dom, Type} from 'main.core'; import {Animation} from './animation'; export class Hide extends Animation { static DURATION = 1000; node: Element; constructor(params: { node: Element, }) { super(params); if(Type.isPlainObject(params)) { if(Type.isDomNode(params.node)) { this.node = params.node; } } } start(): Promise { return new Promise((resolve) => { if(!this.node) { resolve(); } const node = this.node; const wrapperPosition = Dom.getPosition(node); const hideEvent = new BX.easing({ duration : Hide.DURATION, start : { height: wrapperPosition.height, opacity: 1, marginBottom: 15 }, finish: { height: 0, opacity: 0, marginBottom: 0 }, transition : BX.easing.makeEaseOut(BX.easing.transitions.quart), step: (state) => { if(node) { node.style.height = state.height + "px"; node.style.opacity = state.opacity; node.style.marginBottom = state.marginBottom; } }, complete: () => { this.finish(node, resolve); } }); hideEvent.animate(); }); } finish(node: Element, onFinish: ?Function) { Dom.remove(node); if(Type.isFunction(onFinish)) { onFinish(); } } }