jquery+svg实现提交按钮点击动画效果代码

代码语言:html

所属分类:其他

代码描述:jquery+svg实现提交按钮点击动画效果代码

代码标签: jquery svg 提交 按钮 点击 动画

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

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">

<style>
    @import url('https://fonts.googleapis.com/css?family=Roboto:400');

* {
    -webkit-tap-highlight-color:rgba(0,0,0,0);
    outline:none;
}

#button-wrapper {
  font-family: 'Roboto', sans-serif;
  font-size:21px;
  text-transform:uppercase;
  letter-spacing:6px;
  color:white;
  width:100%;
  height: 100px;
  position: absolute;
  top: calc(50% - 70px);
  left: 0;
  padding:20px 0px;
  overflow: visible;
}

.submit, .loader, .loader-wrapper{
  position:absolute;
  left:0;
  right:0;
  margin:0 auto;
}

.submit {
  z-index:2;
  width:325px;
  height:95px;
  background: linear-gradient(to right, #ffb369 0%,#ff4272 100%); 
  display:block;
  border-radius:200px;
  text-align:center;
  color:rgba(255,255,255,1);
  text-decoration:none;
  line-height:440%;
  transition: all 0.7s ease, line-height 0s ease, color 0.4s ease, filter 0.2s ease;
}

#button-wrapper::selection, .submit::selection {
  background: transparent;
}

.submit:before {
  content:"";
  z-index:-2;
  width:100%;
  height:100%;
  background: linear-gradient(to right, #ffb369 0%,#ff4272 100%); 
  display:block;
  border-radius:200px;
  position:absolute;
  left:0;
  top:0;
  opacity:0.8;
  transform:scale(0.9) translateY(15px);
  filter:blur(20px);
  transition:all 0.2s ease;
}

.submit:after {
  content:"";
  z-index:-4;
  width:100%;
  height:100%;
  background: linear-gradient(to right, #ffb369 0%,#ff4272 100%); 
  display:block;
  border-radius:200px;
  position:absolute;
  left:0;
  top:0;
  opacity:0;
  transform:scale(1);
}

.submit:hover:before {
  transform:scale(0.9) translateY(5px);
  filter:blur(15px);
}

.submit:active {
  line-height:460%;
  filter:brightness(0.95);
  transition:all 0s;
}

.checked .submit:before {
  top:0px;
  opacity:0;
}

.checked .submit:after {
    animation: submit-after-anim 0.5s 4.4s cubic-bezier(0.39, 0.575, 0.565, 1);
}

.checked {
   -webkit-filter: url("#goo");
   filter: url("#goo");
}

.yellow {
  background-color: #ffb369;
}

.pink {
  background-color: #ff4272;
  }

.orange {
  background-color: #ff7b6e;
  transform:scale(0.2) rotate(30deg) translate(0px);
}

.checked .pink {
  animation: loader-anim-pink 4s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.checked .yellow  {
  animation: loader-anim-yellow 4s 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.checked .orange {
   animation: loader-anim-orange 4s 0.7s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.loader {
  width:95px;
  height:95px;
  border-radius:50%;
  opacity:0;
  z-index:1;
}

.checked .loader {
  opacity:1;
}

.checked .loader-wrapper {
  animation: wrapper-loader-anim 4.2s linear;
  width:95px;
  height:95px;
  transform:scale(0)
}

.checked .submit {
  width:95px;
  color:rgba(255,255,255,0);
  background: linear-gradient(to right, #ff7b6e 0%,#ff7b6e 100%);
  animation: submit-anim 4s  cubic-bezier(0.39, 0.575, 0.565, 1);
  }


.check-wrapper {
  position:absolute;
  left:0;
  right:0;
  margin:0 auto;
  width:95px;
  height:95px;
  z-index:-1;
  opacity:1;
}

.check-wrapper svg {
  margin-top: 31px;
  margin-left: 16px;
}

.check{fill:none;
  stroke:#.........完整代码请登录后点击上方下载按钮下载查看

网友评论0