Skip to content

Conversation

@Sherrydev11
Copy link

Copy link

@JennieDalgren JennieDalgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job with this project!

There are some things we want you to fix in order to get approved on this project.
In the HTML file you have hard-coded all the movies in the movies section. This should be empty, and populated with the help of javascript, like you do with the function called displayAllMovies

Nice job with having an empty state - if no movies in a specific genre is found you are showing

if (filteredMovies.length === 0) {
   document.getElementById('movies-section').innerHTML = '<p>No movies found for the selected genre.</p>';
 } else {
   displayMovies(filteredMovies);
 }

Why are you using the spread operator? [...movies]

Sometimes you are putting the functions inline, in the eventlistener and sometimes you break them out. Stick to one approach.
Either like this:

document.getElementById('romance').addEventListener('click', () => {
  if (currentGenre === 'romance') {
    currentGenre = '';
    displayAllMovies();
  } else {
    currentGenre = 'romance';
    recommendMovieByGenre(currentGenre);
  }
});

or like this:

// Add event listeners for the sorting buttons
document.getElementById('sort-new-to-old').addEventListener('click', sortMoviesNewToOld);

Another suggestion is to add some comments to you code, specially when you re working in a group or pair. So that you all remember why you have coded the way you have etc.

TODO:

  1. Clean up the HTML and let JS take care of populating the movies section.
  2. Refactor the event listeners to use the same approach everywhere.

Keep it up! 💪

Copy link

@cholpoun cholpoun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! Wishing all the best future projects!

// Function to filter and display movies based on genre
function recommendMovieByGenre(genre) {
const filteredMovies = movies.filter(movie => {
const genres = movie.genre.split(',').map(g => g.trim().toLowerCase());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion to have a button to be able to see all the movies in the array /Kasia, Cholpon, Nella

index.html Outdated
<img src="./movie-images/inception-movie.jpg" alt="Inception" />
<div class="card-content">
<h2>Inception</h2>
<p><strong>Director:</strong> Christopher Nolan | <strong>Year:</strong> 2010</p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! We have never tried ! /Kasia, Cholpon, Nella

of the properties make sense to filter on, and some to sort on.*/

const books = [
const movies = [

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Good descriptions and easy to follow, well structured! /Kasia, Cholpon, Nella

color: white;
}

@media (min-width:900px) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In iPhone 5/SE, the text doesn't fit inside the card. You can change the flex-direction to a column, and then image will go on top and the text under. /Kasia, Cholpon, Nella

font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

.hero {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job with the hero image and text being responsive in different screen sizes. /Kasia, Cholpon, Nella

@JennieDalgren JennieDalgren self-assigned this Oct 8, 2024
Copy link

@JennieDalgren JennieDalgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants