Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
da6d444
Demo version
tigershk Jun 28, 2018
ff0bc1c
Delete App.js
tigershk Jun 28, 2018
09c5b34
Delete App.js
tigershk Jun 28, 2018
cfccca2
Delete Info.js
tigershk Jun 28, 2018
f6b8ec6
Delete Result.js
tigershk Jun 28, 2018
c6696d3
Delete Results.js
tigershk Jun 28, 2018
bcc5769
Delete Search.js
tigershk Jun 28, 2018
a5abd8a
Delete Search_backup.js
tigershk Jun 28, 2018
4f3f5dc
Delete index.js
tigershk Jun 28, 2018
7320d09
Delete Info.js
tigershk Jun 28, 2018
d8a3348
Delete Result.js
tigershk Jun 28, 2018
0ba1476
Delete Search.js
tigershk Jun 28, 2018
b5956bc
Delete Results.js
tigershk Jun 28, 2018
3bdf97f
Delete Search_backup.js
tigershk Jun 28, 2018
b3e9d21
Delete index.js
tigershk Jun 28, 2018
4d1e1f5
Delete App.js
tigershk Jun 28, 2018
ddc531d
Delete Result.js
tigershk Jun 28, 2018
cd18be4
Delete Results.js
tigershk Jun 28, 2018
a152af6
Delete index.js
tigershk Jun 28, 2018
0eaf6d3
Delete Search_backup.js
tigershk Jun 28, 2018
d081d4a
Delete Search.js
tigershk Jun 28, 2018
41434f9
Delete Info.js
tigershk Jun 28, 2018
9b3edbd
Delete App.js
tigershk Jun 28, 2018
ae75627
Delete Info.js
tigershk Jun 28, 2018
cc411d0
Delete Result.js
tigershk Jun 28, 2018
727ea9a
Delete Results.js
tigershk Jun 28, 2018
eaca153
Delete index.js
tigershk Jun 28, 2018
b39ddc0
Delete Search_backup.js
tigershk Jun 28, 2018
76cb7e9
Delete Search.js
tigershk Jun 28, 2018
f3d1e37
Delete works.txt
tigershk Jun 28, 2018
a10e3e5
Delete stars_full.png
tigershk Jun 28, 2018
49b48ed
Delete stars_full (1).png
tigershk Jun 28, 2018
08d92aa
Delete stars_blank.png
tigershk Jun 28, 2018
18107a0
Delete news.html
tigershk Jun 28, 2018
9fd9d19
Delete cine_indexcss.txt
tigershk Jun 28, 2018
fcab01c
Delete cine_index - Copy.css
tigershk Jun 28, 2018
eb8e13d
Delete App.js
tigershk Jun 28, 2018
cc62f61
Delete Result.js
tigershk Jun 28, 2018
29ba809
Delete Results.js
tigershk Jun 28, 2018
051ebb3
Delete Search.js
tigershk Jun 28, 2018
1c49468
Delete Search_backup.js
tigershk Jun 28, 2018
8e3bf8e
Delete index.js
tigershk Jun 28, 2018
4a30112
Delete stars_blank (1).png
tigershk Jun 28, 2018
fc1e329
Delete cinema2.jpg
tigershk Jun 28, 2018
0d3459d
Delete App.js
tigershk Jun 28, 2018
d369af6
Delete Info.js
tigershk Jun 28, 2018
b0b30a6
Delete Result.js
tigershk Jun 28, 2018
294c2eb
Delete Results.js
tigershk Jun 28, 2018
674767a
Delete Search.js
tigershk Jun 28, 2018
3260422
Delete Search_backup.js
tigershk Jun 28, 2018
c2bc99d
Delete index.js
tigershk Jun 28, 2018
160d706
Update README.md
tigershk Jun 28, 2018
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
Binary file added MRN.png
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 MRNmissing.png
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 MRNmissing2.png
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 MRNmobile.png
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 MRNmobile2.png
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 MRNnarrow.png
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 MRNred.png
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 MRNvintage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 31 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,48 @@
# React Cinema

Let's revisit our first project where we built a movie search engine using the Open Movie Database. This time we want to implement it using React. It should be a Single Page App, that is all the functionality should be on a single page, rather switch between multiple pages.

Before starting draw a plan of your application. What are some of the components you are going to need? Which components will fetch data and how will that data be displayed? Which components should be re-used? Rather than re-implementing your previous solution again have a think about what you have learned in the past week and how you can apply it here.
# React Cinema (aka Mission Impossible 2)

## The brief

We want to create a movie search engine. To power it we will use the [Open Movie Database](http://www.omdbapi.com). It provides access to a huge database of films via an **API**, which stands for **Application Programming Interface**. In short, it is a set of rules and procedures you need to follow to use a remote system.

To start using the OMDB API you will first need to sign up with them to receive and API key. The key issued to you will allow you 1000 requests per day and you will need to include this key as part of every request.
To create a movie search engine, completing as many of the following tasks, using our newly-aquired REACT skills

To get started, fork and clone this repo. Please submit a pull request after your first commit and push commits regularly.

You should complete as many of the following tasks as you can. You can use Bootstrap to help you

- [ ] Create an HTML page which should have a `form` at the top which contains a `text input` and a `submit button`. Below it should have a placeholder for the returned results.
- [ ] Make sure your design is responsive and looks great at different screen widths
- [ ] Use JavaScript to capture the submit event on in your search form, extract the query string from your input and use that to make an API call to the Open Movie Database API to search for films which match the query string. Console.log the results
- [ ] Display the data returned by the API including title, year and poster picture
- [ ] Adjust your layout to create room for a detailed view of movie information
- [ ] Capture clicks on your movie results items and use that information to make another request to the API for detailed movie information. Console.log the returned result
- [ ] Display the detailed movie result in the in the details view you created earlier
## Checklist
- [x] Create an HTML page which should have a `form` at the top which contains a `text input` and a `submit button`. Below it should have a placeholder for the returned results.
- [x] Make sure your design is responsive and looks great at different screen widths
- [x] Use JavaScript to capture the submit event on in your search form, extract the query string from your input and use that to make an API call to the Open Movie Database API to search for films which match the query string. Console.log the results
- [x] Display the data returned by the API including title, year and poster picture
- [x] Adjust your layout to create room for a detailed view of movie information
- [x] Capture clicks on your movie results items and use that information to make another request to the API for detailed movie information. Console.log the returned result
- [x] Display the detailed movie result in the in the details view you created earlier

**Your own feature**

- [ ] Implement any feature you would find useful or interesting. Include some info in the `README.md` about what it is.
- [x] Click on 'Rating' radio button to sort from highest rated to lowest rated movie
- [x] Click on 'Year' radio button to sort from newest to oldest movie
- [x] Next page and previous page pagination included

**Stretch goals**
- Ran out of time to attempt 'favourites' stretch goals but would like to include at a later date

## Instructions

- [ ] Let's create a search preview. It should listen for keydown events and submit a search request with current query string. Display the search preview results in an absolute positioned container just below the search box.
Hint: You may want to kick of the searching after you have at least 3 characters typed. Also, you may want to implement a `debounce` function to put a small delay on the search. This will reduce the number of requests you send and may the functionality more efficient. You could write your own function if you want a challenge or use one from a library such as `lodash`
- Open index.html in a browser
- Enter the full or partial title of the movie you wish to search for (results will be loaded 10 at a time on a screen)
- Click >> next to search button to go to next page of results (page number will be displayed as well as back << button)
- Click on Rating radio button to display movies sorted from highest to lowest rated according to IMDB score
- Click on Year radio button to display movies sorted from newest to oldest released
- Click on movie name to be taken to IMDB website for chosen film
- Click on movie poster to retrieve more information about the movie and again to remove the additional information

- [ ] Create a favourites list. It's up to you how you would add items to favourites. You could add a button or otherwise. Display a list of favourites somewhere on your page.
## Golden Globes ##

- [ ] Make the favourites list sortable. Add up and down buttons to your favourites which on click will move the result in relevant in your list
I am pleased with the layout of the website. I think there is a lot of content without being too cluttered or detracting from the posters. I am also happy that this version of the website is much more polished than the last attempt. My html and css skills have improved greatly since then, although it feels as though there was less javascript to write than the last.

- [ ] Save favourites locally using either `cookies` or `localStorage` so that favourites persist in browser after refresh

## Objectives
## Golden Raspberries ##

* I want to see great looking webpages which work well at all screen widths
* Your code should have consistent indentation and sensible naming
* Use lots of concise functions with a clear purpose
* Add code comments where it is not immediately obvious what your code does
* Your code should not throw errors and handle edge cases gracefully
- The sort feature was the last thing to be implemented and was rushed which is why the radio buttons are poorly positioned on the page and do not 'check' as expected. This is a definite bug that should be fixed. Each sort only works once. I suspect this to be down to the 'checking issue'.
- I have realised that if a film title is particularly short, it will wrap next to the film poster rather than beneath it.
- If less than 10 films are displayed, the next button still appears, although an error message will be displayed if the user clicks it and the page will remain unchanged.

## README.md
## Conclusion ##

When finished, include a README.md in your repo. This should explain what the project is, how to run it and how to use it. Someone who is not familiar with the project should be able to look at it and understand what it is and what to do with it.
Although this website is more dynamic and has more features than previous projects, it has a similar layout to the News Reader one so I will be looking to challenge myself and create a different style for my next website. It definitely represents progression though.
206 changes: 206 additions & 0 deletions cine_index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
* {
box-sizing: border-box;
}

html {
margin: auto;
font-family: Haettenschweiler, "Arial Narrow Bold", sans-serif;
background-color: #242033f1;
color: #f2faf2;
text-align: center;
}

p{
margin:0px
}

.App__header{
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using caps in CSS class names

display:flex;
flex-direction: row;
flex-wrap:wrap;

height:130px;
background:url(MRNmobile2.png);

background-repeat: no-repeat;
background-position: center;

text-align:center;
}

input {
Copy link
Contributor

Choose a reason for hiding this comment

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

be careful around applying styling directly on input tags. there are different input types and some will require different styling approaches. If you styling just text inputs, use a class name and apply it to components you wish to style

width: 80%;
font-size:18px;
padding-left:20px;
background-color: #242033f1;
color:white;
border-radius: 4px;
}

a {
text-decoration: none;
color: inherit;
}

.search__form{
align-content: left;
}

.search__sort{
float:left;
margin-top:40px;
}

h3{
font-size:15px;
}

h2{
font-size: 15px;
}

.results__body{
margin-top:10px;
}

.results__sort{
align-items:left;
}

article{
border:2px solid #fff;
border-radius: 4px;
background-color: #5f597596
}

.article__picture{
display:flex;
flex-direction:row;
flex-wrap:wrap;
}

#article__main{
display:flex;
flex-direction:row
}

.hidden__text{
margin-left:10px;
margin-right:10px;
font-size:12px;
}

/*thumnails for mobile*/
img {
border: 2px solid #000;
border-radius: 4px;
padding: 5px;
margin-left:5px;
width: 150px;
height:auto;
}

.grow img{
transition: 1s ease;
}

.grow img:hover{
-webkit-transform: scale(1.2);
-ms-transform: scale(1.2);
transform: scale(1.2);
transition: 1s ease;
}

/*tablet view*/
@media (min-width: 768px) {
.App__header{
background-color: hotpink;
height:175px;
background:url(MRNnarrow.png);
background-repeat: no-repeat;
background-position: center;
text-align:center;
}

p{
margin:0px;
font-size: 15px;
text-decoration: none;
}

.hidden__text{
margin-left:10px;
margin-right:10px;
font-size:18px;
}

input {
width: 60%;
font-size:28px;
}

button{
width: 10%;
height:38px ;
font-size:28px;
border-radius: 4px;
}
}

@media (min-width: 1400px) {

.App__header{
height:175px;
background:url(MRNnarrow.png);
background-repeat: no-repeat;
background-position: center;
text-align:center;
}

input {
width: 60%;
font-size:28px;
}

button{
width: 10%;
height:38px ;
font-size:28px;
}

.results__body{
display:flex;
flex:10;
flex-direction:row;
flex-wrap:wrap;
justify-content: center;
}

article{
width:20%;
}
.article__picture{
flex: 2;
font-size:20px;
padding: 10px;
}

#article__main{
align-self: center;
flex-wrap: wrap;
justify-content: center;
}

img {
max-width:100%;
padding: 5px;
width: auto;
height:300px;
}

.hidden__text{
margin-left:10px;
}
}


25 changes: 15 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" src="./style.css">
<title>Hello World</title>
</head>
<body>
<div id="root"></div>
<script src="dist/bundle.js"></script>
</body>
</html>

<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="./cine_index.css">
<title>Movies Right Now</title>
<link href="https://fonts.googleapis.com/css?family=Gloria+Hallelujah|Monoton|Permanent+Marker" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>

<body>
<div id="root"></div>
<script src="dist/bundle.js"></script>
</body>

</html>
16 changes: 16 additions & 0 deletions movieDetail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="./cine_index.css">
<title>Movie Detail</title>
<link href="https://fonts.googleapis.com/css?family=Gloria+Hallelujah|Monoton|Permanent+Marker" rel="stylesheet">
</head>

<body>

<script src="dist/bundle.js"></script>
</body>

</html>
Loading