有时候后端开发工程师,也需要去写一些前端页面,并且前端组件可以找layui、vue等等,但如果想要一个好看酷炫的登录注册模板,那就很少了,今天就给大家提供一个前端非常酷炫的登录注册模板。最主要是拿来就能用哦~
1、酷炫光线环绕
CSS:
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background: linear-gradient(#141e30, #243b55);
}
.my-login-box {
position: absolute;
top: 50%;
left: 50%;
width: 400px;
padding: 40px;
transform: translate(-50%, -50%);
background: rgba(0, 0, 0, .5);
box-sizing: border-box;
box-shadow: 0 15px 25px rgba(0, 0, 0, .6);
border-radius: 10px;
}
.my-login-box h2 {
margin: 0 0 30px;
padding: 0;
color: #fff;
text-align: center;
}
.my-login-box .user-box {
position: relative;
}
.my-login-box .user-box input {
width: 100%;
padding: 10px 0;
font-size: 16px;
color: #fff;
margin-bottom: 30px;
border: none;
border-bottom: 1px solid #fff;
outline: none;
background: transparent;
}
.my-login-box .user-box label {
position: absolute;
top: 0;
left: 0;
padding: 10px 0;
font-size: 16px;
color: #fff;
pointer-events: none;
transition: .5s;
}
.my-login-box .user-box input:focus ~ label,
.my-login-box .user-box input:valid ~ label {
top: -30px;
left: 0;
color: #03e9f4;
font-size: 12px;
}
.my-login-box form a {
position: relative;
display: inline-block;
padding: 10px 20px;
color: #03e9f4;
font-size: 16px;
text-decoration: none;
text-transform: uppercase;
overflow: hidden;
transition: .5s;
margin-top: 40px;
letter-spacing: 4px
}
.my-login-box a:hover {
background: #03e9f4;
color: #fff;
border-radius: 5px;
box-shadow: 0 0 5px #03e9f4, 0 0 25px #03e9f4, 0 0 50px #03e9f4, 0 0 100px #03e9f4;
}
.my-login-box a span {
position: absolute;
display: block;
}
.my-login-box a span:nth-child(1) {
top: 0;
left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent, #03e9f4);
animation: btn-anim1 1s linear infinite;
}
@keyframes btn-anim1 {
0% {
left: -100%;
}
50%,
100% {
left: 100%;
}
}
.my-login-box a span:nth-child(2) {
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg, transparent, #03e9f4);
animation: btn-anim2 1s linear infinite;
animation-delay: .25s
}
@keyframes btn-anim2 {
0% {
top: -100%;
}
50%,
100% {
top: 100%;
}
}
.my-login-box a span:nth-child(3) {
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg, transparent, #03e9f4);
animation: btn-anim3 1s linear infinite;
animation-delay: .5s
}
@keyframes btn-anim3 {
0% {
right: -100%;
}
50%,
100% {
right: 100%;
}
}
.my-login-box a span:nth-child(4) {
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(360deg, transparent, #03e9f4);
animation: btn-anim4 1s linear infinite;
animation-delay: .75s
}
@keyframes btn-anim4 {
0% {
bottom: -100%;
}
50%,
100% {
bottom: 100%;
}
}
html:
<div class="my-login-box">
<h2>Login</h2>
<form>
<div class="user-box">
<input type="text" name="" required="">
<label>Username</label>
</div>
<div class="user-box">
<input type="password" name="" required="">
<label>Password</label>
</div>
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span> Submit
</a>
</form>
</div>
2、菱形交叉
CSS:
@import url("https://fonts.googleapis.com/css?family=Raleway:400,700");
*,
*:before,
*:after {
box-sizing: border-box;
}
body {
min-height: 100vh;
font-family: 'Raleway', sans-serif;
margin: 0;
}
.container {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
}
.container:hover .top:before,
.container:hover .top:after,
.container:hover .bottom:before,
.container:hover .bottom:after,
.container:active .top:before,
.container:active .top:after,
.container:active .bottom:before,
.container:active .bottom:after {
margin-left: 200px;
transform-origin: -200px 50%;
transition-delay: 0s;
}
.container:hover .center,
.container:active .center {
opacity: 1;
transition-delay: 0.2s;
}
.top:before,
.top:after,
.bottom:before,
.bottom:after {
content: '';
display: block;
position: absolute;
width: 200vmax;
height: 200vmax;
top: 50%;
left: 50%;
margin-top: -100vmax;
transform-origin: 0 50%;
transition: all 0.5s cubic-bezier(0.445, 0.05, 0, 1);
z-index: 10;
opacity: 0.65;
transition-delay: 0.2s;
}
.top:before {
transform: rotate(45deg);
background: #e46569;
}
.top:after {
transform: rotate(135deg);
background: #ecaf81;
}
.bottom:before {
transform: rotate(-45deg);
background: #60b8d4;
}
.bottom:after {
transform: rotate(-135deg);
background: #3745b5;
}
.center {
position: absolute;
width: 400px;
height: 400px;
top: 50%;
left: 50%;
margin-left: -200px;
margin-top: -200px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 30px;
opacity: 0;
transition: all 0.5s cubic-bezier(0.445, 0.05, 0, 1);
transition-delay: 0s;
color: #333;
}
.center input {
width: 100%;
padding: 15px;
margin: 5px;
border-radius: 1px;
border: 1px solid #ccc;
font-family: inherit;
}
html:
<div class="container" onclick="onclick">
<div class="top"></div>
<div class="bottom"></div>
<div class="center">
<h2>Please Sign In</h2>
<input type="email" placeholder="email" />
<input type="password" placeholder="password" />
<h2> </h2>
</div>
</div>
3、云卷云舒
CSS:
body {
padding: 0;
margin: 0;
}
.vid-container {
position: relative;
height: 100vh;
overflow: hidden;
}
.bgvid {
position: absolute;
left: 0;
top: 0;
width: 100vw;
}
.inner-container {
width: 400px;
height: 400px;
position: absolute;
top: calc(50vh - 200px);
left: calc(50vw - 200px);
overflow: hidden;
}
.bgvid.inner {
top: calc(-50vh + 200px);
left: calc(-50vw + 200px);
filter: url("data:image/svg+xml;utf9,<svg%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'><filter%20id='blur'><feGaussianBlur%20stdDeviation='10'%20/></filter></svg>#blur");
-webkit-filter: blur(10px);
-ms-filter: blur(10px);
-o-filter: blur(10px);
filter: blur(10px);
}
.box {
position: absolute;
height: 100%;
width: 100%;
font-family: Helvetica;
color: #fff;
background: rgba(0, 0, 0, 0.13);
padding: 30px 0px;
}
.box h1 {
text-align: center;
margin: 30px 0;
font-size: 30px;
}
.box input {
display: block;
width: 300px;
margin: 20px auto;
padding: 15px;
background: rgba(0, 0, 0, 0.2);
color: #fff;
border: 0;
}
.box input:focus,
.box input:active,
.box button:focus,
.box button:active {
outline: none;
}
.box button {
background: #2ecc71;
border: 0;
color: #fff;
padding: 10px;
font-size: 20px;
width: 330px;
margin: 20px auto;
display: block;
cursor: pointer;
}
.box button:active {
background: #27ae60;
}
.box p {
font-size: 14px;
text-align: center;
}
.box p span {
cursor: pointer;
color: #666;
}
html:
<div class="vid-container">
<video class="bgvid" autoplay="autoplay" muted="muted" preload="auto" loop>
<source src="/uploads/141102/mountain.webm?1410742112" type="video/webm">
</video>
<div class="inner-container">
<video class="bgvid inner" autoplay="autoplay" muted="muted" preload="auto" loop>
<source src="/uploads/141102/mountain.webm?random=1" type="video/webm">
</video>
<div class="box">
<h1>Login</h1>
<input type="text" placeholder="Username" />
<input type="text" placeholder="Password" />
<button>Login</button>
<p>Not a member? <span>Sign Up</span>
</p>
</div>
</div>
</div>
4、闭眼模板
CSS:
@import url(http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900);
* {
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
width: 100%;
font-family: "Lato";
overflow-x: hidden;
}
.preload * {
-webkit-transition: none !important;
-moz-transition: none !important;
-ms-transition: none !important;
-o-transition: none !important;
transition: none !important;
-webkit-animation: none !important;
-moz-animation: none !important;
-ms-animation: none !important;
-o-animation: none !important;
animation: none !important;
}
#hero {
height: 350px;
background: #1cb0ec;
position: relative;
overflow: hidden;
}
#hero figure {
position: absolute;
right: 80px;
top: 100px;
color: #fff;
}
#hero figure blockquote {
font-weight: 100;
}
#hero h1 {
font-weight: 100;
color: #fff;
font-size: 88px;
padding-top: 60px;
padding-left: 80px;
}
#hero span {
position: absolute;
bottom: -50px;
width: 250px;
left: 0;
right: 0;
margin: 0 auto;
z-index: 10;
}
#hero .img_holder.password .left_arm img {
left: 78px;
bottom: 47px;
}
#hero .img_holder.password .right_arm img {
right: 86px;
bottom: 47px;
}
#hero .img_holder.password:before {
left: 78px;
bottom: 105px;
}
#hero .img_holder.password:after {
right: 85px;
bottom: 105px;
}
#hero .img_holder img.dr-glue-little {
width: 250px;
z-index: 10;
}
#hero .img_holder:before {
content: '';
position: absolute;
height: 20px;
width: 40px;
background: #e9c09b;
left: 10px;
bottom: 40px;
z-index: 999;
border-radius: 100%;
transition: 1s;
-webkit-transition: 1s;
-moz-transition: 1s;
}
#hero .img_holder:after {
content: '';
position: absolute;
height: 20px;
width: 40px;
background: #e9c09b;
right: 10px;
bottom: 40px;
z-index: 999;
border-radius: 100%;
transition: 1s;
-webkit-transition: 1s;
-moz-transition: 1s;
}
#hero .img_holder .left_arm img,
#hero .img_holder .right_arm img {
position: absolute;
transition: 1s;
-webkit-transition: 1s;
-moz-transition: 1s;
z-index: 9999;
width: 45px;
}
#hero .img_holder .left_arm img {
left: 9px;
bottom: -22px;
}
#hero .img_holder .right_arm img {
right: 7px;
bottom: -22px;
}
form {
position: relative;
width: 400px;
height: 280px;
margin: 0 auto;
z-index: 999999999;
}
form .input_holder {
position: relative;
width: 300px;
margin: 0 auto;
}
form .input_holder:nth-of-type(1) {
margin-top: 40px;
}
form .input_holder:nth-of-type(2) {
margin-top: 20px;
margin-bottom: 20px;
}
form .input_holder span {
position: absolute;
left: 10px;
top: 8px;
}
form .input_holder span:after {
content: '';
position: absolute;
width: 1px;
height: 20px;
background: #ccc;
left: 21px;
top: 0;
}
form .input_holder input {
display: block;
width: 300px;
margin: 0 auto;
background: #fafafa;
border: 0;
outline: 0;
margin: 10px 0;
padding: 10px;
text-indent: 30px;
font-weight: 300;
}
form .input_holder input:-webkit-autofill {
-webkit-box-shadow: 0 0 0 1000px #fafafa inset;
}
form .submit_button {
width: 320px;
height: 36px;
border: 0;
color: #fff;
position: relative;
margin-left: 50px;
cursor: pointer;
background: #1cb0ec;
border-bottom: 4px solid #1091c5;
}
form .submit_button:active {
outline: 0;
border-bottom: none;
}
#footer {
color: #000;
text-align: center;
}
#footer p {
font-size: 16px;
}
#footer p a {
text-decoration: none;
color: #1cb0ec;
position: relative;
transition: 0.5s;
-webkit-transition: 0.5s;
}
#footer p a:hover {
color: #4bc0f0;
}
#footer p a:before,
#footer p a:after {
content: '';
position: absolute;
background: #1cb0ec;
height: 2px;
left: 0;
right: 0;
opacity: 0;
transition: 0.5s;
-webkit-transition: 0.5s;
}
#footer p a:before {
top: -10px;
}
#footer p a:after {
bottom: -10px;
}
#footer p a:hover:before,
#footer p a:hover:after {
opacity: 1;
}
#footer p a:hover:before {
top: -3px;
}
#footer p a:hover:after {
bottom: -5px;
}
JS:
window.onload = function() {
var p = document.getElementById("password_field");
p.onfocus = function() {
document.querySelector(".img_holder").className += " password";
}
p.onblur = function() {
document.querySelector(".password").className = "img_holder";
}
document.querySelector("body").className = "";
}
html:
<div id="hero">
<div id="background_animate"></div>
<h1>Internal Tools</h1>
<span class="img_holder">
<img class="dr-glue-little" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/63425/drglue.png" alt="Dr Glue Little">
<div class="left_arm">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/63425/left-arm.png" alt="Left Arm">
</div>
<div class="right_arm">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/63425/right-arm.png" alt="Right Arm">
</div>
</span>
</div>
<form action="#" method="post" accept-charset="utf-8">
<div class="input_holder">
<span><i class="fa fa-user"></i></span>
<input type="text" name="username" placeholder="Username" required>
</div>
<div class="input_holder">
<span><i class="fa fa-lock"></i></span>
<input type="password" name="password" id="password_field" placeholder="Password" required>
</div>
<input type="submit" class="submit_button" value="Log in">
</form>
由于篇幅有限,此文章仅作效果展示,如果需要,请前往下载: