Papermashup

Subscribe


Tweets


"@baekbunns This is utterly disgusting. Good for you for posting this. I don’t know you at all but nobody deserves t… https://t.co/QO9h5SminZ"

@ashleyford 3 days ago

"@chrisallmark @officialUKMail Had exactly the same experience just last week, they are utterly useless."

@ashleyford 2 weeks ago

Designer and web developer, Co-founder and Technical Director at Harkable.com. Previously I worked at Spotify, MySpace and InMobi. Contact me - ashley[at]papermashup.com

Papermashup

Simple CSS3 Animations

A collection of simple CSS3 animations and transitions that can be applied to any HTML element

AshleyAshley

The days of static content are well and truly dead and buried, Halleluja for CSS3! Recently i’ve been using this snippet of CSS in most of my projects to add slick transitions on page load. You can even add the CSS classes to ajax loaded content and on show the animations will kick in.

How To Use

You have to add the ‘animated’ class to each element you want to animate / transition

.animated

Then you can add any of the following classes.

.bounceIn .fadeIn .fadeInUp .fadeInDown .fadeInLeft .fadeOut .fadeOutLeft .fadeOutDown

You can also delay the animations by using the following.

.delay .delay-one .delay-two .delay-three

The Code

Simply include the following code in your stylesheet.


.animated {
-webkit-animation-fill-mode: both;
-moz-animation-fill-mode: both;
-ms-animation-fill-mode: both;
-o-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-animation-duration: 1s;
-moz-animation-duration: 1s;
-ms-animation-duration: 1s;
-o-animation-duration: 1s;
animation-duration: 1s;
}

.animated.hinge {
-webkit-animation-duration: 2s;
-moz-animation-duration: 2s;
-ms-animation-duration: 2s;
-o-animation-duration: 2s;
animation-duration: 2s;
}

@-webkit-keyframes bounceIn {

0% {
opacity: 0;
-webkit-transform: scale(0.8);
}

50% {
opacity: 1;
-webkit-transform: scale(1.05);
}

100% {
opacity: 1;
-webkit-transform: scale(1);
}
}

@-moz-keyframes bounceIn {

0% {
opacity: 0;
-moz-transform: scale(0.8);
}

50% {
opacity: 1;
-moz-transform: scale(1.05);
}

100% {
opacity: 1;
-moz-transform: scale(1);
}
}

@-o-keyframes bounceIn {

0% {
opacity: 0;
-o-transform: scale(0.8);
}

50% {
opacity: 1;
-o-transform: scale(1.05);
}

100% {
opacity: 1;
-o-transform: scale(1);
}
}

@keyframes bounceIn {

0% {
opacity: 0;
transform: scale(0.8);
}

50% {
opacity: 1;
transform: scale(1.05);
}

100% {
opacity: 1;
transform: scale(1);
}
}

.bounceIn {
-webkit-animation-name: bounceIn;
-moz-animation-name: bounceIn;
-o-animation-name: bounceIn;
animation-name: bounceIn;
}

@-webkit-keyframes fadeIn {
0% {
opacity: 0;
}

100% {
opacity: 1;
}
}

@-moz-keyframes fadeIn {
0% {
opacity: 0;
}

100% {
opacity: 1;
}
}

@-o-keyframes fadeIn {
0% {
opacity: 0;
}

100% {
opacity: 1;
}
}

@keyframes fadeIn {
0% {
opacity: 0;
}

100% {
opacity: 1;
}
}

.delay {
-webkit-animation-delay: 0.30s;
-moz-animation-delay: 0.30s;
-o-animation-delay: 0.30s;
animation-delay: 0.30s;
}

.delay-three {
-webkit-animation-delay: 0.60s;
-moz-animation-delay: 0.60s;
-o-animation-delay: 0.60s;
animation-delay: 0.60s;
}

.delay-two {
-webkit-animation-delay: 1.0s;
-moz-animation-delay: 1.0s;
-o-animation-delay: 1.0s;
animation-delay: 1.0s;
}

.delay-one {
-webkit-animation-delay: 1.5s;
-moz-animation-delay: 1.5s;
-o-animation-delay: 1.5s;
animation-delay: 1.5s;
}

.fadeIn {
-webkit-animation-name: fadeIn;
-moz-animation-name: fadeIn;
-o-animation-name: fadeIn;
animation-name: fadeIn;
}

@-webkit-keyframes fadeInUp {
0% {
opacity: 0;
-webkit-transform: translateY(20px);
}

100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}

@-moz-keyframes fadeInUp {
0% {
opacity: 0;
-moz-transform: translateY(20px);
}

100% {
opacity: 1;
-moz-transform: translateY(0);
}
}

@-o-keyframes fadeInUp {
0% {
opacity: 0;
-o-transform: translateY(20px);
}

100% {
opacity: 1;
-o-transform: translateY(0);
}
}

@keyframes fadeInUp {
0% {
opacity: 0;
transform: translateY(20px);
}

100% {
opacity: 1;
transform: translateY(0);
}
}

.fadeInUp {
-webkit-animation-name: fadeInUp;
-moz-animation-name: fadeInUp;
-o-animation-name: fadeInUp;
animation-name: fadeInUp;
}

@-webkit-keyframes fadeInDown {
0% {
opacity: 0;
-webkit-transform: translateY(-20px);
}

100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}

@-moz-keyframes fadeInDown {
0% {
opacity: 0;
-moz-transform: translateY(-20px);
}

100% {
opacity: 1;
-moz-transform: translateY(0);
}
}

@-o-keyframes fadeInDown {
0% {
opacity: 0;
-o-transform: translateY(-20px);
}

100% {
opacity: 1;
-o-transform: translateY(0);
}
}

@keyframes fadeInDown {
0% {
opacity: 0;
transform: translateY(-20px);
}

100% {
opacity: 1;
transform: translateY(0);
}
}

.fadeInDown {
-webkit-animation-name: fadeInDown;
-moz-animation-name: fadeInDown;
-o-animation-name: fadeInDown;
animation-name: fadeInDown;
}

@-webkit-keyframes fadeInLeft {
0% {
opacity: 0;
-webkit-transform: translateX(-20px);
}

100% {
opacity: 1;
-webkit-transform: translateX(0);
}
}

@-moz-keyframes fadeInLeft {
0% {
opacity: 0;
-moz-transform: translateX(-20px);
}

100% {
opacity: 1;
-moz-transform: translateX(0);
}
}

@-o-keyframes fadeInLeft {
0% {
opacity: 0;
-o-transform: translateX(-20px);
}

100% {
opacity: 1;
-o-transform: translateX(0);
}
}

@keyframes fadeInLeft {
0% {
opacity: 0;
transform: translateX(-20px);
}

100% {
opacity: 1;
transform: translateX(0);
}
}

.fadeInLeft {
-webkit-animation-name: fadeInLeft;
-moz-animation-name: fadeInLeft;
-o-animation-name: fadeInLeft;
animation-name: fadeInLeft;
}

.fadeOutDown {
-webkit-animation-name: fadeOutDown;
-moz-animation-name: fadeOutDown;
-o-animation-name: fadeOutDown;
animation-name: fadeOutDown;
}

@-webkit-keyframes fadeOutLeft {
0% {
opacity: 1;
-webkit-transform: translateX(0);
}

100% {
opacity: 0;
-webkit-transform: translateX(-20px);
}
}

@-moz-keyframes fadeOutLeft {
0% {
opacity: 1;
-moz-transform: translateX(0);
}

100% {
opacity: 0;
-moz-transform: translateX(-20px);
}
}

@-o-keyframes fadeOutLeft {
0% {
opacity: 1;
-o-transform: translateX(0);
}

100% {
opacity: 0;
-o-transform: translateX(-20px);
}
}

@keyframes fadeOutLeft {
0% {
opacity: 1;
transform: translateX(0);
}

100% {
opacity: 0;
transform: translateX(-20px);
}
}

@-webkit-keyframes fadeOut {
0% {
opacity: 1;
}

100% {
opacity: 0;
}
}

@-moz-keyframes fadeOut {
0% {
opacity: 1;
}

100% {
opacity: 0;
}
}

@-o-keyframes fadeOut {
0% {
opacity: 1;
}

100% {
opacity: 0;
}
}

@keyframes fadeOut {
0% {
opacity: 1;
}

100% {
opacity: 0;
}
}

.animated.fadeOut {
-webkit-animation-name: fadeOut;
-moz-animation-name: fadeOut;
-o-animation-name: fadeOut;
animation-name: fadeOut;
}

.animated.fadeOutLeft {
-webkit-animation-name: fadeOutLeft;
-moz-animation-name: fadeOutLeft;
-o-animation-name: fadeOutLeft;
animation-name: fadeOutLeft;
}

Demo Download

Designer and web developer, Co-founder and Technical Director at Harkable.com. Previously I worked at Spotify, MySpace and InMobi. Contact me - ashley[at]papermashup.com

Comments 2
  • Ricardo
    Posted on

    Ricardo Ricardo

    Reply Author

    Beautiful !!! I loved . Very nice Job !!!!


  • Faiz Nashrulloh Al Hakim
    Posted on

    Faiz Nashrulloh Al Hakim Faiz Nashrulloh Al Hakim

    Reply Author

    Hi, i’m very interest with your post, can u help me to develop my web. I’m a beginner. Maybe Yuou can look my web first, and after that u will understand my mind. i want to make .fadeInUp animation in the fazanash.com word, but i dont whre is I place the css code ?, can you give me an information ?, please