Skip to content

Instantly share code, notes, and snippets.

@odezzshuuk
Created October 22, 2022 06:30
Show Gist options
  • Select an option

  • Save odezzshuuk/42d06f8beee1dbb738d0abf733a7e25b to your computer and use it in GitHub Desktop.

Select an option

Save odezzshuuk/42d06f8beee1dbb738d0abf733a7e25b to your computer and use it in GitHub Desktop.
Another Login Page

Another Login Page

I seem to have a thing for login pages..

For this one I really just wanted to try out some of the stuff I was learning at treehouse.

I also wanted to solve the problem I sometimes have when I fill out forms where the label is located inside the actual input. If I am in the middle of filling out my username/email and I get distracted for some reason, when I come back I am not sure if I was suppose to be filling out an "email" or "username" because the label disappears. Now the user gets some reassurance, with a small popout when he or she starts filling out one of the fields.

will probably add some actual client side validation soon, still learning!

A Pen by Troy Slaten on CodePen.

License.

<section class="container">
<div class="span-6">
<div class="login">
<h1>Greetings!</h1>
<div class="login-content">
<label id="emailLabel">Please enter a valid email</label>
<input id="email" placeholder="Email" / >
<label id="passwordLabel">Please enter your password</label>
<input type="password" id="password" placeholder="Password" / ><br>
<a href="#">Forgot Username </a>&#x2022<a href="#"> Forgot Password</a><br>
<input type="submit" value="Login">
</div>
</div>
</div>
<div class="span-6">
<div class="message">
<span class="first">Design</span>
<span class="second">is</span>
<span class="third">Everywhere</span>
</div>
</section>
$("#email").focus(function(){
$("#emailLabel").addClass("show");
$(this).val('')
}).blur(function(){
$("#emailLabel").removeClass("show");
});
$("#password").focus(function(){
$("#passwordLabel").addClass("show");
$(this).val('')
}).blur(function(){
$("#passwordLabel").removeClass("show");
});
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
@import url(https://fonts.googleapis.com/css?family=Rokkitt);
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,400,700);
@import url(https://fonts.googleapis.com/css?family=Roboto+Slab:700,400);
@import url(https://fonts.googleapis.com/css?family=Lobster);
* { margin: 0; padding: 0; -moz-box-sizing: border-box; box-sizing: border-box; }
h1 { font-family: 'Rokkitt', serif; }
body {
background: url('https://unsplash.s3.amazonaws.com/batch%206/park-place.jpg') no-repeat center center fixed;
background-size: cover;
margin: 0 auto;
width: 66%;
font-family: 'Open Sans', sans-serif;
}
.container {
width: 66%;
min-width: 800px;
position: absolute;
top: 20%;
}
.span-6 {
float: left;
width: 49%;
margin-right: 1%;
}
.login {
background-color: #444444;
text-align: center;
box-shadow: 0 0 20px #000;
}
.login h1 {
color: #A64141;
font-size: 36px;
padding: 30px;
background-color: #d25555;
}
.login-content, .message {
padding: 30px 30px 50px 30px;
}
.login-content a {
text-decoration: none;
font-size: 14px;
color: #ccc;
}
label {
display: block;
color: #f4f4f4;
font-size: 18px;
margin-bottom: 3px;
opacity: 0;
transition: all .3s ease-in-out;
}
input {
margin-bottom: 15px;
padding: 10px 5px;
width: 80%;
background-color: #ccc;
border: none;
text-align: center;
font-size: 16px;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
color: #333;
}
input:focus {
background-color: #f4f4f4;
border: none;
outline: none;
}
input[type=submit] {
color: #fff;
background-color: #d25555;
border: none;
font-family: 'Rokkitt', serif;
font-size: 24px;
margin-top: 25px;
width: 60%;
transition: all .5s ease;
}
input[type=submit]:hover {
background-color: #A64141;
cursor: pointer;
color: #f4f4f4;
}
.message {
}
.message span {
display: block;
color: rgba(255, 255, 255, 1);
position: relative;
bottom: 80px;
text-align: center;
}
.line {
display: inline-block;
padding: 2px;
background-color: #fff;
-webkit-transform: rotate(-12deg);
-moz-transform: rotate(-12deg);
transform: rotate(-12deg);
width: 5px;
}
.first, .second, .third {
font-size:10em;
-webkit-transform: rotate(-12deg);
-moz-transform: rotate(-12deg);
transform: rotate(-12deg);
letter-spacing: -4px;
}
.first {
font-family: 'Lobster', cursive;
-webkit-text-shadow: 3px 3px 0 #999;
-moz-text-shadow: 3px 3px 0 #999;
text-shadow: 3px 3px 0 #999;
}
.second {
font-size: 4em;
font-family: 'Pacifico', cursive;
text-align: center;
border: 8px solid #fff;
width: 95px;
height: 95px;
border-radius: 50%;
line-height: 75px;
margin: 0 auto;
font-family: 'Roboto Slab', serif;
position: relative;
left: 50px;
}
.second:before {
content: "";
display: block;
padding: 1px;
background-color: #fff;
width: 170px;
position: absolute;
top: 50%;
right: 110px;
}
.second:after {
content: "";
display: block;
padding: 1px;
background-color: #fff;
width: 170px;
position: absolute;
top: 50%;
left: 110px;
}
.third {
font-size: 8em;
font-family: 'Lobster', cursive;
-webkit-text-shadow: 3px 3px 0 #999;
-moz-text-shadow: 3px 3px 0 #999;
text-shadow: 3px 3px 0 #999;
line-height: 150px;
}
.show {
opacity: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment