MCPcopy
hub / github.com/benjitaylor/agentation / runAnimation

Function runAnimation

package/example/src/app/components/FeaturesDemo.tsx:129–193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127 let cancelled = false;
128
129 const runAnimation = async () => {
130 setTypedText("");
131 setCursorPos({ x: 300, y: 180 });
132 setShowSelection(false);
133 setSelectionWidth(0);
134 setShowPopup(false);
135 setShowMarker(false);
136 setIsTextCursor(false);
137 setIsSelecting(false);
138
139 await delay(600);
140 if (cancelled) return;
141
142 const pos = wordPosRef.current;
143 // Move toward the text - switch to I-beam mid-motion
144 setCursorPos({ x: pos.x, y: pos.y });
145 await delay(180);
146 if (cancelled) return;
147 setIsTextCursor(true);
148 await delay(250);
149 if (cancelled) return;
150
151 setIsSelecting(true);
152 setShowSelection(true);
153
154 const endWidth = pos.width;
155 const steps = 14;
156 const stepSize = endWidth / steps;
157
158 for (let i = 0; i <= steps; i++) {
159 if (cancelled) return;
160 const w = Math.round(i * stepSize);
161 setSelectionWidth(w);
162 await delay(20);
163 }
164
165 setCursorPos({ x: pos.x + endWidth, y: pos.y });
166 setIsSelecting(false);
167 await delay(250);
168 if (cancelled) return;
169
170 setShowPopup(true);
171 await delay(300);
172 if (cancelled) return;
173
174 for (let i = 0; i <= feedbackText.length; i++) {
175 if (cancelled) return;
176 setTypedText(feedbackText.slice(0, i));
177 await delay(30);
178 }
179 await delay(400);
180 if (cancelled) return;
181
182 setShowPopup(false);
183 await delay(200);
184 if (cancelled) return;
185 setShowMarker(true);
186

Callers 11

TextSelectionDemoFunction · 0.70
handleVisibilityFunction · 0.70
ElementClickDemoFunction · 0.70
MultiSelectDemoFunction · 0.70
AreaSelectionDemoFunction · 0.70
AnimationPauseDemoFunction · 0.70
SettingsDemoFunction · 0.70
SmartIdentificationDemoFunction · 0.70
ReactDetectionDemoFunction · 0.70
ComputedStylesDemoFunction · 0.70
AgentChatDemoFunction · 0.70

Calls 5

measurePositionsFunction · 0.85
clickFunction · 0.85
hoverElementFunction · 0.85
streamTextFunction · 0.85
delayFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…