Skip to content

Random Password Generator. No cookies, no trackers. Just passwords.

License

Notifications You must be signed in to change notification settings

passwd-gen/passwd-gen.github.io

 
 

Repository files navigation

License made-with-javascript

POMjs

This is a fork of POMjs a random password generator in HTML and pure Javascript hosted on GitHub Pages. It can be customized by modifying the sources. There's really nothing magic going on here, but it works and is somewhat responsive. The goal was to make something small, useful, and reasonably free from dependencies.

Parts

POMjs uses a "minified" version of normalize.css to reset the DOM to reasonable settings 😊

POMjs includes no externally loaded resources and contains no tracking code or cookie management.

Installation

Download the distribution or clone the repo. Files and folders should be placed in your web root, or another folder accessible to your web server. All references to CSS and Javascript use relative paths.

I'd appreciate a mention on whatever website you use this one, and a link to the original repo, but it's not required.

Usage

  • From a visitor perspective, simply enable the desired string sequences, and possibly adjust the password length. Click on the Enter button or use the Enter key when the button has focus.
  • The generated password is displayed at the bottom of the box, along with a strength indicator.
  • The slider can also be used to change the number of characters in the generated password, as can the input field to the right of the slider.
  • The HTML should have proper tabindex attributes for easier keyboard navigation.
  • To copy the generated password to the clipboard, click on the password.
  • "Dark mode" (browser setting) should be honored.

Changes

Please see CHANGELOG.md for a list of changes.

Customization

The original Javascript source is in password-om.js. The index.html file includes password-om.min.js. So I suggest you make your customizations in the "unminified" .js file and then create a new password-om.min.js file. If you do not have access to a "minification tool", you can simply copy an "unminified" version of password-om.js to password-om.min.js, it's really not that big of a difference.

Most parameters/settings can be changed in the .js file.

Variables (in .js file)

Name Default Comment
POM_strUppercase Auto-generated A-Z Change if needed, used by default
POM_strLowercase Auto-generated a-z Change if needed, used by default
POM_strDigits Auto-generated 0-9 Change if needed, used by default
POM_strSpecialOne -._#$@%! Change if needed, used by default
POM_strSpecialTwo "+(){}[]?&,*<>|:;^ Change if needed, not used by default
POM_strUppercase_Default true Enables POM_strUppercase by default
POM_strLowercase_Default true Enables POM_strLowercase by default
POM_strDigits_Default true Enables POM_strDigits by default
POM_strSpecialOne_Default true Enables POM_strSpecialOne by default
POM_strSpecialTwo_Default false Enables POM_strSpecialTwo by default
POM_mkPasswordOnLoad true Generate password on first page load
POM_changeIsClick true Generate password when parameters are changed
POM_minLength 4 Minimum (and default) password length
POM_maxLength 256 Maxmium password length
POM_sliderStep 4 4 - ..
POM_debug false Emit "debug" output with console.log()
POM_default 16 Default password length

CSS

Most of the styling is done via CSS. I have tried to make it reasonably responsive, and I have tested with it with various browsers.

Please note that index.html makes use of password-om.min.css by default.

Translation

The (very) few strings can be translated. The distribution contains strings in English (default), Swedish, German, and Dutch. The code attempts to guess the language from the navigator.language properties. If they do not exist, or cannot be interpreted, the fallback language used is English.

The "string setup" is done in the POM_initialSetup() function.

If you would like to contribute to the translation, please open an issue and post the language and the translated strings, please include how/if you would like to be mentioned in the credits.

Credits

POMjs was written by Joaquim Homrighausen while converting caffeine into code ☕

License

POMjs is licensed under the GPLv2 license. See the LICENSE file for more details.

Copyright 2022, 2023 Joaquim Homrighausen.

About

Random Password Generator. No cookies, no trackers. Just passwords.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 56.3%
  • HTML 25.3%
  • CSS 18.4%