-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.php
More file actions
153 lines (145 loc) · 4.25 KB
/
main.php
File metadata and controls
153 lines (145 loc) · 4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Main</title>
<style>
body{
background-color:black;
}
header,
nav,
section,
footer,
aside{
text-align: center;
padding: 20px;
margin: 10px;
background-color:brown ;
}
header{
padding-left: 0;
padding-right: 0;
}
header div {
background-color: black;
}
header div a{
text-decoration: none;
color: gainsboro;
background-color: ;
}
header nav{
display : grid;
grid-template-columns: auto auto auto;
font-size: large;
}
nav a {
color:gainsboro;
text-decoration: none;
margin: 0 10px;
position: relative;
border-right: solid 1px gainsboro;
}
nav a:last-child {
border-right: none;
}
nav a:hover{
font-style: oblique;
font-weight: bolder;
}
/*section*/
section{
display :flex;
justify-content: center;
}
section div {
display: flex;
flex-direction: column;
align-items: center;
width: 50%;
margin: 10px;
font-size: 1.5rem;
text-align: center;
}
.MovieTitle {
margin-top: 10px;
font-size: 0.5em;
color:gainsboro;
}
.poster-image {
width: 100%;
height: 100%;
}
div img{
width: 100%;
height: 100%;
object-fit: cover;
}
footer{
display: flex;
align-items: center;
justify-content: center;
clear:both;
height : 100px;
margin : 10px;
color : gainsboro;
}
</style>
</head>
<body>
<header>
<div>
<H1><a href = "main.php">Theather</a></H1>
</div>
<nav>
<a href = "main.php">HOME</a>
<a href = "Reservation.php">RESERVATION</a>
<a href = "LogIn.php">LOG IN</a>
</nav>
</header>
<section>
<div>
<img src="" id="poster1" class="poster-image">
<p id="title1" class = "MovieTitle"></p>
</div>
<div>
<img src="" id="poster2" class="poster-image">
<p id="title2" class = "MovieTitle"></p>
</div>
<div>
<img src="" id="poster3" class="poster-image">
<p id="title3" class = "MovieTitle"></p>
</div>
<div>
<img src="" id="poster4" class="poster-image">
<p id="title4" class = "MovieTitle"></p>
</div>
</section>
<footer>
<p>information</p>s
</footer>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script>
function fetchMovies() {
axios.get('http://www.omdbapi.com/?apikey=a1b782a3&s=harry potter')
.then(function(response) {
console.log(response);
const movies = response.data.Search;
for (let i = 0; i < movies.length; i++) {
const posterEl = document.querySelector(`#poster${i + 1}`);
const titleEl = document.querySelector(`#title${i + 1}`);
posterEl.src = movies[i].Poster;
titleEl.textContent = movies[i].Title;
}
})
.catch(function(error) {
console.log(error);
});
}
fetchMovies();
</script>
</body>
</html>