MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / animate

Function animate

cli/src/hooks/use-scroll-management.ts:60–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58 const frameInterval = ANIMATION_FRAME_INTERVAL_MS
59
60 const animate = () => {
61 const elapsed = Date.now() - startTime
62 const progress = Math.min(elapsed / duration, 1)
63 const easedProgress = easeOutCubic(progress)
64 const newScroll = startScroll + distance * easedProgress
65
66 programmaticScrollRef.current = true
67 scrollbox.scrollTop = newScroll
68
69 if (progress < 1) {
70 animationFrameRef.current = setTimeout(animate, frameInterval) as any
71 } else {
72 animationFrameRef.current = null
73 }
74 }
75
76 animate()
77 },

Callers 1

useChatScrollboxFunction · 0.70

Calls 2

easeOutCubicFunction · 0.85
setTimeoutFunction · 0.85

Tested by

no test coverage detected