• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
seegatesite header

Seegatesite.com

Seegatesite.com - Programming Tutorial , Sharing , How and Learn Together

  • TOOLS
    • Bootstrap Navbar Online Generator
    • Customize Sidebar Menu Bootstrap 3
    • Bootstrap Demo
  • ADVERTISE
  • CATEGORIES
    • Android
    • Blogging Tips
    • Database
    • CSS
    • Info Gadget
    • Javascript
    • Linux
    • PHP
    • Various
    • WordPress
  • Q&A
  • PHP
  • JAVASCRIPT
  • JQUERY
  • ANGULAR
  • WORDPRESS
  • SEO
  • REACT
🏠 » CSS » How to Make a Shake Effect Validation Like the WordPress Login Form

How to Make a Shake Effect Validation Like the WordPress Login Form

By Sigit Prasetya Nugroho ∙ April 29, 2019 ∙ CSS, Javascript ∙ Leave a Comment

Share : TwitterFacebookTelegramWhatsapp

Make validation on the login page with a shake effect. If you have a WordPress site, it’s no stranger to a “shake effect” when you fail to log in to the dashboard page. Of course, it’s interesting if we implement the shake effect login form on the application that we are developing. Check out the quick tips for creating a login form vibrate effect.

In this tutorial, I will show you how to create a login form with a shake animation effect using CSS3 and JQuery. If the user incorrectly entered a username and password combination on the login form provided, it will display a shake form with animation

Table of Contents

  • 1 Make animated Shake effects on CSS
    • 1.1 What are the CSS3 animations?
    • 1.2 CSS Shake Effect
  • 2 Creating a Login Page
  • 3 Make Validation with jQuery
  • 4 Demo of Login Form Shake Effect Validation
  • 5 Conclusion

Make animated Shake effects on CSS

Using CSS3 allows creating animations on HTML elements without using JavaScript or Flash.

What are the CSS3 animations?

Animation allows elements to move from one style to another. You can change the CSS properties to your liking.

Related Articles :

  • 4 Best Sites To Download School And Education Icons Sets
  • A Cool Collection Of CSS Gradient Border And How To Use Them
  • [CSS] How To Fixed Select2 Responsive Width

The main component of CSS animation is @keyframes, CSS rules where animation is defined. @keyframes are the steps that compile the timeline in the animation. In @keyframes, you can specify the stages with different styles.

CSS Shake Effect

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.shake {
animation: shake 0.3s;
animation-iteration-count: infinite;
}
 
@keyframes shake {
0% { transform: translate(1px, 1px) rotate(0deg); }
20% { transform: translate(-3px, 0px) rotate(1deg); }
40% { transform: translate(1px, -1px) rotate(1deg); }
60% { transform: translate(-3px, 1px) rotate(0deg); }
80% { transform: translate(-1px, -1px) rotate(1deg); }
100% { transform: translate(1px, -2px) rotate(-1deg); }
}
 
form {
margin: 0 auto;
border: 1px solid grey;
padding:10px;
width: 300px;
}
 
#errortext{
color:red;
}

Creating a Login Page

Create a login page that we will validate the shake effect

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<div class="container">
<form action="action_page.php">
<h3>Login Form</h3>
<table>
<tr>
<td colspan="2" id="errortext"></td>
</tr>
<tr>
<td><b>Username</b></td>
<td><input type="text" placeholder="Enter Username" id="txtuname"></td>
</tr>
<tr>
<td><b>Password</b></td>
<td><input type="password" placeholder="Enter Password" id="txtpsw"></td>
</tr>
<tr>
<td> </td>
<td><button id="btn-login" type="submit">Login</button></td>
</tr>
</table>
</form>
</div>

Make Validation with jQuery

we use JQuery to validate and add shake CSS class to the element form.

Copy the following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$(document).ready(function(){
$("#btn-login").click(function(e){
e.preventDefault();
var uname = $("#txtuname").val();
var pass = $("#txtpsw").val();
 
if(uname !== 'test' && pass !== 'test'){
$("#errortext").html("* Username / Password incorect")
$("form").addClass("shake");
setTimeout(function(){$("form").removeClass("shake"); }, 500);
$("#txtuname").focus();
}else{
$("#errortext").html("")
alert("Success login !");
}
});
})

If successful, display login form shake effect validation as shown below

How To Make A Shake Effect Validation Like The WordPress Login Form

Demo of Login Form Shake Effect Validation

Demo : How to Make a Shake Effect Validation Like the WordPress Login Form

Other Article : How To Create Auto Increment Using CSS Counter

Conclusion

Making a shake effect/vibrate form validation is quite easy. Using CSS effects makes the application page more attractive and interactive.

So a short tutorial on how to make vibrate/shake effect for form validation that resembles a login page on WordPress

Another CSS Related Post :

  • Free Simple Admin Dashboard Bootstrap 4 By Seegatesite
  • 4 Best Sites To Download School And Education Icons Sets
  • [CSS] How To Fixed Select2 Responsive Width
  • Upgrade Responsive Bootstrap Table Using Footable Plugin
  • How To Centering And Make Full Width Youtube Iframe On Blog Article
  • Change Bootstrap Modal Dialog Effect With Animate.css

Avatar for Sigit Prasetya Nugroho

About Sigit Prasetya Nugroho

This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Welcome to my Home,

Avatar for Sigit Prasetya NugrohoThis site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.



Popular Articles

Checked checkbox AdminLTE Bootstrap in Jquery

November 4, 2014 By Sigit Prasetya Nugroho 7 Comments

Simple create date format validation with jqueryUI

December 21, 2014 By Sigit Prasetya Nugroho Leave a Comment

Create Simple Progress Bar for Fake Online Generator with Jquery

January 10, 2015 By Sigit Prasetya Nugroho Leave a Comment

22+ Coolest Free Jquery Plugin For Premium Theme

October 3, 2015 By Sigit Prasetya Nugroho Leave a Comment

Easy Build Your Anti Copy Paste Plugin

October 6, 2015 By Sigit Prasetya Nugroho Leave a Comment

Popular Tags

adminlte (15) adsense (13) adsense tips (4) affiliate amazon (13) amazon (12) Android (8) angular (16) angular 4 (12) angular 5 (4) asin grabber (3) Bootstrap (27) codeigniter (5) create wordpress theme (5) crud (8) css (6) free wordpress theme (7) google adsense (4) imacros (4) increase traffic (6) jquery (34) laravel (10) laravel 5 (5) learn android (5) modal dialog (5) mysql (6) nodeJs (4) optimize seo (4) pdo (6) php (30) plugin (53) pos (7) Publisher Tips (5) react (3) Reactjs (7) SEO (37) theme (17) tutorial angular (5) tutorial angular 4 (6) tutorial javascript (10) tutorial javascript beginners (4) twitter (3) widget (3) wordpress (18) wordpress plugin (13) XMLRPC (5)




  • About
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

©2021 Seegatesite.com