<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Login</title>
        <link rel="stylesheet" href="css/style.css" />
    </head>
    <body>
        <div class="box">
        
                <h2>Login</h2>
        <form action="">
            
            <div class="item">
                <input type="text" required >
                <label for="">UserName</label>
                </div>

<div class="item">
                <input type="password" required >
                <label for="">Password</label>
                </div>

<button class="btn">Login
                <span></span>
                <span></span>
                <span></span>
                <span></span>
                </button>
        </form>

    </body>
</html>
*{
    padding: 0;
    margin: 0;

}

input,button{
    border: none;
    background: transparent;
    outline: none;
}
body{
    height: 100vh;
justify-content: center;
align-items: center;
display: flex;
    background: linear-gradient(#141e30,#243b55);
}
.box{
    margin: 0px auto;
    width: 400px;
    height: 350px;
    background: rgba(0,0,0,.5);
    box-shadow: 0 10px 25px 0 rgba(0,0,0,.5);
    padding-top: 40px;
    border-radius: 6px;
    
}
h2{
    text-align: center;
}

.item{
    height: 45px;
    width: 85%;
    margin: 0 auto;
    border-bottom: 1px solid #333;
    margin-bottom: 30px;
    position: relative;

}

item,input{
    width: 100%;
    height: 100%;
    color: #333333;
    padding-top: 20px;
    box-sizing: border-box;
}
item,label{
    position: absolute;
    left: 0px;
    top: 10px;
    color: aquamarine;
        transition: all .4s ease; 
}

.item input:focus +label,.item input:valid +label{
    top: 0px;
    font-size: 13px;
    color: brown;
    }
    
    .btn{
        padding:10px 20px;
        margin-left: 30px;
    margin-top: 30px;
    color: #7FFFD4;
    overflow: hidden;
        position: relative;
        text-transform: uppercase;
    }
    .btn>span{
        position: absolute;
    }
    
    .btn:hover{
        border-radius: 5px;
        border: 2px solid #03E9F4;
        box-shadow: 0 0 5px 0 #03E9F4,
        0 0 25px 0 #03E9F4,
        0 0 50px 0 #03E9F4,
        0 0 100px 0 #03E9F4;
    }
    
.btn>span:nth-child(1){
    width: 100%;
    height: 2px;
    background: -webkit-linear-gradient(left,transparent,#03e9f4);
left: -100%;
top: 0px;
animation: line 1s linear infinite;
}
@keyframes line{
50%,100%{
    left: 100%;
}
}
.btn>span:nth-child(2){
    width: 2px;
    height: 100%;
    background: -webkit-linear-gradient(top,transparent,#03e9f4);
right: 0px;
top: -100%;
animation: line2 1s 0.25s linear infinite;
}

@keyframes line2{
50%,100%{
    top: 100%;
}
}
.btn>span:nth-child(3){
        width: 100%;
    height: 2px;
    background: -webkit-linear-gradient(left,transparent,#03e9f4);
left:  100%;
bottom: 0px;
animation: line3 1s 0.5s linear infinite;
}

@keyframes line3{
50%,100%{
    left: -100%;
}
}

.btn>span:nth-child(4){
    width: 2px;
    height: 100%;
    background: -webkit-linear-gradient(bottom,transparent,#03e9f4);
left: 0px;
top: 100%;
animation: line4 1s 0.75s linear infinite;
}

@keyframes line4{
50%,100%{
    top: -100%;
}
}
最后修改:2020 年 05 月 19 日
如果觉得我的文章对你有用,请随意赞赏