diff --git a/src/components/TheNodeTree.vue b/src/components/TheNodeTree.vue index f1602ec..5108ec6 100644 --- a/src/components/TheNodeTree.vue +++ b/src/components/TheNodeTree.vue @@ -176,6 +176,23 @@ const onWheel = (event: WheelEvent) => { }; +let animationHandle = 0; +const onAnimationStart = (event: AnimationEvent) => { + if (!(event.target! as HTMLElement).classList.contains("socket-value-editor")) return; + updateLinksEveryFrame(); +}; +const onAnimationEnd = (event: AnimationEvent) => { + if (!(event.target! as HTMLElement).classList.contains("socket-value-editor")) return; + cancelAnimationFrame(animationHandle); +}; + +const updateLinksEveryFrame = () => { + rerenderLinks(); + + animationHandle = requestAnimationFrame(updateLinksEveryFrame); +}; + + defineExpose({ selectNode, reloadOutputs, @@ -184,57 +201,71 @@ defineExpose({ @@ -299,5 +323,27 @@ Object.defineProperties(socketVue, { right: var(--socket-offset); } } + + + // vue transition + > .drawer-enter-active { + animation: drawer .125s cubic-bezier(0,.74,.55,1); + } + + > .drawer-leave-active { + pointer-events: none; + animation: drawer .125s cubic-bezier(.45,0,1,.26) reverse; + } + + @keyframes drawer { + 0% { + transform: scaleY(0); + margin-bottom: var(--end-height); + } + + 100% { + margin-bottom: 0; + } + } } \ No newline at end of file diff --git a/src/components/node/NodeSocketField.vue b/src/components/node/NodeSocketField.vue index 1f94ca1..cf85b24 100644 --- a/src/components/node/NodeSocketField.vue +++ b/src/components/node/NodeSocketField.vue @@ -60,8 +60,10 @@ type VectorSocket = Socket;