完成按钮点击动画效果

代码语言:html

所属分类:动画

代码描述:完成按钮点击动画效果

代码标签: 动画 效果

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


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

<head>

  <meta charset="UTF-8">
  

  
  
<style>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:700,300);
.frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  margin-top: -200px;
  margin-left: -200px;
  border-radius: 2px;
  box-shadow: 4px 8px 16px 0 rgba(0, 0, 0, 0.1);
  overflow: hidden;
  background: #57D895;
  color: #333;
  font-family: 'Open Sans', Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden {
  display: none;
}

.button {
  position: absolute;
  display: block;
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  text-transform: uppercase;
  width: 260px;
  font-size: 21px;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  box-sizing: border-box;
  top: 170px;
  left: 70px;
  text-align: center;
  letter-spacing: 2px;
  height: 60px;
  line-height: 56px;
}
.button:hover {
  background: #37BE77;
}
.button img {
  position: absolute;
  top: 16px;
  left: 15px;
  opacity: 0;
  z-index: 2;
}

.circle {
  position: absolute;
  top: 170px;
  left: 170px;
  width: 60px;
  height: 60px;
  fill: none;
  stroke: #fff;
  stroke-width: 2px;
  stroke-dasharray: 183 183;
  stroke-dashoffset: 183;
  stroke-linecap: round;
  pointer-events: none;
  -webkit-transform: rotate(-90deg);
          transform: rotate(-90deg);
}

input:checked ~ .button {
  -webkit-animation: button 1s ease both, fill .5s ease-out 1.5s forwards;
          animation: button 1s ease both, fill .5s ease-out 1.5s forwards;
}
input:checked ~ .button img {
  -webkit-animation: check .5s ease-out 1.5s both;
          animation: check .5s ease-out 1.5s both;
}
input:checked ~ .circle {
  -webkit-animation: circle 2s ease-out .5s both;
          animation: circle 2s ease-out .5s both;
}

@-webkit-keyframes button {
  0% {
    width: 260px;
    height: 70px;
    color: #fff;
    border-color: #fff;
  }
  50% {
    color: transparent;
  }
  100% {
    width: 60px;
    left: 170px;
    bord.........完整代码请登录后点击上方下载按钮下载查看

网友评论0