Skip to content

Commit e990c3b

Browse files
jrcoakona-agent
andcommitted
Improve movie display layout and fix image issues
Frontend improvements: - Change grid from 4 to 5 movies per row for better space utilization - Add proper aspect-[2/3] ratio for movie poster proportions - Use object-top positioning to keep heads/important parts visible - Reduce gap spacing to accommodate 5 movies per row - Update category limits from 4 to 5 movies each Database improvements: - Add The Shawshank Redemption to trending category - Add Nomadland to award winners category - Fix Nomadland broken image URL with working Amazon image - Now have 5 movies per category for complete rows Visual fixes: - Neo's head and other character faces now properly visible - Portrait movie posters maintain correct aspect ratio - Better image cropping with object-top positioning - More content displayed per category row Co-authored-by: Ona <no-reply@ona.com>
1 parent cf30301 commit e990c3b

File tree

3 files changed

+45
-9
lines changed

3 files changed

+45
-9
lines changed

database/main/seeds/movies_complete.sql

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,4 +369,40 @@ INSERT INTO movies (
369369
'movie',
370370
ARRAY['avengers', 'marvel', 'superhero', 'finale'],
371371
ARRAY['modernBlockbusters']
372+
),
373+
374+
-- Additional movies to fill out categories to 5 each
375+
(
376+
'The Shawshank Redemption',
377+
'Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.',
378+
1994,
379+
9.3,
380+
'https://image.tmdb.org/t/p/w500/q6y0Go1tsGEsmtFryDOJo3dEmqu.jpg',
381+
'https://www.youtube.com/watch?v=6hB3S9bIaco',
382+
'6hB3S9bIaco',
383+
'https://www.youtube.com/watch?v=6hB3S9bIaco',
384+
ARRAY['Drama'],
385+
'Frank Darabont',
386+
ARRAY['Tim Robbins', 'Morgan Freeman', 'Bob Gunton', 'William Sadler'],
387+
142,
388+
'movie',
389+
ARRAY['prison', 'hope', 'friendship', 'redemption'],
390+
ARRAY['trending']
391+
),
392+
(
393+
'Nomadland',
394+
'A woman in her sixties embarks on a journey through the western United States after losing everything in the Great Recession, living in a van and working seasonal jobs.',
395+
2020,
396+
7.3,
397+
'https://m.media-amazon.com/images/M/MV5BNDIzNDU0YzEtYzE5Ni00ZjlkLTk5ZjgtNjM3NWE4YzA3Nzk3XkEyXkFqcGdeQXVyMjUzOTY1NTc@._V1_SX300.jpg',
398+
'https://www.youtube.com/watch?v=6sxCFZ8_d84',
399+
'6sxCFZ8_d84',
400+
'https://www.youtube.com/watch?v=6sxCFZ8_d84',
401+
ARRAY['Drama'],
402+
'Chloé Zhao',
403+
ARRAY['Frances McDormand', 'David Strathairn', 'Linda May', 'Charlene Swankie'],
404+
107,
405+
'movie',
406+
ARRAY['nomad', 'recession', 'journey', 'survival'],
407+
ARRAY['awardWinners']
372408
);

frontend/src/App.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ function Home() {
2929
// Organize movies into categories using the new categories column
3030
const trending = allMovies.filter(movie =>
3131
movie.categories && movie.categories.includes('trending')
32-
).slice(0, 4);
32+
).slice(0, 5);
3333

3434
const popular = allMovies.filter(movie =>
3535
movie.categories && movie.categories.includes('popular')
36-
).slice(0, 4);
36+
).slice(0, 5);
3737

3838
const scifi = allMovies.filter(movie =>
3939
movie.categories && movie.categories.includes('scifi')
40-
).slice(0, 4);
40+
).slice(0, 5);
4141

4242
const awardWinners = allMovies.filter(movie =>
4343
movie.categories && movie.categories.includes('awardWinners')
44-
).slice(0, 4);
44+
).slice(0, 5);
4545

4646
const modernBlockbusters = allMovies.filter(movie =>
4747
movie.categories && movie.categories.includes('modernBlockbusters')
48-
).slice(0, 4);
48+
).slice(0, 5);
4949

5050
setMovies({ trending, popular, scifi, awardWinners, modernBlockbusters });
5151
} catch (error) {

frontend/src/components/MovieRow.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ function MovieRow({ title, movies, showTitle = true, onMovieClick }) {
1616
<div className="w-full">
1717
{showTitle && <h2 className="text-2xl font-bold mb-4 px-4 md:px-8">{title}</h2>}
1818
<div className="relative">
19-
<div className="grid grid-cols-4 gap-4 pb-4 px-4 md:px-8">
19+
<div className="grid grid-cols-5 gap-3 pb-4 px-4 md:px-8">
2020
{movies.map((movie) => (
2121
<div
2222
key={movie.id}
2323
className="group cursor-pointer transform transition-all duration-300 hover:scale-105"
2424
onClick={() => handleMovieClick(movie)}
2525
>
26-
<div className="relative overflow-hidden rounded-lg">
26+
<div className="relative overflow-hidden rounded-lg aspect-[2/3]">
2727
<img
2828
src={movie.image_url}
2929
alt={movie.title}
30-
className="w-full h-64 object-cover transition-transform duration-300 group-hover:scale-110"
30+
className="w-full h-full object-cover object-top transition-transform duration-300 group-hover:scale-110"
3131
/>
32-
32+
3333
{/* Hover Overlay */}
3434
<div className="absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-60 transition-all duration-300 flex items-center justify-center">
3535
<div className="transform scale-0 group-hover:scale-100 transition-transform duration-300">

0 commit comments

Comments
 (0)