Are you looking to add some magic to your Webflow projects with eye-catching animations that appear when hovered on? Look no further! In this quick blog post, we'll guide you through the process of creating a looping animation in Webflow that appears on hover and disappears when not hovered on.
We'll be using some fantastic tools like Figma, Jitter, Lottie, and Webflow to achieve this mesmerizing effect. So, let's dive in!
Step 1: Export your Figma asset into Jitter using their Figma plugin
To get started, you'll need a design or illustration that you'd like to animate. If you're using Figma, you can use the Jitter Figma Plugin to export your assets into Jitter seamlessly.
- Select your frame and click on Plugins
- Search for the Jitter Figma Plugin
- Export your desired asset from Figma to Jitter using the plugin.
Step 2: Bringing Your Design to Life with Jitter and Lottie
Now that you have your asset in Jitter, it's time to unleash your creativity and add captivating animations to your design!
- Select Your Element: In Jitter, begin by selecting the element you want to animate. Whether it's a logo, icon, or any other part of your design, Jitter offers the tools you need.
- Animate with Ease: Once your element is selected, click on "Animate" to access Jitter's animation features. Here's where the magic happens! You can choose from a variety of pre-made animations to save time, or you can let your imagination run wild and create a custom animation tailored to your vision.
- Fine-Tune for Perfection: Jitter allows you to fine-tune various aspects of your animation, including the duration and easing methods for each element. This level of control ensures you achieve the exact effect you desire, bringing your design to life in a dynamic and engaging way.
- Set the Final Duration: After crafting your animation to perfection, it's time to set the final duration. This step ensures that your animation loops seamlessly and mesmerizes your visitors without interruption.
- Export as a Lottie File: With your animation ready, it's time to export it as a Lottie file. This file format is perfect for Webflow integration and ensures your animation will display flawlessly on various devices and browsers.
- Learning Resources: If you're new to Jitter or looking to enhance your animation skills, be sure to check out Jitter's YouTube channel. There, you'll find a treasure trove of tutorials and tips to take your animation expertise to the next level: Jitter's YouTube Channel
Now that you have a stunning Lottie animation, let's proceed to the next step and upload it to LottieFiles!
Step 3: Upload your Lottie (.json file) to LottieFiles and export it for the web
With your animation ready in Jitter, it's time to convert it into a format that Webflow can understand and display seamlessly.
- Head over to LottieFiles (LottieFiles.com) and log in or create an account if you haven't already.
- Go to "My Dashboard" and click "Upload Animation."
- Upload the Lottie file (.json) that you exported from Jitter.
- After the upload is complete, click on "Share" and make sure to enable the "Asset Link" option.
- Copy the Web Embed link provided by LottieFiles; we'll use this in the next step.
Step 4: Add the "HTML embed" element to your Webflow project and insert the custom code
In this step, we'll integrate the animation into your Webflow project.
- Open your Webflow project and navigate to the page where you want the animation to appear on hover.
- Drag and drop an "HTML Embed" element onto the page at the desired location.
- Inside the HTML Embed element, paste the custom code provided by LottieFiles. Replace "<lottie-player>" with the copied Web Embed link.
Copy this custom code:
<lottie-player id="my-lottie-player" src="https://lottie.host/3f9d098b-03c1-4ce0-822d-3df11559b6cd/01WhIACdIU.json" background="transparent" speed="1" style="width: 100%; height: 100%;" loop></lottie-player><div id="my-lottie-controller"></div><script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script><script> var lottiePlayer = document.getElementById("my-lottie-player"); var hoverTrigger = document.getElementById("my-lottie-controller"); hoverTrigger.addEventListener('mouseover', function(event) { lottiePlayer.play(); }); hoverTrigger.addEventListener('mouseout', function(event) { lottiePlayer.pause(); });</script><style> #my-lottie-controller { position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: pointer; }</style>
Step 5: Publish your site and make the animation live
Congratulations! You're almost there. Now, let's bring your project to life.
- Before publishing your Webflow project, make sure to save all changes.
- Preview the page to see the animation in action when you hover over the designated area.
- Once you're satisfied with the results, hit "Publish" to make the animation live for your website visitors.
That's it! Now your Webflow project features a captivating looping animation that appears when hovered over and vanishes gracefully when not in focus. With the power of Figma, Jitter, Lottie, and Webflow combined, you can create seamless and immersive user experiences that leave a lasting impression.
So, go ahead and add some magic to your web design projects with stunning animations! Happy designing! ✨