top of page
Text Microinteractions

Text Microinteractions

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

Intermediate.png

Intermediate

5K

Published:

August 11, 2021

Girl Enjoying her Drink

by

Anchor 1
Hire a Developer

Example Description

In this example we built a sentence containing 3 text elements that have different microinteractions. When a site visitor hovers over one of these 3 text elements, they will see an animation.

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:

  • 8 text elements to build the sentence (5 of which we will use to create our microinteractions).

  • 2 images.



Code


In the $w.onReady() function we declare all the elements we want to animate. We then create the individual animation timelines for each of the 3 animations:


  1. Shiver ‘microinteractions’: When the user hovers over the text element “microinteractions”, we create a shiver effect by quickly moving “microinteractions” in all directions and adding a slight rotation.

  2. Slide ‘arrow’: When the user hovers over the text element “text”, we create a bump effect by sliding the arrow horizontally back and forth pushing the text element, “to” backwards, and the text element “text” forward. For extra effect, we use the easeInSine and easeOutSine easing parameters of the wix-animations API. Note that we configure this animation differently for mobile devices.

  3. Show images: When the user hovers over the text element “images”, we create a fade effect by gradually showing 2 image elements. We do this by changing the opacity of the image elements and by using the easeOutQuad easing parameter of the wix-animations API.


The last step is to add onMouseIn() and onMouseOut() event handlers to the 3 text elements. When hovering over the 3 text elements, their animations will play. When hovering off the 3 text elements, their animations will either replay, pause, or reverse depending on the animation.

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!

Solar System Animation

Solar System Animation

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

Intermediate.png

Advanced

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

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

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

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