Oh no! AMC's app developer QUIT! Their app needs updating ASAP.
Can you help them to update their app?
- Add at least 3 movie posters to the HTML (find readily available image choices linked below)
- Once you have the movie poster images in your HTML, use CSS to make the posters the same size and use flexbox to align them horizonatally across the page. Make sure each move poster has a unique border.
- Create an array of movie reviews for each movie.
- Create a new function, let's call it displayMovieReviews.
- Inside the displayMovieReviews function:
- Select the movieReviews div element using document.querySelector('.movieReviews').
- Clear the content of the movieReviews div by setting its innerHTML to an empty string.
- Use a for loop to iterate over the movie reviews array.
- For each review in the array:
- Create a new
element using document.createElement('p').
- Set the textContent of the
element to the review text.
- Append the
element to the movieReviews div using the appendChild method.
- Add a click event listener to each movie image. Inside the event listener function:
- Find the index of the clicked movie in the array of movies.
- Call the displayMovieReviews function, passing the movie reviews array for the clicked movie as an argument.
- When the user clicks on the "Calculate Total" button, calculate the total cost based on the number of tickets entered into the input fields:
- Create a variable named
child
and set it equal to the number a user types into the input field with the classnumberChild
multiplied by the price of a child ticket ($8) - Create a variable named
adult
and set it equal to the number a user types into the input field with the classnumberAdult
multiplied by the price of a child ticket ($12) *Create a variable namedtotal
and set it equal to the variableadult
+ the variablechild
Use conditionals to display different messages depending on total cost in the div with the class totalCost
:
- If total is less than 0 display, "You cannot select a negative number"
- If total is equal to 0 display, "You did not select any tickets"
- If total is more than 0 display, "Your total cost is" + the cost
Add other features that display knowlege beyond those taught in class. Max bonus is 3 additional points.
-
Black Panther: https://images-na.ssl-images-amazon.com/images/M/MV5BMTg1MTY2MjYzNV5BMl5BanBnXkFtZTgwMTc4NTMwNDI@._V1_UY1200_CR90,0,630,1200_AL_.jpg
-
A Wrinkle in Time: http://cdn.collider.com/wp-content/uploads/2017/11/a-wrinkle-in-time-poster.jpg
-
Avengers: https://upload.wikimedia.org/wikipedia/en/4/4d/Avengers_Infinity_War_poster.jpg
Thank you for your help. If you are successful, you will be paid $1,000,000. Please expect payment to be delayed and to arrive on 5/15/2121.