top of page
Ball Drop Animation

Ball Drop Animation

Create a ball drop animation where balls fall through a maze and dot the letter I’s in your words.

Intermediate.png

Advanced

3K

Published:

August 11, 2021

Girl Enjoying her Drink

by

Anchor 1
Hire a Developer

Example Description

In this example we created an effect of balls falling through a maze and bouncing into their correct places of dotting the letter I’s in our words. We have three different animations:

 

  1. The animation of the maze itself.

  2. The animation of the right ball.

  3. The animation of the left ball.

Example Code

Tab 1

.

Tab 2

.

Tab 3

.

This code solution can be complicated.

How We Built It


Page Elements


In our site we added the following page elements:

  • Group 1: A text element and 2 pink vector images for the initial text and the 2 balls.

  • Group 2: 12 vector images to create the maze.

  • Group 3: A text element for the final text and 2 black vector images where the balls will fall to.



Code


We define three timeline animation constants:

  1. maze_tl: The animation of the maze.

  2. left_ball_tl: The animation of the left ball.

  3. right_ball_tl: The animation of the right ball.


In the $w.onReady() function we declare all the elements we want to animate. We then manually order the maze child elements for the maze animation. The maze animation uses a loop that goes through the different wheels of the maze. After building the maze animation, we make sure to time the balls animation when the maze animation ends. For the balls animation, we perform calculations and then build separate ball paths for the left and right balls. The balls animation includes the exact computations of the horizontal and vertical journey each ball has to take in order to get to its final destination.

APIs We Used

Non-code example.

Non-code example.

Related Articles

Article Link

Hire a Developer

Velo solutions are powerful tools, but building them on your own can be challenging. Let an experienced Velo development shop build it for you, so you can keep working on your site or business.

Related Examples

Did this help?

Yes

|

No

Thanks for your feedback!

Custom Button Animation

Custom Button Animation

Create a custom button that rotates clockwise and changes color on click using the Wix Animations API.

Intermediate.png

Beginner

Solar System Animation

Solar System Animation

Create a simplified solar system animation using the Wix Animations API.

Intermediate.png

Advanced

Vector Image Animation

Vector Image Animation

Create an animation of a ball moving and then taking the place of the letter O’s in your words.

Intermediate.png

Beginner

Text Microinteractions

Text Microinteractions

Create different microinteractions on 3 text elements using the Wix Animations API.

Intermediate.png

Intermediate

Hourglass Animation

Hourglass Animation

Flip an hourglass automatically or on a button click using the Wix Animations API.

Intermediate.png

Advanced

Anchor 2
bottom of page