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

Used React and CSS to complete project

react
Austin•330
@waustin45
A solution to the Password generator app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Had fun with this project. JS is getting a bit easier to work with. I am getting better at troubleshooting and researching for answers through google. The only problem was styling the checkboxes and slider bar. I could not figure out how to make them green. So, if you have any input I would greatly appreciate it!

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Minh Le•200
    @ledminh
    Posted almost 3 years ago

    Making the checkboxes green is simple. I used the pseudo-class ::before, set the position to absolute with left and top equal 0, height and width equal 100%, then set its background-color to green. To make the check-symbol image displayed when checked, I used the pseudo-class ::after in the similar way but set its background to be the check-symbol image when checked.

    Making the slider half-green-half-black is more difficult. After spending a day doing research on Stack Overflow, I figured the easiest solution is to use linear-gradient on background to make it 50% green and 50% black initially, then using javascript to change the percentage value when the input's value changes.

    Marked as helpful
  • Tobias Fuchs•40
    @ToFu96
    Posted almost 3 years ago

    What you can consider using is "accent-color". It doesn't really solve the problem when it comes to custom designs, but it is a quick hack to adjust the colors to the other content.

    .your_css_selector {
        accent-color: hsl(127deg, 100%, 82%);
    }
    

    That looks good enough for this project.

    Cheers!

    PS: Your copy to clipboard doesn't work for me, so I guess you didn't implement it? Also, if you want an additional (JS) challenge, you can try to come up with your own "forumla"/algorithm to compute password safety. For that you probably should research a bit what makes a password secure. In my case, all my passwords with a length of 8 are considered insecure because they are easy to crack via brute force attacks. I increased my max. length of passwords to 30 and so I obviously consider all passwords of that lengths secure, even if the password only uses numbers. (I used word-break: break-all to break it to the next line for long passwords.)

    If you want to go a step further you could even try to let the user decide which special characters they allow in the generation - I'm probably going to attempt that myself pretty soon. My idea is that a popup or something similar opens and the user can select which special characters they want to be used during password generation.

    I also noticed that your algorithm always uses lowercase characters to create the password, even when not selected. That's something that should be changed. If no options are selected, I guess it's fine to assume lowercase characters as a default setting.

    Marked as helpful
  • P
    John Mirage•1,590
    @john-mirage
    Posted almost 3 years ago

    Hello,

    I have some articles about styling the range input.

    You have two choices:

    • Styling the range input itself.
      • Styling Cross-Browser Compatible Range Inputs with CSS
      • Building a Settings component (i recommend this one because of the progress bar trick for chrome)
    • Creating a fake range input controlled by a real hidden range input.
      • Customising Cross-Browser Range Inputs with CSS and JavaScript (i used this one for this project)

    Creating a fake range input seems to be the best option overall because you have more control and it has a better browser consistency

    Marked as helpful

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

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

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub