码迷,mamicode.com
首页 > Web开发 > 详细

CSS3 晃动效果

时间:2017-01-21 12:53:31      阅读:930      评论:0      收藏:0      [点我收藏+]

标签:color   from   open   log   translate   ram   close   head   bottom   

技术分享

为自己的目标努力着,全身心投入一件事情。


 

 

技术分享
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS3-晃动-效果</title>
<style>
    .element{
      color: #f35626;
      background-image: -webkit-linear-gradient(92deg,#f35626,#feab3a);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      -webkit-animation: hue 60s infinite linear;
      margin-bottom: 1.5rem;
      font-size: 3rem;
      font-weight: 100;
      line-height: 1;
      letter-spacing: -.05em;
    }
    .animated {
      -webkit-animation-duration: 3s;
      animation-duration: 3s;
      -webkit-animation-fill-mode: both;
      animation-fill-mode: both;
    }
    @-webkit-keyframes wobble {
      from {
        -webkit-transform: none;
        transform: none;
      }
    
      15% {
        -webkit-transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
        transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
      }
    
      30% {
        -webkit-transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
        transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
      }
    
      45% {
        -webkit-transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
        transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
      }
    
      60% {
        -webkit-transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
        transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
      }
    
      75% {
        -webkit-transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
        transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
      }
    
      to {
        -webkit-transform: none;
        transform: none;
      }
    }    
    @keyframes wobble {
      from {
        -webkit-transform: none;
        transform: none;
      }
    
      15% {
        -webkit-transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
        transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
      }
    
      30% {
        -webkit-transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
        transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
      }
    
      45% {
        -webkit-transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
        transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
      }
    
      60% {
        -webkit-transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
        transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
      }
    
      75% {
        -webkit-transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
        transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
      }
    
      to {
        -webkit-transform: none;
        transform: none;
      }
    }
    
    .wobble {
      -webkit-animation-name: wobble;
      animation-name: wobble;
    }
</style>
</head>
<body>
    <div class="element animated wobble">wobble</div>
</body>
</html>
View Code

技术分享

 

CSS3 晃动效果

标签:color   from   open   log   translate   ram   close   head   bottom   

原文地址:http://www.cnblogs.com/LindaLiu/p/6336747.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!