Exercise 13.05: Animating a Paint Worklet
In this exercise, we will animate the paint worklet we created in Exercise 13.04, Paint Worklet with Mouse Input. We do not need to make any changes to our paint worklet for this exercise, but we will need to register custom properties so that they can be animated using the CSS transition property.
The steps are as follows:
- Make a copy of the
Exercise 13.04.html
file from our previous exercise. Rename the copied fileExercise 13.05.html
underChapter13
folder and update the title of the web page document:<title>Exercise 13.05: Animated Paint Worklet</title>
- We want to add a transition to our pointer class declaration, which will transition the custom properties for
--size
,--primary-fill-color
, and--secondary-fill-color
. This will cause the values for these properties to transition to the values that have been set when the element with the pointer class is clicked:...