You can use animations on your landing page by adding additional CSS, JavaScript, and proper classes to chosen elements.
The animations used on your landing page appear when visitors scroll the page to the place where they are located.
REMEMBER:
Landing pages shouldn’t be overly animated. The movements distract visitors from the content of the page.
We recommend animating bullet points or elements that encourage visitors to take action, e.g., arrows indicating the CTA. Below you can see an example of how animation can work.
Add CSS and JavaScript codes
- Log in to your account on the Smartpages platform and go to the editor of your landing page.
- In the editor, go to the Page Settings (you will find it in the upper right corner of the toolbar) and click on Custom CSS.
- Add the CSS code indicated below. If you already have other codes here, add it above them, at the top, and save changes.
- If you want to loop your animation, add the following code below your custom CSS – change animation_name to the name of the animation you chose.
- Publish your landing page and go to the Dashboard and then the JavaScript Code tab. Click Add code.
You can enter the JavaScript Code tab directly from the editor:
- In the new window, paste the script indicated below in the Body top position on the Main page. Save the changes.
Regardless of the amount of animation on the landing page, you only add the CSS and JavaScript code once.
Add classes to landing page elements
After adding CSS and JavaScript code, you can choose how and which elements of the landing you want to animate.
- Select the name and type of CSS animation, which you can find, e.g., here: Animate.style. Copy its name.
NOTE: Unfortunately, not all of the CSS animations will work on your landing page. Here is the list of unavailable animations:
- shakeX
- shakeY
- heartBeat
- lightSpeed
- lightSpeedInRight
- lightSpeedInLeft
- lightSpeedOutRight
- lightSpeedOutLeft
- jackInTheBox
- Enter the editor again and select the element that you want to animate – it can be an image, icon, or text. Do not animate buttons triggering pop-ups and lightboxes.
- In the widget toolbar on the right, enter the name of your animation in the field Classes. It should be preceded by the command ‘wow’ and one space, e.g. wow flipInX. Do this same for every element that you want to animate.
REMEMBER: The code in Classes field is case sensitive – always type the exact animation name.
- Publish your landing page. Check if the animation displays properly.