I have an idea on
A website database to store all movies and series I've watched with a very good categorization and search filtering feature with it having info on the movie/series name, poster image, actors, tags, description/summary/plot etc I want seperate codes for the HTML, CSS and JavaScript code with some examples of movies then I continue to add manually in the code.Add 'amazing mind-blowing, mouth-watering' design for the CSS a good categorization and filtering search feature (probably in the nav bar) and the movie poster image placeholder then make it to fit the screen of any device it's on
And the filter feature should be a draw down in the 'nav bar hamburger button' with the user having the ability to select what search filter(s) they want to use with the placeholders image being click able then a very cool animation happens that brings up more info on the movie/series
Assistant
Sure! Let's create a responsive and visually appealing website to store and display your watched movies and series. We'll structure the project into three separate files: index.html, styles.css, and script.js.
Overview
HTML (index.html): Contains the structure of the website, including the navbar with a hamburger menu for filters, and a grid layout to display movie cards.
CSS (styles.css): Styles the website with a modern and attractive design, ensuring responsiveness across devices. It includes animations for the overlay that appears when a movie poster is clicked.
JavaScript (script.js): Handles the interactivity, such as toggling the filter menu, filtering movies based on selected criteria, and displaying detailed information about a movie with animations.
Additionally, update the detailedInfo object in script.js with the new movie's details:
javascript
const detailedInfo = {
// Existing movie details...
"The Mask": {
actors: "Jim Carrey, Cameron Diaz",
description: "A man discovers a mask that transforms him into a mischievous superhero with cartoonish superpowers."
}
// Add more as needed
};
Final Notes
Responsive Design: The CSS grid ensures that the movie cards adjust based on the screen size. The hamburger menu appears on smaller screens to keep the interface clean.
Animations: The overlay uses fade-in and scale-up animations for a smooth and engaging user experience.
Customization: Feel free to enhance the design further by adding more styles, animations, or additional filter options as per your preference.
This setup provides a solid foundation for your movie database website. You can expand it by integrating a backend or using a database to manage the movie information dynamically in the future.
Not yet included in a published release.
// Toggle Filter Menu
const hamburger = document.getElementById('hamburger');
const filterMenu = document.getElementById('filter-menu');
hamburger.addEventListener('click', () => {
filterMenu.style.display = filterMenu.style.display === 'block' ? 'none' : 'block';
});
// Apply Filters
const applyFiltersBtn = document.getElementById('apply-filters');
const genreFilter = document.getElementById('genre-filter');
const actorFilter = document.getElementById('actor-filter');
const movieGrid = document.getElementById('movie-grid');
applyFiltersBtn.addEventListener('click', () => {
const selectedGenre = genreFilter.value.toLowerCase();
const actorText = actorFilter.value.toLowerCase();
const movies = movieGrid.getElementsByClassName('movie-card');
Array.from(movies).forEach(movie => {
const movieGenre = movie.getAttribute('data-genre').toLowerCase();
const movieActor = movie.getAttribute('data-actor').toLowerCase();
let genreMatch = selectedGenre === 'all' || movieGenre.includes(selectedGenre);
let actorMatch = actorText === '' || movieActor.includes(actorText);
if (genreMatch && actorMatch) {
movie.style.display = 'block';
} else {
movie.style.display = 'none';
}
});
// Close filter menu after applying
filterMenu.style.display = 'none';
});
// Movie Detail Overlay
const overlay = document.getElementById('overlay');
const overlayContent = document.getElementById('overlay-content');
const closeBtn = document.getElementById('close-btn');
const overlayPoster = document.getElementById('overlay-poster');
const overlayTitle = document.getElementById('overlay-title');
const overlayActors = document.getElementById('overlay-actors');
const overlayDescription = document.getElementById('overlay-description');
// Sample data for detailed info
const detailedInfo = {
"Inception": {
actors: "Leonardo DiCaprio, Joseph Gordon-Levitt, Ellen Page",
description: "A thief who steals corporate secrets through the use of dream-sharing technology is given the inverse task of planting an idea into the mind of a CEO."
},
"Titanic": {
actors: "Leonardo DiCaprio, Kate Winslet",
description: "A seventeen-year-old aristocrat falls in love with a kind but poor artist aboard the luxurious, ill-fated R.M.S. Titanic."
},
"Step Brothers": {
actors: "Will Ferrell, John C. Reilly",
description: "Two aimless middle-aged losers still living at home are forced against their will to become roommates when their parents marry."
}
// Add more detailed info as needed
};
// Event Listener for Movie Cards
const movieCards = document.getElementsByClassName('movie-card');
Array.from(movieCards).forEach(card => {
card.addEventListener('click', () => {
const title = card.querySelector('h3').innerText;
overlayPoster.src = card.querySelector('img.poster').src;
overlayTitle.innerText = title;
overlayActors.innerHTML = `<strong>Actors:</strong> ${detailedInfo[title]?.actors || 'N/A'}`;
overlayDescription.innerText = detailedInfo[title]?.description || 'No description available.';
overlay.style.display = 'flex';
});
});
// Close Overlay
closeBtn.addEventListener('click', () => {
overlay.style.display = 'none';
});
// Close overlay when clicking outside content
window.addEventListener('click', (e) => {
if (e.target == overlay) {
overlay.style.display = 'none';
}
});