Flip motion
+ ANIMATION :
+ Description :
This could be used to showcase a logo or an image with an entrance animation.
In order to achieve it you will find below the various codes to be used. Despite using Bricks builder, I tried to list up all the necessary steps to complete the animation to be the most universal as much as possible. Therefore I am close to what you will find in any IDE. For Bricks builder, please follow the HTML/CSS structure so you can add-up divs and give them CSS instead of putting it into the code element in order to avoid FOUC as the code element is loaded lastly within the page priority list.
For CSS, please note that I am considering that you are using a builder hence: no margin/padding reset has been applied and the font is not defined.
ScrollTrigger is not necessary has such as the animation is above the fold. But in most of cases it should be necessary therefore I added also the code but commented.
First let’s load GSAP and ScrollTrigger if necessary:
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.3/gsap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.3/ScrollTrigger.min.js"></script>
HTML:
<div class="flip-section"> <div class="flip-ctn"> <img class="flip-image" src="/Flip motion/AGENCE KOKORO_logo_original.png" /> </div> </div>
CSS:
.flip-section { display: flex; align-items: center; justify-content: center; min-height: 75vh; width: 100%; background-color: #202020; } .flip-ctn { display: flex; align-items: center; justify-content: center; width: 20%; height: auto; perspective: 700px; } .flip-image { width: 100%; height: auto; opacity: 0; transform: scale(0); transform-origin: 25% 50%; } @media screen and (max-width: 992px) { .flip-ctn { width: 50%; } }
JavaScript:
document.addEventListener("DOMContentLoaded", function (event) { gsap.registerPlugin(ScrollTrigger); gsap.fromTo( ".flip-image", { rotationX: 1080, rotationY: -360, }, { rotationX: 0, rotationY: 0, opacity: 1, scale: 1, duration: 2, ease: "slow", scrollTrigger: { trigger: ".flip-ctn", start: "bottom bottom", / toggleActions: "play reverse play reverse", }, } ); });