vue实现疯狂的输入框效果

代码语言:html

所属分类:表单美化

代码描述:vue实现疯狂的输入框效果

代码标签: 输入 效果

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


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

<style>
body {
  background: #84fab0;
  background-image: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  overflow:hidden;
}

.red {
  background-image: -webkit-gradient(linear, left top, right top, from(#f78ca0), color-stop(19%, #f9748f), color-stop(60%, #fd868c), to(#fe9a8b));
  background-image: linear-gradient(to right, #f78ca0 0%, #f9748f 19%, #fd868c 60%, #fe9a8b 100%);
}

.container {
  position:absolute;
  left:50%;
  top:50%;
  -webkit-transform: translate(-50%,-50%);
          transform: translate(-50%,-50%);
  margin-top:-30px;
  text-align:center;
}

h1 {
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.nice-input {
  position: relative;
}

.nice-input input {
  border:none;
  border-radius:4px;
  padding:7px 10px;
  font-family: 'Lato', sans-serif;
  font-size:14px;
  box-shadow: rgba(0,0,0,.05) 0 5px 20px;
  letter-spacing:0;
  width:165px;
  color: transparent;
  font-weight:900;
  caret-color: #555;
}

.nice-input input:focus {
  outline:none;
  box-shadow: rgba(0,0,0,.1) 0 5px 20px;
}

.nice-input label {
  position: absolute;
  top: 6px;
  left: 10px;
  letter-spacing:0;
  font-size:0;
}

.nice-input span {
  font-family: 'Lato', sans-serif;
  font-size:14px;
  font-weight:900;
}

.nice-input__animate {
  -webkit-animation: print .2s 1 ease-in-out;
          animation: print .2s 1 ease-in-out;
}

.nice-input--shaked {
  -webkit-animation: shake .2s 1 ease-in-out;
          animation: shake .2s 1 ease-in-out;
}
.nice-input--caret {
  caret-color: transparent;
}

@-webkit-keyframes print {
  from{
  position:absolute;
  -webkit-transform: scale(50);
          transform: scale(50);
  /* uncomment for freeze */  
  /*   filter:blur(1px); */
  }
  99% {
  position:absolute;
  }
  to {
  position:relative;
  }
}

@keyframes print {
  from{
  position:absolute;
  -webkit-transform: scale(50);
          transform: scale(50);
  /* uncomment for freeze */  
  /*   filter:blur(1px); */
  }
  99% {
  position:absolute;
  }
  to {
  position:relative;
  }
}

@-webkit-keyframes shake {
  from,
  to {
  }
  50% {
    -webkit-transform:scale(0.97);
       .........完整代码请登录后点击上方下载按钮下载查看

网友评论0