The used languages for this development are Html, CSS and JavaScript. In the last post, we created a Signup form HTML, CSS and JS.
A login form is usually used by websites and applications.
Responsive login form:
Let’s discuss something about this login form and what’s there in this form. It has a heading at the top by the name of “Login”.
Then it has two fields. A field is used for input. The first field is created for entering the name of the user. It has used placeholder functionality in it. It has also an icon of the user which looks cool. After clicking on this it removes from there and asked to enter the name.
Below it, it has a password field. It has a placeholder and icon of security. After that, it has a text of forgot password with a hover effect. Then it has a login button. It has a hover effect and gradient color which starts moving after pointing at the button.
These buttons have also a hover effect. Signup works when we don’t have an account on that website. Then we can create an account, otherwise, we don’t need to create an account. We just need to log in to our account through this form.
You might like it:
How to create a Responsive login form?
Follow the below steps to develop a Responsive login form.
Source code of Html:
Create an Html file with the extension of .html and save it. Html is used for creating these fields so that we can create a form. It is also used for all the content and button.
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 |
<!--fantacyDesigns--> <!--fantacydesigns.com--> <!DOCTYPE html> <html lang="en"> <head> <title>FantacyDesigns | Login Form</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/png" href="images/icons/favicon.ico"/> <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="fonts/iconic/css/material-design-iconic-font.min.css"> <link rel="stylesheet" type="text/css" href="vendor/animate/animate.css"> <link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css"> <link rel="stylesheet" type="text/css" href="vendor/animsition/css/animsition.min.css"> <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css"> <link rel="stylesheet" type="text/css" href="vendor/daterangepicker/daterangepicker.css"> <link rel="stylesheet" type="text/css" href="css/util.css"> <link rel="stylesheet" type="text/css" href="css/main.css"> </head> <body> <div class="limiter"> <div class="container-login100" style="background-image: url('images/bg-01.jpg');"> <div class="wrap-login100 p-l-55 p-r-55 p-t-65 p-b-54"> <form class="login100-form validate-form"> <span class="login100-form-title p-b-49"> Login </span> <div class="wrap-input100 validate-input m-b-23" data-validate = "Username is reauired"> <span class="label-input100">Username</span> <input class="input100" type="text" name="username" placeholder="Type your username"> <span class="focus-input100" data-symbol=""></span> </div> <div class="wrap-input100 validate-input" data-validate="Password is required"> <span class="label-input100">Password</span> <input class="input100" type="password" name="pass" placeholder="Type your password"> <span class="focus-input100" data-symbol=""></span> </div> <div class="text-right p-t-8 p-b-31"> <a href="#"> Forgot password? </a> </div> <div class="container-login100-form-btn"> <div class="wrap-login100-form-btn"> <div class="login100-form-bgbtn"></div> <button class="login100-form-btn"> Login </button> </div> </div> <div class="txt1 text-center p-t-54 p-b-20"> <span> Or Sign Up Using </span> </div> <div class="flex-c-m"> <a href="#" class="login100-social-item bg1"> <i class="fa fa-facebook"></i> </a> <a href="#" class="login100-social-item bg2"> <i class="fa fa-twitter"></i> </a> <a href="#" class="login100-social-item bg3"> <i class="fa fa-google"></i> </a> </div> </form> </div> </div> </div> <div id="dropDownSelect1"></div> <script src="vendor/jquery/jquery-3.2.1.min.js"></script> <script src="vendor/animsition/js/animsition.min.js"></script> <script src="vendor/bootstrap/js/popper.js"></script> <script src="vendor/bootstrap/js/bootstrap.min.js"></script> <script src="vendor/select2/select2.min.js"></script> <script src="vendor/daterangepicker/moment.min.js"></script> <script src="vendor/daterangepicker/daterangepicker.js"></script> <script src="vendor/countdowntime/countdowntime.js"></script> <script src="js/main.js"></script> </body> </html> |
Source code of CSS:
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 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 |
/*[ FONT ]*/ @font-face { font-family: Poppins-Regular; src: url('../fonts/poppins/Poppins-Regular.ttf'); } @font-face { font-family: Poppins-Medium; src: url('../fonts/poppins/Poppins-Medium.ttf'); } @font-face { font-family: Poppins-Bold; src: url('../fonts/poppins/Poppins-Bold.ttf'); } @font-face { font-family: Poppins-SemiBold; src: url('../fonts/poppins/Poppins-SemiBold.ttf'); } /*[ RESTYLE TAG ]*/ * { margin: 0px; padding: 0px; box-sizing: border-box; } body, html { height: 100%; font-family: Poppins-Regular, sans-serif; } /*---------------------------------------------*/ a { font-family: Poppins-Regular; font-size: 14px; line-height: 1.7; color: #666666; margin: 0px; transition: all 0.4s; -webkit-transition: all 0.4s; -o-transition: all 0.4s; -moz-transition: all 0.4s; } a:focus { outline: none !important; } a:hover { text-decoration: none; color: #a64bf4; } /*---------------------------------------------*/ h1,h2,h3,h4,h5,h6 { margin: 0px; } p { font-family: Poppins-Regular; font-size: 14px; line-height: 1.7; color: #666666; margin: 0px; } ul, li { margin: 0px; list-style-type: none; } /*---------------------------------------------*/ input { outline: none; border: none; } textarea { outline: none; border: none; } textarea:focus, input:focus { border-color: transparent !important; } input:focus::-webkit-input-placeholder { color:transparent; } input:focus:-moz-placeholder { color:transparent; } input:focus::-moz-placeholder { color:transparent; } input:focus:-ms-input-placeholder { color:transparent; } textarea:focus::-webkit-input-placeholder { color:transparent; } textarea:focus:-moz-placeholder { color:transparent; } textarea:focus::-moz-placeholder { color:transparent; } textarea:focus:-ms-input-placeholder { color:transparent; } input::-webkit-input-placeholder { color: #adadad;} input:-moz-placeholder { color: #adadad;} input::-moz-placeholder { color: #adadad;} input:-ms-input-placeholder { color: #adadad;} textarea::-webkit-input-placeholder { color: #adadad;} textarea:-moz-placeholder { color: #adadad;} textarea::-moz-placeholder { color: #adadad;} textarea:-ms-input-placeholder { color: #adadad;} /*---------------------------------------------*/ button { outline: none !important; border: none; background: transparent; } button:hover { cursor: pointer; } iframe { border: none !important; } /*[ Utility ]*/ .txt1 { font-family: Poppins-Regular; font-size: 14px; line-height: 1.5; color: #666666; } .txt2 { font-family: Poppins-Regular; font-size: 14px; line-height: 1.5; color: #333333; text-transform: uppercase; } .bg1 {background-color: #3b5998} .bg2 {background-color: #1da1f2} .bg3 {background-color: #ea4335} /*////////////////////////////////////////////////////////////////// [ login ]*/ .limiter { width: 100%; margin: 0 auto; } .container-login100 { width: 100%; min-height: 100vh; display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; padding: 15px; background-repeat: no-repeat; background-position: center; background-size: cover; } .wrap-login100 { width: 450px; background: #fff; border-radius: 10px; overflow: hidden; } /*------------------------------------------------------------------ [ Form ]*/ .login100-form { width: 100%; height: 550px; } .login100-form-title { display: block; font-family: Poppins-Bold; font-size: 39px; color: #56CCF2; line-height: 1.2; text-align: center; } /*------------------------------------------------------------------ [ Input ]*/ .wrap-input100 { width: 100%; position: relative; border-bottom: 2px solid #d9d9d9; } .label-input100 { font-family: Poppins-Regular; font-size: 14px; color: #333333; line-height: 1.5; padding-left: 7px; } .input100 { font-family: Poppins-Medium; font-size: 16px; color: #333333; line-height: 1.2; display: block; width: 100%; height: 55px; background: transparent; padding: 0 7px 0 43px; } /*---------------------------------------------*/ .focus-input100 { position: absolute; display: block; width: 100%; height: 100%; top: 0; left: 0; pointer-events: none; } .focus-input100::after { content: attr(data-symbol); font-family: Material-Design-Iconic-Font; color: #adadad; font-size: 22px; display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display: flex; align-items: center; justify-content: center; position: absolute; height: calc(100% - 20px); bottom: 0; left: 0; padding-left: 13px; padding-top: 3px; } .focus-input100::before { content: ""; display: block; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px; background: #7f7f7f; -webkit-transition: all 0.4s; -o-transition: all 0.4s; -moz-transition: all 0.4s; transition: all 0.4s; } .input100:focus + .focus-input100::before { width: 100%; } .has-val.input100 + .focus-input100::before { width: 100%; } .input100:focus + .focus-input100::after { color: #a64bf4; } .has-val.input100 + .focus-input100::after { color: #a64bf4; } /*------------------------------------------------------------------ [ Button ]*/ .container-login100-form-btn { display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display: flex; flex-wrap: wrap; justify-content: center; } .wrap-login100-form-btn { width: 100%; display: block; position: relative; z-index: 1; border-radius: 25px; overflow: hidden; margin: 0 auto; box-shadow: 0 5px 30px 0px rgba(3, 216, 222, 0.2); -moz-box-shadow: 0 5px 30px 0px rgba(3, 216, 222, 0.2); -webkit-box-shadow: 0 5px 30px 0px rgba(3, 216, 222, 0.2); -o-box-shadow: 0 5px 30px 0px rgba(3, 216, 222, 0.2); -ms-box-shadow: 0 5px 30px 0px rgba(3, 216, 222, 0.2); } .login100-form-bgbtn { position: absolute; z-index: -1; width: 300%; height: 100%; background: #a64bf4; background: -webkit-linear-gradient(right, #00dbde, #fc00ff, #00dbde, #fc00ff); background: -o-linear-gradient(right, #00dbde, #fc00ff, #00dbde, #fc00ff); background: -moz-linear-gradient(right, #00dbde, #fc00ff, #00dbde, #fc00ff); background: linear-gradient(right, #00dbde, #fc00ff, #00dbde, #fc00ff); top: 0; left: -100%; -webkit-transition: all 0.4s; -o-transition: all 0.4s; -moz-transition: all 0.4s; transition: all 0.4s; } .login100-form-btn { font-family: Poppins-Medium; font-size: 16px; color: #fff; line-height: 1.2; text-transform: uppercase; display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display: flex; justify-content: center; align-items: center; padding: 0 20px; width: 100%; height: 50px; } .wrap-login100-form-btn:hover .login100-form-bgbtn { left: 0; } /*------------------------------------------------------------------ [ Alert validate ]*/ .validate-input { position: relative; } .alert-validate::before { content: attr(data-validate); position: absolute; max-width: 70%; background-color: #fff; border: 1px solid #c80000; border-radius: 2px; padding: 4px 25px 4px 10px; bottom: calc((100% - 20px) / 2); -webkit-transform: translateY(50%); -moz-transform: translateY(50%); -ms-transform: translateY(50%); -o-transform: translateY(50%); transform: translateY(50%); right: 2px; pointer-events: none; font-family: Poppins-Regular; color: #c80000; font-size: 13px; line-height: 1.4; text-align: left; visibility: hidden; opacity: 0; -webkit-transition: opacity 0.4s; -o-transition: opacity 0.4s; -moz-transition: opacity 0.4s; transition: opacity 0.4s; } .alert-validate::after { content: "\f06a"; font-family: FontAwesome; display: block; position: absolute; color: #c80000; font-size: 16px; bottom: calc((100% - 20px) / 2); -webkit-transform: translateY(50%); -moz-transform: translateY(50%); -ms-transform: translateY(50%); -o-transform: translateY(50%); transform: translateY(50%); right: 8px; } .alert-validate:hover:before { visibility: visible; opacity: 1; } @media (max-width: 992px) { .alert-validate::before { visibility: visible; opacity: 1; } } /*////////////////////////////////////////////////////////////////// [ Social item ]*/ .login100-social-item { font-size: 25px; color: #fff; display: -webkit-box; display: -webkit-flex; display: -moz-box; display: -ms-flexbox; display: flex; justify-content: center; align-items: center; width: 50px; height: 50px; border-radius: 50%; margin: 5px; } .login100-social-item:hover { color: #fff; background-color: #333333; } /*////////////////////////////////////////////////////////////////// [ Responsive ]*/ @media (max-width: 576px) { .wrap-login100 { padding-left: 15px; padding-right: 15px; } } |
Source code of javascript:
It is a dynamic language used for adding functionality to all the web pages and making them dynamic. Create a javascript file in the editor with the extension of .js and save it in the same folder as other files.
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 |
(function ($) { "use strict"; /*================================================================== [ Focus input ]*/ $('.input100').each(function(){ $(this).on('blur', function(){ if($(this).val().trim() != "") { $(this).addClass('has-val'); } else { $(this).removeClass('has-val'); } }) }) /*================================================================== [ Validate ]*/ var input = $('.validate-input .input100'); $('.validate-form').on('submit',function(){ var check = true; for(var i=0; i<input.length; i++) { if(validate(input[i]) == false){ showValidate(input[i]); check=false; } } return check; }); $('.validate-form .input100').each(function(){ $(this).focus(function(){ hideValidate(this); }); }); function validate (input) { if($(input).attr('type') == 'email' || $(input).attr('name') == 'email') { if($(input).val().trim().match(/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{1,5}|[0-9]{1,3})(\]?)$/) == null) { return false; } } else { if($(input).val().trim() == ''){ return false; } } } function showValidate(input) { var thisAlert = $(input).parent(); $(thisAlert).addClass('alert-validate'); } function hideValidate(input) { var thisAlert = $(input).parent(); $(thisAlert).removeClass('alert-validate'); } })(jQuery); |
Download it from the below button and then extract it. Then run the main file.
Like, comment and share.
Thanks for reading it.