Password Input

Developer
Size
2,548 Kb
Views
36,432

How do I make an password input?

Type in a random password (or word) and see the bar below increase. The greater the length of your password, the greater the level of the bar. Also a little message is set to appear for each level.. What is a password input? How do you make a password input? This script and codes were developed by Andy Lorimer on 22 July 2022, Friday.

Password Input Previews

Password Input - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Password Input</title> <link rel='stylesheet prefetch' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Test your password strength</h1>
<div class="wrapper"> <input type="password" placeholder="Enter a Password" /> <div class="strength"> <div class="bar"></div> <div class="tooltip"></div> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Password Input - Script Codes CSS Codes

@import url('http://fonts.googleapis.com/css?family=Hind');
body { margin: 0; padding: 0; font-family: 'Hind'; background: #d71e3b;
}
h1 { margin: 20px 0 0 0; text-align: center; font-size: 30px; color: rgba(0, 0, 0, 0.2);
}
.wrapper { position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); -moz-transform: translate(-50%, -50%); -o-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
}
input { width: 300px; height: 50px; font-family: 'Hind'; font-size: 18px; padding: 0 10px; background: rgba(0, 0, 0, .2); border: none; margin-bottom: 15px; color: #fff;
}
input:focus { outline: none;
}
.strength { position: relative; width: 100%; height: 10px; background: rgba(0, 0, 0, .2); border-radius: 100px;
}
.bar { position: absolute; left: 0; background: #fff; border-radius: 100px; width: 0; height: 100%; -webkit-transition: 0.5s ease; -moz-transition: 0.5s ease; -o-transition: 0.5s ease; transition: 0.5s ease;
}
.tooltip { position: relative; display: none; padding: 10px 20px; text-align: center; background: black; bottom: -30px; color: #fff; left: 50%; -webkit-transform: translateX(-50%); -moz-transform: translateX(-50%); -o-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%);
}
.tooltip:before { content: ''; position: absolute; top: -10px; left: 50%; border: solid 5px; border-color: transparent transparent black transparent; -webkit-transform: translateX(-50%); -moz-transform: translateX(-50%); -o-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%);
}

Password Input - Script Codes JS Codes

$('input').on('keyup', function() { var count = $(this).val().length; if (count == 0) { $('.bar').css('width', '0%'); $('.tooltip').fadeOut(); } else { if (count <= 4) { $('.bar').css('width', '25%'); $('.tooltip').fadeIn(); $('.tooltip').text('That\'s weak bro\''); } if (count <= 8 && count >= 5) { $('.bar').css('width', '50%'); $('.tooltip').text('Half way there'); } if (count <= 12 && count >= 9) { $('.bar').css('width', '75%'); $('.tooltip').text('Okay, that\'s pretty strong'); } if (count <= 16 && count >= 13) { $('.bar').css('width', '100%'); $('.tooltip').text('Alright, you\'re sweet'); } }
});
Password Input - Script Codes
Password Input - Script Codes
Home Page Home
Developer Andy Lorimer
Username andylorimer
Uploaded July 22, 2022
Rating 3.5
Size 2,548 Kb
Views 36,432
Do you need developer help for Password Input?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Andy Lorimer (andylorimer) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!