It is a movie review website where any user can comment on the view and based on the comment user can download the movie. Tools used: HTML, CSS, JAVASCRIPT, MongoDB.
The standard document structure declaration in the HTML code states that the title of the webpage is "Movies Site." A link to the external CSS file "style.css" is also present. The primary material of the webpage is contained in the body section of the HTML code.
A navigation bar with the class "topnav" is present inside the body section. It has a search box and the site logo. Users can use the form with an input field in the search container to look for films on the website.
The section with the id "section" will be used to dynamically display movie reviews. A commented-out HTML code block that defines a template for displaying a single row is present in the section's initial empty state.
The script.js file has JavaScript code that makes the website more interactive. It begins by taking the movie and movie title parameters out of the URL. The reviews for the respective movie will be fetched and displayed using these criteria.
The API endpoint for getting and modifying movie reviews is represented by the constant variable APILINK, which is defined in the code. The primary body of the webpage and the movie's title's HTML elements are also retrieved.
The next step is to dynamically add a new review form to the main area using JavaScript. When a user clicks the save button, the save review method is invoked to either produce a new review or edit an existing one with updated user information.
The next step is to dynamically add a new review form to the main area using JavaScript. The save review function is invoked to either produce a new review or update an existing one via a POST or PUT request to the API endpoint when users enter a review and user details and click the save button.
Existing reviews for the film are fetched and displayed via the returnReviews function. It sends a GET request with the movie as an argument to the API endpoint. A new review card is then dynamically constructed and added to the main area for each review after the answer data has been iterated through.
Users can amend an existing review using the edit review tool. The function is invoked when the edit button is pressed, replacing the relevant review card with input fields containing the most recent review and the user's information. The updated values are passed to the saveReview method when modifications are saved.
A review can be deleted using the deleteReview function. The function makes a DELETE request to the API endpoint with the review ID when the delete button is hit. The review card is eliminated from the primary section after a successful deletion.
The navigation bar, search box, review cards, and other visual components of the webpage are among the different elements whose styles are defined by the CSS code.
Submitted by PRAKIRNAKESHI PRAGYA (PrakirnakeshiPragya10)
Download packets of source code on Coders Packet
Comments