Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation to any element #126

Closed
GemmieDodger opened this issue Jun 5, 2020 · 5 comments
Closed

Animation to any element #126

GemmieDodger opened this issue Jun 5, 2020 · 5 comments

Comments

@GemmieDodger
Copy link

Hi,

Please can I add an animation on load, which can be added to any element via. a class.

@Keyframes slideInFromLeft {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(0);
}
}

.animation-element-onload {
animation: 1s ease-out 0s 1 slideInFromLeft;
}

Thank you,
Gemma

@AllThingsSmitty
Copy link
Owner

Sure, do you have a demo example showing this? Feel free to submit a pull request with your recommendation. Please add a sentence or two explaining why this would be a good "pro" tip. More information on submitting is in the contribution guidelines.

@GemmieDodger
Copy link
Author

Here's a codepen.
https://codepen.io/gemmiedodger/pen/gOPbZyg

I'll have a read of the guidelines, thank you. This is my first ever contribution so please let me know if I do something wrong!

@ghost
Copy link

ghost commented Jul 21, 2020

Anyway to add animations onScroll? Without the use of an external script or library?

@v007rj
Copy link

v007rj commented Feb 9, 2021

@GemmieDodger
You can run a CSS animation on page load without using any JavaScript. You just have to use CSS3 Keyframes. Try using Keyframe animations it would work .

@ankit11hab
Copy link

You can try adding <script src="https://unpkg.com/aos@next/dist/aos.js"></script> to your code. In the div class you want to animate, you just need to add -> data-aos="fade-left"(for example). You can make required changes like offset, delay, duration, etc. like this

<script> AOS.init( { offset: 60, duration: 1000 } ); </script>

Please follow this link for the full description of using this method.
https://github.com/michalsnik/aos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants