ga-dc / project1-gallery

0 stars 20 forks source link

Julian's Art History Trivia #238

Closed fjaddison closed 6 years ago

fjaddison commented 6 years ago

Link to repo: https://github.com/fjaddison/Art-History-Trivia-Game Link to deployed app: https://fjaddison.github.io/Art-History-Trivia-Game/

Things you'd like specific feedback on: Image sizing. Layout. Button/submit functionality. Also, is there a better way to script the functions so that I don't have to have as many lines of code. I feel as if it could be much DRY-er.

maikelnabil commented 6 years ago

Here is a nice source on managing image-sizing in responsive web applications: https://www.w3schools.com/css/css_rwd_images.asp

You handled the event listening for form buttons very well, but here is an alternative way to do it: https://api.jquery.com/submit/ The advantage of using submit is that it works when people hit Enter as well.

The major enhancement to your JS would be to have one event listener which listens to all the buttons, instead of having one event listener for each event. You can achieve this by using this. For example, you can get the value of any input field by using this.previousElementSibling.value.

You can also use .toUpperCase in your if conditions, instead of comparing with several answers. Example if (answer.toUpperCase ==== "CAMERA OBSCURA")