A self-made personality generator. Try not to laugh

A self-made personality generator. Try not to laugh
0

Here is my project:
https://codepen.io/Glaurung/pen/yLBOQYG
I hope you like it and have fun!
Any feedback is appreciated!
Thanks!

This is a beautiful thing. I just spent like 15 minutes playing with this!

I have a couple recommendations:

  1. Use the array length to determine the Math.random multiplier
  2. Instead of having the randomly generated keys in the .html() function, pull that out to its own function, like:
$("#GenButton").on("click",function(){
  $("#s1").html(getPhrase(test1));
  $("#s2").html(getPhrase(test2));
  $("#s3").html(getPhrase(test3));
});

function getPhrase(arr) {
  return arr[Math.floor(Math.random() * arr.length)];
}

Otherwise, great work!

1 Like

Nice work! Looks decent on mobile. You might think about setting a max width or something for the desktop version though. And there seems to be a thin vertical line between your first and second yellow text blocks. A fun project, keep it up!

1 Like

Yeah. A max width seems like a good Idea.

Thanks! that works MUCH better!