zoukankan      html  css  js  c++  java
  • 1.HTML+CSS写个8

    感想: 有点缺陷。效果地址:https://codepen.io/flyingliao/pen/QobdyE

    HTML code:

    <div class="eight">
      <span><span></span></span>
      <span></span>
    </div>

    CSS code:

    html, body ,.eight{
        margin: 0;
        padding: 0;
    }
    body{
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
    }
    .eight{
        width: 80px;
        height: 160px;
    }
    .eight>span{
        display: block;
        width: 100%;
        height: 50%;
        border: 1px solid white;
        border-radius: 50%;
        transform: rotate(-45deg);
    }
    
    .eight span:first-child{
        /* alternate: 动画轮流反向播放 ;
        forwards: 动画完成保持最后一个属性值;
        animation-name: write1;
        animation-duration: 2s;
        animation-timing-function: ease-in;
        animation-iteration-count:1;
        animation-fill-mode: forwards;
       */
        animation: write1 2s ease-in 1 forwards;
    }
    .eight span:last-child{
        margin-top: -1px;
        animation: write2 4s ease-in 2s forwards;
    }
    .eight>span:first-child>span{
        position: absolute;
        top: 0;
        left: 0;
        width: 80px;
        height: 80px;
        border: 1px solid white;
        border-radius: 50%;
        transform: rotate(-deg45);
        animation: write3 2s ease-in 3s forwards;
    }
    @keyframes write1{
       0%{
          border-top-color: white;
          border-left-color: white;
       }
       100%{
          border-top-color: red;
          border-left-color: red;
       }
    }
    @keyframes write2{
        0%{
            border-right-color: white;
        }
        25%{
            border-right-color: red;
        }
        50%{
            border-right-color: red;
            border-bottom-color: red;
        }
        75%{
            border-right-color: red;
            border-bottom-color: red;
            border-left-color: red;
        }
        100%{
            border-color: red;
        }
    }
    @keyframes write3{
        0%{
           border-bottom-color: white;
           border-right-color: white;
        }
       100%{
           border-bottom-color: red;
           border-right-color: red;
       }
    }
  • 相关阅读:
    今天到了1000分了,庆祝一下
    中文vs2008安装 mvc 1
    火车采集器使用感受
    存储过程中的case用法
    作为开发者的反思
    什么是程序员的优秀品质?
    遇到了乱码的问题(转载)
    利用网址导航站点推广
    国内优秀网址导航站总结 (转载)
    Unable to read local eventlog错误解决(转载)
  • 原文地址:https://www.cnblogs.com/FlyingLiao/p/10446650.html
Copyright © 2011-2022 走看看