Coder Social home page Coder Social logo

adri-sorribas / passtrength Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 5.0 26 KB

Fully responsive jQuery input password strength indicator plugin. Featuring multiple strength security indicators and show/hide password

License: MIT License

JavaScript 52.04% CSS 43.91% HTML 4.05%

passtrength's Introduction

Passtrength.js

Fully responsive jQuery input password strength indicator plugin. Featuring multiple strength security indicators and show/hide password

Demo

https://adri-sorribas.github.io/passtrength/

Documentation

Passtrength JS provides a basic visual system that indicates the strength of the password entered in any input type password.

This basic indication system is based on 4 points based on the password entered:

  • The password entered contains X characters or more.
  • The password entered contains capital letters.
  • The password entered contains numbers.
  • The password entered contains special characters. [!,%,&,@,#,$,^,*,?,_,~]

Features

  • Progress bar visual indicator.
  • Show/Hide password system (optional).
  • Custom number of minimum characters.
  • Custom Show/Hide icon.
  • Visual indicator "Tooltip" with custom message (optional).

Getting Started

Include plguin files

Just add a link to the css file in your <head>:

<link rel="stylesheet" type="text/css" href="css/passtrength.css"/>

Then, before your closing <body> tag add:

<script type="text/javascript" src="js/jquery.passtrength.min.js"></script>

Package Managers

# NPM
npm install passtrength

Initialize the plugin

Once the necessary files are included you will have to initialize the plugin. The basic way will be;

$('#myPassword').passtrength();

If you need modify the options:

$('#myPassword').passtrength({
  minChars: 8,
  passwordToggle: true,
  tooltip: true,
  textWeak: "Weak",
  textMedium: "Medium",
  textStrong: "Strong",
  textVeryStrong: "Very Strong",
  eyeImg : "img/eye.svg"
});

Settings

Option Type Default Description
minChars int 8 Defines the minimum characters that the user must enter
passwordToggle boolean true Enable the show/hide password option
eyeImg string "img/eye.svg" Path to the image to show/hide password option
tooltip boolean true Enable the tooltip message option
textWeak string "Weak" Custom text for the "weak" status
textMedium string "Medium" Custom text for the "medium" status
textStrong string "Strong" Custom text for the "strong" status
textVeryStrong string "Very Strong" Custom text for the "very-strong" status

passtrength's People

Contributors

adri-sorribas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

passtrength's Issues

Two password fields.

Is it possible to use the plugin for more than one password field in the same html? I did the implementation but it did not work.

Thanks

Doesn't reveal if you pre-populate control with a value.

If you pre-populate the element with a value, it doesn't get revealed as input.val isn't set on initialisation of the class.

I cured this by adding input.val($(passwordInput.element).val()); after input is appended to the DOM, but that won't handle .val(value) methods.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.