Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 2 years ago

Password Generator

Johan•40
@Johanh0
A solution to the Password generator app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Password Generator

  • What did you find difficult while building the project?

CSS: I found some difficult styling the input range, specially having two different colors on the input.

JavaScript: I found some difficult when I try to create a function that check if all my checkbox inputs were unchecked or at least one were checked. Because depends on this the generate button would be able or not. Also I didn't know how copy with the clipboard, looking on internet I found an old way to do it (deprecated). I'll let the way below of how you copy a value on your clipboard just because I didn't know until this project and maybe can help somebody:

const myInput = document.querySelector("#my-input").value;
const submitBtn = document.querySelector("#submit");

function copyClipboard() {
    try {
        // This line copy what you have on your input.
        navigator.clipboard.writeText(myInput);
    } catch (err) {
        console.log("Error with the clipboard API", err);
    }
}

submitBtn.addEventListener("click", copyClipboard);
  • Which areas of your code are you unsure of?

I would say that the area of my code that I'm unsure is on the Strength level bars. They don't are really analyzing the password an making sure if is really a strong password or not. they're just checking how many checkboxes are marked and depends on this make a result.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Johan's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License