-
Notifications
You must be signed in to change notification settings - Fork 115
Project Library - Movie library #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
JennieDalgren
left a comment
There was a problem hiding this 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:
- Clean up the HTML and let JS take care of populating the movies section.
- Refactor the event listeners to use the same approach everywhere.
Keep it up! 💪
cholpoun
left a comment
There was a problem hiding this 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()); |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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 = [ |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
https://filmnestmovies.netlify.app/
https://filmnestmovies.netlify.app/
Collaborators
https://github.com/smily342 and https://github.com/Heleneabrahamsson