JavaScript is powerful: we're able to take user interaction and information and use it to update the page without requiring a refresh.
This week, a new startup in your city, CitiPix, is looking to create a personalized picture app that allows users to store pictures they've taken around the world and quickly access them by typing in keywords or tags associated with each photo; they have asked for your help to start building the front-end prototype.
You will begin by building a web-app that will take a user's input and update the background image of the page based on that input.
Once again, you have been given the starter code that includes the HTML and the CSS.
Use the images in the images folder and write JavaScript to make the background image reflect user input based on the Technical Requirements below.
$.val()
on inputs to get the string value of your user's inputvar city
.submit()
or $.click
to figure out when the user clicks the "submit" buttonif / else if / else
conditionals to control the flow of your applicationevent.preventDefault()
function$.ready()
handler to delay your code from executing until all DOM assets have been loaded$.attr()
||
operator in your conditionals to allow for multiple string values to execute if/else if
statement codeIf a user submits:
Take a look at what your final product should look like before and after:
After entering "NYC" and submitting:
NOTE: You will have to add these images to your /images
folder
You should start by using the starter code and focus on adding the proper JavaScript to update the background of the page. Please create a new repository on GitHub called "homework-city" and push your code to it when they are ready to submit.
I will evaluate on your fulfillment of technical requirements, and will provide a numeric grade on a scale for each technical requirement: does not meet expectations (0); meets expectations (1); exceeds expectations (2).
The maximum possible score on this assignment is 28/28. Bonus materials are completely optional.
By August 7th, you should have submitted a proposal and wireframes for your final project.