How we can design a minimal form with login and register both sections? Solution: See this Login and Registration Form With Minimal Design Using jQuery UI & CSS.
Previously I have many forms related programs, but this form contains login and registration both sections with minimal design. Basically, we use forms to collect and check the user’s data and the most known forms are logins, register, and contact forms. In the past, peoples used to create 2 separate pages for creating a sign in and sign up form. But nowadays modern website contains these two form in 1 page with a tab division.
Today you will learn to create a minimal sign in and sign up form. Basically there are 2 tabs, one contains the login or signs in form and the other contains the registration or sign up form. Also, the whole container has 2 sections, the first section has the forms and the second has an image. The image will move according to the mouse cursor movement. The forms have a minimal design, there are simple border and button hover effect.
So, Today I am sharing Login and Registration Form With Minimal Design Using jQuery UI & CSS. There I have used jQuery UI which is a jQuery plugin for creating the program easily. As we know these are based on JS that’s why I am putting this post in the JavaScript section. Also, CSS has an important part in this program to styling elements. You can use this form on your website after some customization and backend integration.
If you are thinking now how this login/registration form tab switch actually is, then see the preview given below.
Preview Of Sign In and Sign Up form Tab Switch
See this video preview to getting an idea of how this form section switch looks like.
Now you can see this visually, also you can see it live by pressing the button given above. If you like this, then get the source code of its.
You May Also Like:
Login and Registration Form With Minimal Design Source Code
Before sharing source code, let’s talk about it. First I have created a main div named container and placed all the elements inside it. Inside the main div, I have created 4 parts sections. The first section is for creating the tabs switch function, there I have used ID and target method. And two sections for creating the forms login and registration, the last section for placing the image. Also in the HTML file, I have linked external files like CSS, JS, jQuery CDN, and jQuery UI CDN.
Now using CSS I have placed all the elements in the right place, as you can see in the preview. With CSS I gave basic values to all the elements like size, position, margin, padding, etc. There I have used CSS @keyframe command to create the animations and rcubic-bezier to declare the animation curve. In the animation sections, I have used CSS filters.
JS file handling here the tab switch toggle functions. There are few lines of codes because I am using the jQuery UI library. I have used JS if{} else{} statements to creating the toggle switch and placed add/ remove class commands it will perform according to action. There I have used .mousemove command to create the image movement feature.
Left all other things you will understand after getting the codes, I can’t explain all in writing. For creating this program you have to create 3 files. First file for HTML, second file for CSS, and the third file for JavaScript. Follow the steps to creating this program without any error.
index.html
Create an HTML file named ‘index.html‘ and put these codes given below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
<!DOCTYPE html> <!-- Code by Webdevtrick ( https://webdevtrick.com ) --> <html lang="en" > <head> <meta charset="UTF-8"> <title>Minimal Sign In / Sign Up From | Webdevtrick.com</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="style.css"> </head> <body> <section class="container"> <article class="half"> <h1>Minimal Form</h1> <div class="tabs"> <span class="tab signin active"><a href="#signin">Sign in</a></span> <span class="tab signup"><a href="#signup">Sign up</a></span> </div> <div class="content"> <div class="signin-cont cont"> <form action="#" method="post" enctype="multipart/form-data"> <input type="email" name="email" id="email" class="inpt" required="required" placeholder="Your email"> <label for="email">Your email</label> <input type="password" name="password" id="password" class="inpt" required="required" placeholder="Your password"> <label for="password">Your password</label> <input type="checkbox" id="remember" class="checkbox" checked> <label for="remember">Remember me</label> <div class="submit-wrap"> <input type="submit" value="Sign in" class="submit"> <a href="#" class="more">Forgot your password?</a> </div> </form> </div> <div class="signup-cont cont"> <form action="#" method="post" enctype="multipart/form-data"> <input type="name" name="name" id="name" class="inpt" required="required" placeholder="Your name"> <label for="name">Your name</label> <input type="email" name="email" id="email" class="inpt" required="required" placeholder="Your email"> <label for="email">Your email</label> <input type="password" name="password" id="password" class="inpt" required="required" placeholder="Your password"> <label for="password">Your password</label> <div class="submit-wrap"> <input type="submit" value="Sign up" class="submit"> <a href="#" class="more">Terms and conditions</a> </div> </form> </div> </div> </article> <div class="half bg"></div> </section> <script src='https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="function.js"></script> </body> </html> |
style.css
Now create a CSS file named ‘style.css‘ and put these codes given here.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
/* Code by Webdevtrick ( https://webdevtrick.com ) */ @charset "UTF-8"; @import url(https://fonts.googleapis.com/css?family=Lato:400,700); * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; } body { font-family: 'Lato', sans-serif; background-color: #f8f8f8; } body .container { position: relative; overflow: hidden; width: 700px; height: 500px; margin: 80px auto 0; background-color: #ffffff; -moz-box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 30px; -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 30px; box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 30px; } body .container .half { float: left; width: 50%; height: 100%; padding: 58px 40px 0; } body .container .half.bg { background-image: url("https://webdevtrick.com/wp-content/uploads/loginimg.jpg"); background-size: 400px; background-repeat: no-repeat; } body .container h1 { font-size: 18px; font-weight: 700; margin-bottom: 23px; text-align: center; text-indent: 6px; letter-spacing: 7px; text-transform: uppercase; color: #263238; } body .container .tabs { width: 100%; margin-bottom: 29px; border-bottom: 1px solid #d9d9d9; } body .container .tabs .tab { display: inline-block; margin-bottom: -1px; padding: 20px 15px 10px; cursor: pointer; letter-spacing: 0; border-bottom: 1px solid #d9d9d9; -moz-user-select: -moz-none; -ms-user-select: none; -webkit-user-select: none; user-select: none; transition: all 0.1s ease-in-out; } body .container .tabs .tab a { font-size: 11px; text-decoration: none; text-transform: uppercase; color: #d9d9d9; transition: all 0.1s ease-in-out; } body .container .tabs .tab.active a, body .container .tabs .tab:hover a { color: #263238; } body .container .tabs .tab.active { border-bottom: 1px solid #263238; } body .container .content form { position: relative; height: 287px; } body .container .content label:first-of-type, body .container .content input:first-of-type, body .container .content .more:first-of-type { -moz-animation: slideIn 0.4s cubic-bezier(0.37, 0.82, 0.2, 1); -webkit-animation: slideIn 0.4s cubic-bezier(0.37, 0.82, 0.2, 1); animation: slideIn 0.4s cubic-bezier(0.37, 0.82, 0.2, 1); } body .container .content label:nth-of-type(2), body .container .content input:nth-of-type(2), body .container .content .more:nth-of-type(2) { -moz-animation: slideIn 0.5s cubic-bezier(0.37, 0.82, 0.2, 1); -webkit-animation: slideIn 0.5s cubic-bezier(0.37, 0.82, 0.2, 1); animation: slideIn 0.5s cubic-bezier(0.37, 0.82, 0.2, 1); } body .container .content label:nth-of-type(3), body .container .content input:nth-of-type(3), body .container .content .more:nth-of-type(3) { -moz-animation: slideIn 0.6s cubic-bezier(0.37, 0.82, 0.2, 1); -webkit-animation: slideIn 0.6s cubic-bezier(0.37, 0.82, 0.2, 1); animation: slideIn 0.6s cubic-bezier(0.37, 0.82, 0.2, 1); } body .container .content label { font-size: 12px; color: #263238; -moz-user-select: -moz-none; -ms-user-select: none; -webkit-user-select: none; user-select: none; } body .container .content label:not([for='remember']) { display: none; } body .container .content input.inpt { font-size: 14px; display: block; width: 100%; height: 42px; margin-bottom: 12px; padding: 16px 13px; color: #999999; border: 1px solid #d9d9d9; background: transparent; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; } body .container .content input.inpt::-webkit-input-placeholder { font-size: 14px; color: #999999; font-family: 'Lato', sans-serif; } body .container .content input.inpt:-moz-placeholder { font-size: 14px; color: #999999; font-family: 'Lato', sans-serif; } body .container .content input.inpt::-moz-placeholder { font-size: 14px; color: #999999; font-family: 'Lato', sans-serif; } body .container .content input.inpt:-ms-input-placeholder { font-size: 14px; color: #999999; font-family: 'Lato', sans-serif; } body .container .content input.inpt:focus { border-color: #999999; } body .container .content input.submit { font-size: 12px; line-height: 42px; display: block; width: 100%; height: 42px; cursor: pointer; vertical-align: middle; letter-spacing: 2px; text-transform: uppercase; color: #263238; border: 1px solid #263238; background: transparent; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; } body .container .content input.submit:hover { background-color: #006ab4; color: #ffffff; -moz-transition: all 0.2s; -o-transition: all 0.2s; -webkit-transition: all 0.2s; transition: all 0.2s; } body .container .content input:focus { outline: none; } body .container .content .checkbox { margin-top: 4px; overflow: hidden; clip: rect(0 0 0 0); width: 0; height: 0; margin: 17px -1px; padding: 0; border: 0; opacity: 0; visibility: hidden; } body .container .content .checkbox + label { vertical-align: middle; display: inline-block; width: 50%; } body .container .content .checkbox + label:before { content: "\A"; color: #999999; font-family: Verdana; font-weight: bold; font-size: 8px; line-height: 10px; text-align: center; display: inline-block; vertical-align: middle; position: relative; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px; background: transparent; border: 1px solid #d9d9d9; width: 11px; height: 11px; margin: -2px 8px 0 0; } body .container .content .checkbox:checked + label:before { content: "✓"; } body .container .content .submit-wrap { position: absolute; bottom: 0; width: 100%; } body .container .content .submit-wrap a { font-size: 12px; display: block; margin-top: 20px; text-align: center; text-decoration: none; color: #999999; } body .container .content .submit-wrap a:hover { text-decoration: underline; } body .container .content .signup-cont { display: none; } @keyframes slideIn { 0% { filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); opacity: 0; margin-left: -320px; } 100% { filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false); opacity: 1; margin-left: 0px; } } @-webkit-keyframes slideIn { 0% { filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); opacity: 0; margin-left: -320px; } 100% { filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false); opacity: 1; margin-left: 0px; } } |
function.js
The final step, create a JavaScript file named ‘function.js‘ and put the codes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
// Code by Webdevtrick ( https://webdevtrick.com ) $('.tabs .tab').click(function(){ if ($(this).hasClass('signin')) { $('.tabs .tab').removeClass('active'); $(this).addClass('active'); $('.cont').hide(); $('.signin-cont').show(); } if ($(this).hasClass('signup')) { $('.tabs .tab').removeClass('active'); $(this).addClass('active'); $('.cont').hide(); $('.signup-cont').show(); } }); $('.container .bg').mousemove(function(e){ var amountMovedX = (e.pageX * -1 / 30); var amountMovedY = (e.pageY * -1 / 9); $(this).css('background-position', amountMovedX + 'px ' + amountMovedY + 'px'); }); |
That’s It. Now you have successfully created Login and Registration Form With Minimal Design Using jQuery UI and CSS. If you have any doubt or question comment down below.
Thanks For Visiting, Keep Visiting.
[…] https://webdevtrick.com/login-and-registration-form/ […]
[…] https://webdevtrick.com/login-and-registration-form/ […]