Skip to content

Commit

Permalink
handling animations that are wired up before clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Martin committed Oct 4, 2024
1 parent f9e6fc6 commit fbae35e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/clarity-js/src/layout/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ export function start(): void {
return createdAnimation;
}
}
if (document.getAnimations) {
for (var animation of document.getAnimations()) {
if (animation.playState === "finished") {
trackAnimationOperation(animation, "finish");
}
else if (animation.playState === "paused" || animation.playState === "idle") {
trackAnimationOperation(animation, "pause");
}
else if (animation.playState === "running") {
trackAnimationOperation(animation, "play");
}
}
}
}
}

Expand Down

0 comments on commit fbae35e

Please sign in to comment.