Add animations to launcher and Files app

This commit is contained in:
James Babcock committed 2026-09-25 13:25:51 -07:00
1 parent 7ad9fe10ad
commit b0a98f5942
24 files changed
+1608 -738

No files matched your search

+7 -2
View File
@@ -18,9 +18,14 @@ export type MenuScrollHighlight = {
* started at `timelineStart` (the slide may have started before or after it).
*/
export function slidingHighlightY(y: number, motion: MenuHighlightAnimation | undefined, timelineStart: number): E<'i32'> {
if (!motion?.dy) return E.i32(y);
return slidingCoordinate(y, motion?.dy ?? 0, motion, timelineStart);
}
/** One coordinate of a highlight sliding by `delta` to rest at `value`; see slidingHighlightY. */
export function slidingCoordinate(value: number, delta: number, motion: MenuHighlightAnimation | undefined, timelineStart: number): E<'i32'> {
if (!motion || !delta) return E.i32(value);
return E.progress(motion.durationMs, motion.startedAt - timelineStart).ease()
.lerp(E.i32(y + motion.dy).toFloat(), E.i32(y).toFloat()).toInt();
.lerp(E.i32(value + delta).toFloat(), E.i32(value).toFloat()).toInt();
}
/**