MCPcopy
hub / github.com/midrender/revideo / appendTween

Method appendTween

packages/2d/src/lib/code/CodeSignal.ts:264–284  ·  view source on GitHub ↗
(value: string, duration: number)

Source from the content-addressed store, hash-verified

262 }
263
264 private *appendTween(value: string, duration: number) {
265 let current = this.get();
266 const progress = createSignal(0);
267 const scope = {
268 progress,
269 fragments: [insert(value)],
270 };
271 this.set({
272 progress: current.progress,
273 fragments: [...current.fragments, scope],
274 });
275 yield* progress(1, duration);
276 current = this.get();
277 this.set({
278 progress: current.progress,
279 fragments: current.fragments.map(fragment =>
280 fragment === scope ? value : fragment,
281 ),
282 });
283 progress.context.dispose();
284 }
285
286 private *prependTween(value: string, duration: number) {
287 let current = this.get();

Callers 1

appendMethod · 0.95

Calls 5

createSignalFunction · 0.90
insertFunction · 0.90
setMethod · 0.65
getMethod · 0.45
disposeMethod · 0.45

Tested by

no test coverage detected