react+gsap实现密码输入强度动画显示效果代码

代码语言:html

所属分类:表单美化

代码描述:react+gsap实现密码输入强度动画显示效果代码

代码标签: 输入 强度 动画 显示 效果

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


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

<head>

 
<meta charset="UTF-8">

 
 
<style>

* {
 
margin: 0;
 
padding: 0;
 
box-sizing: border-box;
 
user-select: none;
}

#app {
 
height: 100vh;
 
width: 100%;
 
display: flex;
 
align-items: center;
 
justify-content: center;
 
background: #efefef;
}
#app .Main {
 
display: flex;
 
flex-direction: column;
 
align-items: center;
 
justify-content: center;
 
transform: scale(1.6) translateY(-12%);
}
#app form {
 
position: relative;
 
top: -18px;
}
#app .field {
 
position: relative;
 
display: flex;
 
align-items: center;
 
justify-content: flex-start;
 
height: 48px;
 
width: 100%;
}
#app .field label, #app .field i {
 
display: flex;
 
align-items: center;
 
height: 100%;
 
position: absolute;
 
pointer-events: none;
}
#app .field i {
 
left: 0;
 
color: #bdbdbd;
 
padding: 6px;
 
padding-left: 18px;
 
transform-origin: center;
 
cursor: pointer;
}
#app .field label {
 
left: 43.2px;
 
font-size: 14px;
 
font-family: SemplicitaPro;
 
color: #bdbdbd;
}
#app .field input {
 
width: 180px;
 
height: 100%;
 
padding-left: 43.2px;
 
padding-right: 12px;
 
font-size: 16px;
 
border-radius: 30px;
 
border: 1px solid #dbdbdb;
 
font-family: SemplicitaPro;
 
color: #ff79e6;
 
caret-color: #dbdbdb;
 
outline: none;
 
box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.05);
}
#app svg {
 
position: relative;
 
left: 6px;
 
width: 100%;
 
max-width: 180px;
 
pointer-events: none;
}
#app svg .shield .st0 {
 
fill: #ffe1f7 !important;
}
#app svg .shield .st1 {
 
fill: white;
}
#app svg .shield .st2 {
 
stroke: #ffe1f7;
 
stroke-width: 1;
 
stroke-miterlimit: 10;
}
#app svg .crown {
 
transform: scale(0.8);
 
transform-origin: 50% 40%;
}
#app svg .wind-left {
 
transform: scale(0.6);
 
transform-origin: 20% 85%;
}
#app svg .wind-right {
 
transform: scale(0.6);
 
transform-origin: 80% 85%;
}
#app svg .st0 {
 
fill: white;
 
stroke: #892276;
 
stroke-width: 1;
 
stroke-miterlimit: 10;
}
#app svg .st1 {
 
fill: #ffe1f7;
}
#app svg .st2 {
 
fill: #ffa6f7;
}
#app svg .st3 {
 
fill: #ffa6f7;
 
stroke: #892276;
 
stroke-width: 1;
 
stroke-miterlimit: 10;
}
#app svg .st4 {
 
fill: #ff79e6;
}
#app svg .st5 {
 
fill: none;
 
stroke: #892276;
 
stroke-width: 1;
 
stroke-linecap: round;
 
stroke-linejoin: round;
 
stroke-miterlimit: 10;
}

@media (max-height: 720px) {
 
#app .Main {
   
transform: scale(1.2) translateY(-12%);
 
}
}
</style>


</head>

<body >

<div id="app"></div>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react.dev.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react-dom.dev.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/fontawesome-kit.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gsap.3.5.2.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/DrawSVGPlugin.js"></script>
     
<script >
// Components

const Main = () => {
  return /*#__PURE__*/(
    React.createElement("main", { className: "Main" }, /*#__PURE__*/
    React.createElement(SVG, null), /*#__PURE__*/
    React.createElement(Form, null)));


};

const Form = () => {
  return /*#__PURE__*/(
    React.createElement("form", null, /*#__PURE__*/
    React.createElement(PasswordField, null)));


};

const PasswordField = () => {
  return /*#__PURE__*/(
    React.createElement("div", { className: "field" }, /*#__PURE__*/
    React.createElement("label", { for: "password" }, "Password"), /*#__PURE__*/
    React.createElement("input", { type: "password".........完整代码请登录后点击上方下载按钮下载查看

网友评论0