I am most proud of the fact that I actually finished it and got it to work. There were moments I felt like giving up like when trying to figure out how to generate the random password based on the inputs, but I stuck it out and did it. I also am proud of taking the extra steps to add disabled states to the buttons just for a better user experience.
What challenges did you encounter, and how did you overcome them?- Adding custom styles to the input range was bit of a challenge but luckily I found a good resource to help.
- Randomizing the characters for the password was a challenge because it involved a fair amount of logic, however through a bunch of trial and error I got it to work.
I definitely would like feedback on the JavaScript.
I cleaned up the logic as much as I think I could but I am sure there is more I could have done or a better approach.
Would like feedback in general on the file but for a bit more specificity these two logics:
const randomCharacter = () => { finalPW = ""; const checked = isChecked(checkedOptions); while (finalPW.length < lengthValue) { const randomIndex = randomNumber(checked.length); const randomCategory = checked[randomIndex]; const categoryValues = passwordCharacters[randomCategory]; const randomCharAt = randomNumber(categoryValues.length + 1); const randomCharacter = categoryValues.charAt(randomCharAt); finalPW += randomCharacter; } }; const finalPwStrength = () => { const checkedLength = isChecked(checkedOptions).length; if (lengthValue < 15 && checkedLength === 1) { changeGauges(1, "very weak"); } else if (lengthValue < 15 && checkedLength === 2) { changeGauges(2, "weak"); } else if (lengthValue < 15 && checkedLength > 2) { changeGauges(3, "medium"); } else if (lengthValue >= 15 && checkedLength === 1) { changeGauges(2, "weak"); } else if (lengthValue >= 15 && checkedLength === 2) { changeGauges(3, "medium"); } else { changeGauges(4, "strong"); } };