简易登录系统的实现




    
    登录
    
    


body {
    background: url("../Image/Login-Img/login_background.png") no-repeat fixed center 0;
    background-size: cover;
    -webkit-background-size: cover;
    -o-background-size: cover;
    -moz-background-size: cover;
    -ms-background-size: cover;
}

.content {
    width: 100vm;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-image {
    width: 360px;
    height: 500px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    background: url("../Image/Login-Img/login_image.png") no-repeat center;
    -moz-opacity: 0.5;
    opacity: 0.5;
    filter: alpha(opacity=50);
    border-radius: 10px;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
}

.login-wrap {
    position: absolute;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.login-wrap h3 {
    color: #fff;
    font-size: 18px;
    text-align: center;
}

.name, .code {
    border: 1px solid #fff;
    width: 230px;
    height: 40px;
    margin-left: 25px;
    margin-bottom: 20px;
    padding-left: 40px;
}

input::-webkit-input-placeholder {
    color: white;
}

input:-moz-placeholder {
    color: white;
}

input::-moz-placeholder {
    color: white;
}

input:-ms-input-placeholder {
    color: white;
}
.name {
    background: url("../Image/Login-Img/user.png") no-repeat 12px 12px;
}

.code {
    background: url("../Image/Login-Img/passwd.png") no-repeat 12px 12px;
}

.btn input {
    height: 40px;
    width: 120px;
    float: left;
    margin-right: 25px;
    border: none;
    color: #fff;
    font-size: 16px;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    margin-top: 10px;
    cursor: pointer;
}

input:active {
    border-color: #147a62;
}

.submit {
    background: #73d7ea;
    margin-left: 25px;
}

.reset {
    background: #bbb;
}

 

function verifyLogin() {
    var x = document.forms["user_login"]["accountName"].value;
    var y = document.forms["user_login"]["password"].value;
    if ((x == null || x == "") && (y == null || y == "")) {
        alert("请输入用户名和密码");
        return false;
    } else if ((x == null || x == "") && (y != null && y != "")) {
        alert("请输入用户名");
    } else if ((y == null || y == "") && (x != null && x != "")) {
        alert("请输入密码");
    } else if ((x != null || x != "") && (y != null || y != "")) {
        if (x=="admin"&&y=="1234"){
            alert("登录成功!");
        }else{
            alert("登录失败!");
        }
    }
}

 

你可能感兴趣的:(JavaScript)