<div class="login-wrap">
<div class="login">
<div class="avatar">
</div>
<span class="user">Matt Boldt</span>
<form id="login" class="login-form">
<input type="password" placeholder="Password" class="pass"/><span class="arrow">→</span>
</form>
</div>
</div>
<div class="wrap">by <a href="https://www.mattboldt.com">Matt Boldt</a><br /><span class="info">Check out the history of Apple.com's Nav bar <a href="https://www.mattboldt.com/demos/css-apple-nav/">here</a> or <a href="https://codepen.io/mattboldt/pen/fJgDj">here</a>.</span></div>
<div class="hint">Press enter!</div>
body{
font-family: "Helvetica Neue", sans-serif;
background:url(https://i.imgur.com/W8IdvVk.jpg);
background-size:2000px 1000px;
background-position:top center;
}
a{
color:#fff;
text-decoration: none;
text-shadow:#000 0px 1px 3px;
}
.wrap{
width:600px;
margin:auto;
text-align: center;
opacity:0.8;
}
.wrap:hover{
opacity:1;
}
.login-wrap{
width:290px;
height:320px;
margin:15% auto 0;
position: relative;
}
.login{
display: block;
margin:auto;
padding:40px 40px 30px;
position: absolute;
background-color:#f8f8f8;
background-image:linear-gradient(top, #f0f0f0, #ddd);
background-image:linear-gradient(top, #f0f0f0, #ddd);
background-image:linear-gradient(top, #f0f0f0, #ddd);
border-radius:5px;
border:#fff 1px solid;
box-shadow: rgba(0,0,0,0.5) 0px 3px 20px;
text-align: center;
}
.avatar{
display:block;
margin:0 auto 15px;
width:100px;
height:100px;
border-radius:100%;
border:#fff 3px solid;
box-shadow:rgba(0,0,0,0.4) 0px 2px 4px, inset rgba(0,0,0,0.4) 0px 3px 2px;
overflow:hidden;
background-image:linear-gradient(top left, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 50%), url("https://www.mattboldt.com/assets/img/avatar.jpg");
background-image:linear-gradient(top left, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 50%), url("https://www.mattboldt.com/assets/img/avatar.jpg");
background-image:linear-gradient(top left, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 50%), url("https://www.mattboldt.com/assets/img/avatar.jpg");
background-size: auto, 100%;
}
.user{
padding:10px 0;
font-size: 0.95em;
text-shadow:rgba(255,255,255,0.7) 0px 1px 0px;
}
.pass{
display: block;
width:170px;
margin:20px auto;
padding:10px 25px 10px 10px;
border-radius:3px;
border:#CCC 1px solid;
}
.login-form{
position: relative;
}
.arrow{
position: absolute;
right:10px;
top:8px;
display: block;
z-index:999;
color:#999;
opacity:0;
transition:all 0.5s ease-in-out;
transition:all 0.5s ease-in-out;
transition:all 0.5s ease-in-out;
}
.init-shake{
animation:shake 0.7s ease-in-out;
animation:shake 0.7s ease-in-out;
animation:shake 0.7s ease-in-out;
}
.hint{
position: absolute;
bottom:0;
left:0;
padding:20px;
color:#fff;
text-shadow:#000 0px 1px 5px;
}
.info{
display:block;
color:#CCC;
margin:10px 0;
font-size:0.95em;
}
@-webkit-keyframes shake{
0% { left:0; }
20% { left:10px; }
40% { left:-10px; }
60% { left:10px; }
80% { left:-10px; }
100% { left:0px; }
}
@-moz-keyframes shake{
0% { left:0; }
20% { left:10px; }
40% { left:-10px; }
60% { left:10px; }
80% { left:-10px; }
100% { left:0px; }
}
@keyframes shake{
0% { left:0; }
20% { left:10px; }
40% { left:-10px; }
60% { left:10px; }
80% { left:-10px; }
100% { left:0px; }
}
$(function(){
$("#login").submit(function(e){
e.preventDefault();
$(".login").addClass("init-shake");
setTimeout(function(){
$(".login").removeClass("init-shake");
}, 1000);
});
$(".pass").on("keypress", function(){
$(".arrow").css("opacity", "1");
});
})
This Pen doesn't use any external CSS resources.