• 动画


    一.从一张背景图片中截取六张图并让它们平移。

    HTML代码如下:

       <div class="pic">
               <div class="img1"></div>
                <div class="img2"></div>
                 <div class="img3"></div>
                  <div class="img4"></div>
            </div>
    

     css代码:

    .pic{
    	position:relative;
    }
    .pic div{
    	 173px;
    	height: 175px;
    	display: inline-block;
    	position: absolute;
    	top:0;
    	left:10px;
    }
    .img1{
    	
        background:url(../images/banner.png) no-repeat;
        background-position:-522px;
    	
    	/*position: absolute;*/
    	animation: animateOne 2s linear  1;
    }
    
    .img2{
    	
         background:url(../images/banner.png) no-repeat;
        background-position:-349px;
    	display: inline-block;
    	position:absolute;
    	animation: animateTwo 4s linear  1;
    
    }
    .img3{
    	
         background:url(../images/banner.png) no-repeat;
        background-position:-174px;
    	
       animation: animateThree 6s linear  1;
    }
    .img4{
    	
        background:url(../images/banner.png) no-repeat;
        background-position:0px;
    	display: inline-block;
    	position: absolute;
    	animation: animateFour 8s linear 1;
    	
    }
    
    @keyframes animateOne{
         from {
                transform: translate(0px,0px);
         }
         
         to{
              transform: translate(100px,0px);
         }
    }
    
    @keyframes animateTwo{
         from {
                transform: translate(0px,0px);
         }
         
         to{
              transform: translate(300px,0px);
         }
    }
    @keyframes animateThree{
         from {
                transform: translate(0px,0px);
         }
         
         to{
              	  transform: translate(500px,0px);
         }
    }
    @keyframes animateFour{
         from {
                transform: translate(0px,0px);
         }
         
         to{
              transform: translate(700px,0px);
         }
    }
    

     二,播放符的编写

     Html代码:我们先写六个div

       <div class="player">
                        <div class="playerOne"></div>
                         <div class="playerTwo"></div>
                          <div class="playerThree"></div>
                           <div class="playerFour"></div>
                            <div class="playerFive"></div>
                     </div> 
    

     css代码:

    .player{
    	200px;
    	height:200px;
    	margin: auto;	
    }
    .player div{
    	5px;
    	height:50px;
    	background-color: #21134D;
    	display: inline-block;
    	
    }
    .playerOne{
    	 animation: aniOne 1s linear 0.2s infinite;
    }
    .playerTwo{
        animation: aniOne 1s linear 0.4s infinite;
    }
    .playerThree{
    	animation: aniOne 1s linear 0.6s infinite;
    }
    .playerFour{
    	animation: aniOne 1s linear 0.8s infinite;
    }
    .playerFive{
    	animation: aniOne 1s linear 1s infinite;
    }
    
    
    @keyframes aniOne{
         from {
                transform:scaleY(0.1);
         }
         
         to{
               transform:scaleY(0.5);
         }
    }
    

     先设置动画,然后在五个div中分别调用它。持续时间相同,并且让后面的div延时,这样就可以循序渐进了。

    三,loading图不停旋转

    html代码:

                         <div class="loading">
                         </div>
                            <div class="font">loading</div>
    

     css代码:

    .loading{
    	150px;
    	height:150px;
    	border-radius:50%;
    	border:6px  solid transparent;
    	border-top-color:#F82727; 
    	border-left-color:#F82727;
    	border-right-color: #3EEA4C;
    	border-bottom-color: #3EEA4C;
    	animation: circle 3s linear 0s infinite;
    	position: absolute;
    	}
    	.font{
    		display: inline-block;
    		padding-left:60px;
    	    position: absolute;
    	    margin-top:70px;
    	}
    
       @keyframes circle{
         from {
                transform:rotate(0deg);
         }
         
         to{
               transform:rotate(360deg);
         }
    }

     border-top-color:#F82727;

    border-left-color:#F82727;

    border-right-color: #3EEA4C;

    border-bottom-color: #3EEA4C;

    圆的两边设不同颜色

  • 相关阅读:
    Struts2拦截器defaultStack与paramsPrepareParamsStack
    Java中的数据类型BigDecimal
    JfreeChart报表数据点显示、链接
    JPA+Hibernate3 CRUD(增删改查操作)
    Ibatis的批量处理iterateiterate标签
    .net中split的用法,asp.net字符分隔
    存储过程中RETURN语句的返回值
    SQL自定义函数学习修改和删除和管理
    SqlCommand 方法
    由于该计算机受到限制本次操作已被取消请与你的系统管理员联系
  • 原文地址:https://www.cnblogs.com/Jessical8619/p/7839575.html
Copyright © 2020-2023  润新知