diff --git a/curriculum/challenges/english/blocks/lecture-working-with-the-dom-click-events-and-web-apis/67336956340e8a34fbd5d9f3.md b/curriculum/challenges/english/blocks/lecture-working-with-the-dom-click-events-and-web-apis/67336956340e8a34fbd5d9f3.md index b8b327b1413..81afd3c4e37 100644 --- a/curriculum/challenges/english/blocks/lecture-working-with-the-dom-click-events-and-web-apis/67336956340e8a34fbd5d9f3.md +++ b/curriculum/challenges/english/blocks/lecture-working-with-the-dom-click-events-and-web-apis/67336956340e8a34fbd5d9f3.md @@ -5,7 +5,7 @@ challengeType: 19 dashedName: what-is-the-requestanimationframe-api-and-how-can-it-be-used-to-set-up-an-animation-loop --- -# --description-- +# --interactive-- Creating smooth animations on a web page can be tricky, especially if you're not sure how to handle timing properly. The great news is that the `requestAnimationFrame()` API makes it easier. @@ -48,14 +48,16 @@ requestAnimationFrame(animate); The loop will continue until you stop it. -Now, let's take a look at another example. The HTML for this example is a `div` element with the text `freeCodeCamp is Awesome`: +Now, let's take a look at another example. The HTML for this example is a `div` element with the text `freeCodeCamp is Awesome`. The CSS makes the `div` a rectangle and hides anything that goes out of the viewport on the left or right. The JavaScript code moves the rectangle `2px` to the right at every call of `requestAnimationFrame(animate)` with the `animate` function as a callback: + +:::interactive_editor ```html +