login
by Denis Tverdokhlebov
HTML
<!------------ Thanks Daniel Almeida for the reference ----------->
<!-- https://dribbble.com/shots/4027518-Login-screen-interaction -->
<div class="login-wrapper">
<div class="login-left">
<img src="http://res.cloudinary.com/dzqowkhxu/image/upload/v1513679279/bg-login_bxxfkf.png">
<div class="h1">Enter the Nebula</div>
</div>
<div class="login-right">
<div class="h2">Register</div>
<div class="form-group">
<input type="text" id="full-name" placeholder="Full Name">
<label for="full-name">Full Name</label>
</div>
<div class="form-group">
<input type="text" id="Email" placeholder="Email">
<label for="Email">Email</label>
</div>
<div class="form-group">
<input type="password" id="Password" placeholder="Password">
<label for="Password">Password</label>
</div>
<div class="checkbox-container">
<input type="checkbox">
<div class="text-checkbox">I agree with the terms of service.</div>
</div>
<div class="button-area">
<button class="btn btn-secondary">Login</button>
<button class="btn btn-primary">Sign Up</button>
</div>
</div>
</div>
CSS
@import url('https://fonts.googleapis.com/css?family=Lato:300,400,700');
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
height: 100%;
}
body {
font-family: 'Lato', sans-serif;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
background: linear-gradient(243.87deg, #F28FE5 30.6%, #371933 130.6%);
overflow: hidden;
}
input {
font-family: inherit;
-webkit-appearance: none;
-moz-appearance: none;
border: 0;
border-bottom: 1px solid #AAAAAA;
font-size: 16px;
color: #000;
border-radius: 0;
}
input[type="text"],
input[type="password"] {
width: 100%;
height: 40px;
}
button,
input:focus {
outline: 0;
}
::-webkit-input-placeholder {
font-size: 16px;
font-weight: 300;
letter-spacing: -0.00933333em;
}
.form-group {
position: relative;
padding-top: 15px;
margin-top: 10px;
}
label {
position: absolute;
top: 0;
opacity: 1;
-webkit-transform: translateY(5px);
transform: translateY(5px);
color: #aaa;
font-weight: 300;
font-size: 13px;
letter-spacing: -0.00933333em;
transition: all 0.2s ease-out;
}
input:placeholder-shown + label {
opacity: 0;
-webkit-transform: translateY(15px);
transform: translateY(15px);
}
.h1 {
color: #fff;
opacity: 0.8;
font-size: 20px;
font-weight: 400;
text-transform: uppercase;
letter-spacing: 0.2405em;
transition: all 770ms cubic-bezier(0.51, 0.04, 0.12, 0.99);
text-align: center;
cursor: pointer;
position: absolute;
}
.open .h1 {
-webkit-transform: translateX(200px) translateZ(0);
transform: translateX(200px) translateZ(0);
}
.h2 {
color: #000;
font-size: 20px;
letter-spacing: -0.00933333em;
font-weight:...
JavaScript
var openLoginRight = document.querySelector('.h1');
var loginWrapper = document.querySelector('.login-wrapper');
openLoginRight.addEventListener('click', function(){
loginWrapper.classList.toggle('open');
});