zoukankan      html  css  js  c++  java
  • HTML之盒子变形动画

    4个圆形球作圆周运动

    代码:

    1 <div class="box">
    2         <div class="box1"></div>
    3         <div class="box2"></div>
    4         <div class="box3"></div>
    5         <div class="box4"></div>
    6     </div>
    *{
        margin: 0;
        padding: 0;
    }
    body{
        margin: auto;
        padding-top: 200px;
        padding-left: 600px;
    }
    .box{
         400px;
        height: 400px;
        border-radius: 50%;
        background-color: blue;
        position: relative;
    }
    .box div{
         200px;
        height: 200px;
        border-radius: 50%;
        background-color: red;
    }
    .box1{
        position: absolute;
        left: 100px;
        top: -200px;
        animation-name: div1;
        animation-duration: 2s;
        animation-iteration-count: infinite;
        animation-timing-function: linear;
    }
    .box2{
        position: absolute;
        left: -200px;
        top: 100px;
        animation-name: div2;
        animation-duration: 2s;
        animation-iteration-count: infinite;
        animation-timing-function: linear;
    }
    .box3{
        position: absolute;
        left: 100px;
        bottom: -200px;
        animation-name: div3;
        animation-duration: 2s;
        animation-iteration-count: infinite;
        animation-timing-function: linear;
    }
    .box4{
        position: absolute;
        top: 100px;
        left: 400px;
        animation-name: div4;
        animation-duration: 2s;
        animation-iteration-count: infinite;
        animation-timing-function: linear;
    }
    @keyframes div1{
        from{transform:translate(0,0)}
        50%{transform:translate(150,150)}
        to{transform: translate(300px,300px)};
    }
    @keyframes div2{
        from{transform: translate(0,0)}
        50%{transform: translate(150,-150px)}
        to{transform: translate(300px,-300px)}
    }
    @keyframes div3{
        form{transform: translate(0,0)}
        50%{transform: translate(-150px,-150px)}
        to{transform: translate(-300px,-300px)}
    }
    @keyframes div4{
        from{transform: translate(0,0)}
        50%{transform: translate(-150px,150px)}
        to{transform: translate(-300px,300px)}
    }

    完成图形:

  • 相关阅读:
    优先级队列
    内存拷贝
    快速排序
    ubuntu上编译Thrift
    Hadoop 学习总结之一:HDFS简介(zz写的很不错)
    hbase 详细解析(转载)
    HBase技术介绍简介 NOSQL数据库 入门(转载)
    SQL到NOSQL的思维转变
    Hadoop分布式文件系统:架构和设计(zz)
    zz我对技术方向的一些反思
  • 原文地址:https://www.cnblogs.com/CccK-html/p/11295246.html
Copyright © 2011-2022 走看看