css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv
CodePen probably won't work great in this browser. We generally only support the major desktop browsers like Chrome, Firefox, Safari, and Edge. Use this one at your own risk! If you're looking to test things, try looking at Pens/Projects in Debug View.
user profile image

As of 11/28/2017 only in Firefox Nightly (59)

The new property iterationComposite in the Web Animations API allows you to build on previous iterations. Here we have an animation going from a default state to a small rotation + a small translation. When we set it to a lot of iterations, each iteration will be on the last when we specify iterationComposite: 'accumulate'.

After the first iteration we will have the expected rotation + translation value. After the second iteration it will be twice the rotation and twice the translation. This is because, using the rotation only as an example, the first iteration goes from 0deg to 5deg. The second iteration will do the same 0 to 5 change but add it on top of where the first iteration ended (5deg) resulting in an end state of 10deg. The third iteration will do the same but on top of the 10deg, resulting in 15deg, and so on. The translation is also occurring in the same manner. At the end of the iterations (assuming 400 iterations), the resulting transform will be equivalent to rotate(calc(400 * 5deg)) translateX(calc(400 * .125vmin))

This Pen is a fork of Dan Wilson's Pen Spiral with WAAPI iterationComposite.

Comments

  1. No comments yet.

Leave a Comment Markdown supported. Click @usernames to add to comment.

You must be logged in to comment.
Loading...
Loading...