File tree Expand file tree Collapse file tree 3 files changed +92
-0
lines changed
MovieInfoApp/Paulie-Aditya Expand file tree Collapse file tree 3 files changed +92
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7+ < title > Movie Ratings</ title >
8+ < link rel ="stylesheet " href ="style.css ">
9+ </ head >
10+ < body >
11+
12+ < div class ="container ">
13+ < h1 > Movie Ratings based on IMDb</ h1 >
14+ < div class ="row ">
15+ < form onsubmit ="fun(event) ">
16+ < input type ="text " name ="name " id ="name " required placeholder ="Enter movie name and click Enter " >
17+ </ form >
18+ < div id ="container_1 "> </ div >
19+ </ div >
20+ </ div >
21+ </ body >
22+ < script src ="script.js "> </ script >
23+ </ html >
Original file line number Diff line number Diff line change 1+ function fun ( e )
2+ {
3+ var search = document . getElementById ( "name" ) . value ;
4+ fetch ( `https://www.omdbapi.com/?t=${ search } &apikey=16ba5256` )
5+ . then ( response => response . json ( ) )
6+ . then ( data => {
7+ var s = `<table border="2">
8+ <thead>
9+ <h2 align="center">Movie Data</h2>
10+ </thead>
11+ <tbody>
12+ <tr>
13+ <td>Movie Name</td>
14+ <td>${ data . Title } </td>
15+ </tr>
16+ <tr>
17+ <td>Released date</td>
18+ <td>${ data . Released } </td>
19+ </tr>
20+ <tr>
21+ <td>Genre</td>
22+ <td>${ data . Genre } </td>
23+ </tr>
24+ <tr>
25+ <td>Actors</td>
26+ <td>${ data . Actors } </td>
27+ </tr>
28+ <tr>
29+ <td>Director</td>
30+ <td>${ data . Director } </td>
31+ </tr>
32+ <tr>
33+ <td>Short Note</td>
34+ <td>${ data . Plot } </td>
35+ </tr>
36+ <tr>
37+ <td>Poster</td>
38+ <td>
39+ <img src=${ data . Poster } alt=${ data . Title } />
40+ </td>
41+ </tr>
42+ <tr>
43+ <td>IMDb Rating</td>
44+ <td>${ data . imdbRating } </td>
45+ </tr>
46+ </tbody>
47+ </table>` ;
48+ document . getElementById ( "container_1" ) . innerHTML = s ;
49+ } )
50+ . catch ( error => console . log ( 'error' , error ) ) ;
51+ e . preventDefault ( ) ;
52+ }
Original file line number Diff line number Diff line change 1+ .container {
2+ display : block;
3+ text-align : center;
4+ }
5+ input {
6+ padding : 20px ;
7+ margin : 20px ;
8+ border-radius : 7px ;
9+ color : blue;
10+ }
11+ input ::placeholder {
12+ color : red;
13+ }
14+ * {
15+ font-weight : bold;
16+ letter-spacing : 0.1rem ;
17+ }
You can’t perform that action at this time.
0 commit comments