Git Product home page Git Product logo

password-generator's Introduction

Password Generator

A solo project from the Scrimba Frontend Developer Career Path

Table of contents

Overview

Requirements

  • Array to hold all possible chars
  • Button to generate 4 random password options
  • Display password options
  • Stretch: ability to set the password length
  • Stretch: 1-click copy password to the clipboard

Screenshots

Password Generator (desktop view)

Password Generator (mobile view)

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS Flexbox
  • Mobile-first workflow
  • Vanilla JS (async/await)

What I learned

Initially, my passwords were using p tags. To achieve the second stretch goal, adding an event listener that runs the copy to clipboard function when passwords are clicked seems enough, but then keyboard users have no way of selecting the passwords (because p tags are not "tabbable"). So I decided to use button tags instead to make the passwords accessible to keyboard users.

I also refactored the "copy to clipboard" implementation in this project after finishing the Color Scheme Generator which uses the same components. Basically, I learned the importance of having fallbacks (in this case, having a fallback in case navigator.clipboard.writeText fails when the browser doesn't have access to the clipboard).

On a related note, we might not need a fallback if in the first place we used input tags for the passwords and used the document.execCommand("copy") approach for the copy to clipboard implementation. However, using input is not really semantic (since we're not asking users to type in passwords) and it would just be another workaround so we can use an already deprecated feature.

Useful resources

Author

password-generator's People

Contributors

joshjavier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

password-generator's Issues

Test

This is just for test purpose only.

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.