登录中的动态效果

在这里插入图片描述

<!doctype html>
<html class="no-js" lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <meta name="description" content="">
    <link rel="stylesheet" href="css/style55.css">
    <link rel="stylesheet" href="css/layui.css">

<!-- <style>.groupname input{border: 1px solid red;}</style>
    <style>.groupname input{border: 1px solid blue;}</style> -->
</head>
<body>
<section>
    <div class="cheBackground">
        <div class="a1top">
            <img src="images/chebiao.png" alt="">
            <p>锡心TAXT <span>&nbsp; &middot; &nbsp;</span> 欢迎登录</p>

        </div>
        <div class="a1centre">
            <div class="centre_content">
                <div class="content_left">
                    <p>无锡巡游出租车欢迎您</p>
                </div>
                <div class="content_right">
                    <div class="headline">
                        <div class="headtop">
                            <h3>欢迎登录锡心TAXI</h3>
                            <div class="xixin">
                                <p>锡心TAXI后台管理中心</p>
                            </div>
                        </div>
                    </div>
                    <form>
                        <div class="groupyong">
                            <div class="groupming">
                                <label for="">用户名</label>
                                <div class="groupname">
                                    <!-- <input type="text" class="wrong input" id="login_user_name" name="username" aria-label="用户名" placeholder="请输入您的用户名"> -->
                                    <input class="input" id="login-username" type="text" aria-label="用户名" placeholder="请输入您的用户名">
				                    <div class="hint"></div>
                                </div>
                            </div>
                        </div>
                        <div class="groupmi">
                            <div class="groupming">
                                <label for=""> &nbsp; &nbsp;密码</label>
                                <div class="groupname">
                                    <!-- <input type="text" class="input" id="login_password" name="password" aria-label="密码" placeholder="请输入您的密码"> -->
                                    <input class="input" id="login-password" type="password" aria-label="密码" placeholder="请输入您的密码">
                                    <div class="hint"></div>
                                </div>
                            </div>
                        </div>
                        <div class="groupbutton">
                           <div class="deng">
                               <button>&nbsp;</button>
                           </div> 
                        </div>
                        <div class="groupfu">
                            <div class="fu_zong">
                                <div class="fu_in">
                                    <input type="checkbox" name="">
                                    <p>下次自动登录</p>
                                </div>
                                <p>记住密码</p>
                            </div>
                        </div>
                    </form>
                   
                </div>
            </div>
            <!-- <img src="images/denglvbeijing.png" alt=""> -->
        </div>
        <div class="afterbody">
            <p>Copyright © 南京交投科技有限公司版权所有 备案号:苏ICP备19018112号-1</p>
        </div>
    </div>
    <script>
        $(document).ready(function () {
            $('.signin-form').on('submit', function () {
                var $data = $(this).serialize();

                Dolphin.loading();
                $.post($(this).attr('action'), $data, function (res) {
                    Dolphin.loading('hide');
                    if (res.code) {
                        Dolphin.notify('登录成功,页面即将跳转~', 'success');
                        setTimeout(function () {
                            location.href = res.url;
                        }, 1500);
                    } else {
                        $('#captcha').click();
                        Dolphin.notify(res.msg, 'danger');
                    }
                }).fail(function () {
                    Dolphin.loading('hide');
                    Dolphin.notify('服务器错误~', 'danger');
                });
                return false;
            });
        });
    </script>
    <script type="text/javascript" src="js/form.js"></script> 
</section>
</body>
</html>
@charset "utf-8";
html,body {margin:0; padding:0; border:0; text-align:left; font-size:12px; line-height:1.8em;
    font-family:"Microsoft Yahei"; color:#000;}
.cheBackground{
    background: url(../images/chebeijing.jpg) no-repeat center;
    background-size: cover;
    
}
.a1top{
    padding-left: 240px;
    padding-top: 26px;
    padding-bottom: 130px;
    display: flex;
}
.a1top img{
  width: 40px;
  height: 32px;
}
.a1top p{
    font-size: 20px;
    color: #fff;
    margin-left: 10px;
    font-weight: 600;
}
.a1centre{
    height: 530px;
    display: flex;
    justify-content: space-around;
}
.centre_content{
    display: flex;
    width: 1050px;
  background: url(../images/denglvbeijing.png) no-repeat;  
}
.content_left{
    width: 524px;
    height: 520px;
}
.content_left p{
    font-size: 16px;
    color: #9db4df;
    margin-top: 420px;
    margin-left: 170px;
    letter-spacing: 4px;
}
.content_right{
    width: 524px;
    height: 520px;
}
.headline{
    display: flex;
    justify-content: space-around;
    margin-top: 91px;
    margin-bottom: 45px;
}
.headtop{
    justify-content: space-around;
}
.headtop h3{
    font-weight: 600;
    font-size: 25px;
    color: #000;
}
.headtop p{
    font-size: 15px;
    color: rgb(129, 129, 129);
}
.xixin{
    display: flex;
    justify-content: space-around;
    margin-top: 3px;
}
.groupyong{
    display: flex;
    justify-content: space-around;
}
.groupming{
    display: flex;
    margin-bottom: 30px;
    margin-right: 65px;
}
.groupming label{
    font-size: 16px;
    height: 42px;
    line-height: 42px;
    margin-right: 20px;
}
.groupname{
    position: relative;
    left: 20px;
    width: 340px;
}
.hint{
    float: left;
    margin-top: 12px;
    margin-left: 10px;
}

.groupname input{
    width: 300px;
    height: 42px;
    color: #000;
    padding-left: 12px;
    border: 1px solid #e6e6e6;
    float: left;
}
.groupname .right{
    border: 1px solid #4457d7;
}
.groupname .wrong{
    border: 1px solid red;
}

.groupmi{
    display: flex;
    justify-content: space-around;
}
.groupbutton{
    display: flex;
    justify-content: space-around;
}
.deng{
    margin-bottom: 25px;
}
.deng button{
    width: 300px;
    height: 42px;
    background-color: #4457d7;
    color: #fff;
    border-radius: 2px;
    border: 1px solid #4457d7;
}
.groupfu{
    display: flex;
    justify-content: space-around;
}
.fu_zong{
    width: 300px;
    display: flex;
    justify-content: space-between;
}
.fu_in{
    display: flex;
}
.fu_in input{
    margin-top: 4px;
    
}
.fu_zong p{
    color: rgb(129, 129, 129);
}
.fu_in p{
    color: #000;
    margin-left: 5px;
}
.afterbody{

    padding-top: 130px;
    display: flex;
    justify-content: space-around;
    padding-bottom: 45px;
}
.afterbody p{
    color: #fff;
}
(function(){
    var hintText={
            user_name:{hint:"⚠️请输入3-12个字符的用户名(包括字母/数字/下划线)",right:"<img src='images/dui.png' alt=''>",wrong:"<img src='images/cuo.png' alt=''>"},
            password:{hint:"⚠️请输入6位以上密码",right:"<img src='images/dui.png' alt=''>",wrong:"<img src='images/cuo.png' alt=''>"}
            };
    var regEvent=function(node, event, func){
        if (node.addEventListener)
            node.addEventListener(event, func);
        else if (node.attachEvent)
            node.attachEvent("on" + event, func);
        else
            node["on" + event] = func;
    };
    function regValue(id,i){
        var flag=false,
        input=document.getElementById(id),
        value=input.value;
        switch (id){
            case "user_name":
            // case "login_user_name":
            case "login-username":
            case "info_user_name":
                flag=/^[a-zA-Z0-9_]{3,16}$/.test(value.replace(/[\u0391-\uFFE5]/g,"nn"));
                id="user_name";
                break;
            case "password":
            // case "login_password":
            case "login-password":    
            case "info_password":
                flag=/^\S{3,16}$/.test(value);
                id="password";
                break;

        }
        if(flag) {
            index=0;
            input.className="right input";
            // hint[i].className="hint hint_right";
            hint[i].innerHTML=hintText[id].right;
        }else{
            input.className="wrong input";
            // hint[i].className="hint hint_wrong";
            hint[i].innerHTML=hintText[id].wrong;
            index=1;
        }
    };
    var inputs=document.getElementsByClassName("input"),
    id,
    hint=document.getElementsByClassName("hint"),
    index=0;
    for(var j=0;j<inputs.length;j++){
        (function(i){
            regEvent(inputs[i],"focus",function(){
                hint[i].style.visibility="visible";
                id=inputs[i].id;
            });
            regEvent(inputs[i],"blur",function(){
               regValue(id,i);
            });
        })(j)
    }
 
})();
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值