Skip to content
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

Week 9 – Movie Project – Sofia & Nathalie #48

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
407450c
First commit - Components and rounting created, listing data fetched
sofia32057 Mar 31, 2024
e0acfcb
Update - fetch movie details
sofia32057 Mar 31, 2024
1e73d46
Styling
sofia32057 Mar 31, 2024
ae8f1a6
Fix footer css error
sofia32057 Apr 1, 2024
075f5b2
fixed movie poster size
ohitsnathalie Apr 1, 2024
8ec80fb
Basic styling
sofia32057 Apr 1, 2024
a241654
load more button function
ohitsnathalie Apr 1, 2024
f9731d5
fixing the key
ohitsnathalie Apr 1, 2024
9f55ef8
Basic styling
sofia32057 Apr 1, 2024
43b5ea3
Merge conflicts
sofia32057 Apr 1, 2024
6ed880b
styling on details page
ohitsnathalie Apr 1, 2024
9ae7e62
change header and add favicon
ohitsnathalie Apr 1, 2024
ea6b889
Update - changes to movie fetch
sofia32057 Apr 1, 2024
0418f01
Merge ft-genres
sofia32057 Apr 1, 2024
c7ea087
Bug fix - load more
sofia32057 Apr 1, 2024
3fe9f6a
add back button
ohitsnathalie Apr 3, 2024
6925ed1
button only visible on tablet and desktop
ohitsnathalie Apr 3, 2024
10bd019
Update - genre routed with filtered listing
sofia32057 Apr 3, 2024
a868f01
Bugfix, error import
sofia32057 Apr 3, 2024
291bc20
styling load more button
ohitsnathalie Apr 3, 2024
01b7308
Merge branch 'buttons'
ohitsnathalie Apr 3, 2024
b0cbcd4
changed buttons position and changed API key
ohitsnathalie Apr 3, 2024
81f553f
Update - hide add env and redirect files
sofia32057 Apr 3, 2024
034702f
Merge with nathalies changes
sofia32057 Apr 3, 2024
41fe3ab
added runtime to detail page
ohitsnathalie Apr 3, 2024
5b6e3a2
Update - added genres to details page
sofia32057 Apr 5, 2024
0ec0cd8
Update - genre list wrap mobile
sofia32057 Apr 5, 2024
c0380bc
fixed 404 and added styling to it
ohitsnathalie Apr 5, 2024
6d17b9a
Merge branch 'buttons'
ohitsnathalie Apr 5, 2024
b9fb27a
change README
ohitsnathalie Apr 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_DBAPI_KEY = 5f524441926a384bdad27fc1fd156e93
23 changes: 12 additions & 11 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parserOptions: { ecmaVersion: "latest", sourceType: "module" },
settings: { react: { version: "18.2" } },
plugins: ["react-refresh"],
rules: {
'react-refresh/only-export-components': [
'warn',
"react/prop-types": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
}
};
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

# Movie Site Project

Replace this readme with your own information about your project.

Start by briefly describing the assignment in a sentence or two. Keep it short and to the point.
Movie single page application (SPA) project,by using the API from https://www.themoviedb.org/. Learned how to use BrowserRouter, Routes, Route and useParams().

## Getting Started with the Project

Expand All @@ -24,11 +22,18 @@ npm i && code . && npm run dev

### The Problem

Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next?
We started to layout what components we need and want to create. We also looked into the API what data we'd like to use. At first we code together and tried doing pair-programming for the BrowserRouter, Routes, etc. After a while we split up the work and code in different branches.

We mostly gathered our information from the bootcamp material or the lovely internet. If we had more creativity and time, we would have done de styling different and might have fetched other data from TMDB.

#### Additional

- Add disclamer: "This [website, program, service, application, product] uses TMDB and the TMDB APIs but is not endorsed, certified, or otherwise approved by TMDB."

### View it live

Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about.
[![Netlify Status](https://api.netlify.com/api/v1/badges/832d0052-da1e-49ae-9040-74ff2906a5c8/deploy-status)](https://app.netlify.com/sites/nathalies-sofias-project-movies/deploys)
https://nathalies-sofias-project-movies.netlify.app/

## Instructions

Expand Down
20 changes: 10 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Movie Site Project</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/popcorn.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Nathalie's & Sofia's Movie Site Project</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.3"
},
"devDependencies": {
"@types/react": "^18.2.15",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/popcorn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion public/vite.svg

This file was deleted.

32 changes: 30 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
import { BrowserRouter, Routes, Route } from "react-router-dom"
import { Footer } from "./components/footer/Footer"
import { Header } from "./components/header/Header"
import { Details } from "./components/details/Details"
import { Listing } from "./components/listing/Listing"
import { NotFound } from "./components/404/NotFound"
import { Genres } from "./components/genres/Genres"

export const App = () => {
return <div>Find me in src/app.jsx!</div>;
};
return (
Copy link
Contributor

Choose a reason for hiding this comment

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

It's wonky indentation again 😞 Please ask a question for Q&A or on Stack Overflow if needed

Copy link
Contributor

Choose a reason for hiding this comment

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

Because it makes your code very hard to read 😅

<>
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need the fragment? 👀

<BrowserRouter>
<Header />
<main>
<Routes>
{/* Conditional that makes the "page content" switch between components, depending on the URL*/}
<Route path='/' element={<Listing />} errorElement={<NotFound />} />
<Route
path='/movies/:slug/*'
element={<Details />}
errorElement={<NotFound />}
/>
<Route path='/genre/:genreId/' element={<Genres />} />
<Route path='*' element={<NotFound />} />
</Routes>
</main>
<Footer />
</BrowserRouter>
</>
)
}
Binary file added src/assets/RubikScribble-Regular.ttf
Binary file not shown.
Binary file added src/assets/left-arrows-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions src/components/404/NotFound.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.not-found-container {
display: flex;
flex-direction: column;
align-items: center;
padding: 12rem 3rem 20rem;
text-align: center;
}

.not-found-container h1 {
margin-top: 4rem;
font-size: 4rem;
}

.not-found-container p {
margin-top: 16px;
font-size: 2rem;
}

.not-found-container p::after {
content: " 👀";
}

.link-back {
margin: 24px;
}

.link-back::after {
content: " ›";
}

.link-back:hover {
text-decoration: underline;
color: var(--decor-color);
cursor: pointer;
}
21 changes: 21 additions & 0 deletions src/components/404/NotFound.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Link } from "react-router-dom"
import notFoundImg from "/pexels-tima-miroshnichenko-7991428-large.jpg"
import "./NotFound.css"

export const NotFound = () => {
return (
<div
className='not-found-container'
style={{
backgroundImage: `linear-gradient(rgba(0, 0, 0, 0) 20%, rgb(0, 0, 0) 100%), url(${notFoundImg})`,
backgroundRepeat: "no-repeat",
backgroundSize: "cover",
}}>
<h1>Oups!</h1>
<p>Nothing to see here</p>
<div className='link-back'>
<Link to='/'>Back to the movies</Link>
</div>
</div>
)
}
139 changes: 139 additions & 0 deletions src/components/details/Details.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
.details-container {
height: 100svh;
padding: 5%;
color: white;
display: flex;
flex-wrap: wrap;
/* align-items: flex-end;
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unused code

align-content: flex-end; */
justify-items: center;
}

.back-btn-wrapper {
align-self: flex-start;
position: absolute;
top: 7%;
display: none;
}

.back-button {
width: 35px;
height: 35px;
filter: drop-shadow(0 0 0.4rem black);

Choose a reason for hiding this comment

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

this shadow is a bit wonky -(square shadow on a round object) maybe use a svg instead to avoid this? :)

}

.poster {
object-fit: cover;
height: 100%;
max-width: 200px;
width: auto;
border: 6px solid white;
box-shadow: var(--box-shadow);
margin-left: 16px;
position: relative;
}

.details {
width: 100%;
background: radial-gradient(rgba(0, 0, 0, 0) 100%, rgb(0, 0, 0) 70%);
display: flex;
flex-wrap: wrap;
align-items: flex-start;
align-self: flex-start;
justify-items: center;
gap: 0.5rem;
margin-bottom: 30px;
}

.summary {
padding: 1rem 1rem 0 1rem;

Choose a reason for hiding this comment

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

maybe add some more contrast here as well to improve readability?

display: flex;
flex-direction: column;
gap: 1rem;
}

.title {
text-shadow: var(--text-shadow);
font-size: 28px;
word-wrap: break-word;
}

.desc {
font-size: 16px;
}

.rank-time-container {
display: flex;
gap: 2rem;
}

.ranking,
.runtime {
background-color: rgba(0, 0, 0, 0.4);

Choose a reason for hiding this comment

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

nice with the dark background so its easier to read :)

padding: 0.2rem;
width: fit-content;
color: rgba(255, 255, 255, 0.869);
font-weight: 600;
font-size: 0.875rem;
border-radius: 3px;
font-style: italic;
}

.ranking::before {
content: "⭐️ ";
display: inline;
}

.ranking::after {
content: " / 10";
display: inline;
}

@media all and (min-width: 668px) {
.details-container {
flex-direction: row;
align-content: flex-end;
}

.details {
align-items: flex-end;
align-content: flex-end;
}

.back-btn-wrapper {
left: 20px;
display: block;
}

.summary {
width: 55%;
}

.poster {
max-width: 245px;
}
.title {
font-size: 38px;
}

.desc {
font-size: 18px;
}
}

@media all and (min-width: 1028px) {
.poster {
max-width: 295px;
}
.summary {
width: 65%;
}

.title {
font-size: 3rem;
}

.desc {
font-size: 20px;
}
}
Loading