Let's keep going down this rabbit hole of functions I've created. We have called a function that does not exist yet: cloudCall
. This function takes the cloud elements, detects the size class we have added, and uses it to determine how fast the cloud should move across the screen. We are going to create an assumption in our parallax 3D effect that the bigger objects are closer and will therefore move faster through the viewport than the slower clouds. The function takes a variable we will identify here as clouds
. Take the classList
array, and we will operate on it. Start the function by looping through the clouds' classList
array.
For each one, use a switch and case test for the Font Awesome class to determine the font's size. Do you remember? It's fa-2x
, fa-3x
, fa-4x
, and fa-5x
. For each case, call yet another function (have I used the term "rabbit hole" already? What about "labyrinthine"?) as equal to the value of the cloud object's style left property...