css+js绘制五星红旗国庆快乐动画效果代码

代码语言:html

所属分类:布局界面

代码描述:css+js绘制五星红旗国庆快乐动画效果代码

代码标签: 国庆 快乐 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <style>
        *{ padding:0;margin:0;list-style-type:none;}
    html, body {
      align-items: center;
      display: flex;
      flex-direction: column;
      justify-content: center;
      height: 100vh;
      margin: 0;
      padding: 0;
      width: 100vw;
      font-size: 1.5vmin;
      overflow:hidden;
    }
    
    .container {
      display: flex;
      height: 100vh;
      width: 100vw;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }
    
    .btn-container {
      position: relative;
      text-align: center;
    }
    
    .btn {
      height: 4rem;
      width: 30rem;
      background: #fff;
      border: #B31C31 solid 0.125rem;
      border-radius: 0.625rem;
      color: #39386E;
      font-size: 2rem;
      font-weight: bold;
      cursor: pointer;
      margin-top: 3rem;
    }
    
    .btn:hover {opacity: 0.6}
    
    /* Fireworks */
    @-webkit-keyframes explosion {
      from {
        width: 0;
        opacity: 0;
      }
      33% {
        width: 0px;
        opacity: 0;
      }
      34% {
        width: 0.625rem;
        opacity: 1.0;
      }
      40% {
        width: 5rem;
        opacity: 1.0;
      }
      to {
        width: 5.625rem;
        opacity: 0;
      }
    }
    
    @-moz-keyframes explosion {
      from {
        width: 0;
        opacity: 0;
      }
      33% {
        width: 0;
        opacity: 0;
      }
      34% {
        width: 0.625rem;
        opacity: 1.0;
      }
      40% {
        width: 5rem;
        opacity: 1.0;
      }
      to {
        width: 5.625rem;
        opacity: 0;
      }
    }
    
    #stage {
      position: relative;
      height: 100vh;
      width: 100vw;
      background-color: #000028;
    }
    
    .launcher {
      position: absolute;
      -webkit-animation-duration: 4s;
      -webkit-animation-iteration-count: infinite;
      -moz-animation-duration: 4s;
      -moz-animation-iteration-count: infinite;
      background: #fff;
      border-bottom: 0.1875rem solid yellow;
    }
    
    .launcher div {
      position: absolute;
      opacity: 0;
      left: 0.1875rem;
      top: 0.1875rem;
      width: 0.625rem;
      height: 0.25rem;
      border-right: 0.25rem solid yellow;
      border-radius: 0.125rem;
      -webkit-animation-name: explosion;
      -webkit-animation-duration: 4s;
      -webkit-animation-iteration-count: infinite;
      -moz-animation-name: explosion;
      -moz-animation-duration: 4s;
      -moz-animation-iteration-count: infinite;
      -webkit-transform-origin: 0 0;
      -moz-transform-origin: 0 0;
    }
    
    @media(max-width: 500px) {
      .container {
        max-width: 80vw;
        max-height: 100vh;
        margin: 0 auto;
      }
    .........完整代码请登录后点击上方下载按钮下载查看

网友评论0