/
fresh_tomatoes.html
179 lines (166 loc) · 8.11 KB
/
fresh_tomatoes.html
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fresh Tomatoes!</title>
<!-- Bootstrap 3 -->
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap-theme.min.css">
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
<style type="text/css" media="screen">
body {
padding-top: 80px;
}
#trailer .modal-dialog {
margin-top: 200px;
width: 640px;
height: 480px;
}
.hanging-close {
position: absolute;
top: -12px;
right: -12px;
z-index: 9001;
}
#trailer-video {
width: 100%;
height: 100%;
}
.container {
display: flex;
flex-wrap: wrap;
}
.movie-tile {
display: flex;
flex-direction: column;
margin-bottom: 20px;
padding-top: 20px;
}
.movie-tile:hover {
background-color: #EEE;
cursor: pointer;
}
.movie-poster {
margin-right: auto;
margin-left: auto;
}
.movie-description {
margin-right: 50px;
margin-left: 50px;
text-align: center;
}
.scale-media {
padding-bottom: 56.25%;
position: relative;
}
.scale-media iframe {
border: none;
height: 100%;
position: absolute;
width: 100%;
left: 0;
top: 0;
background-color: white;
}
#credits {
text-align: center;
margin: 3px;
}
</style>
<script type="text/javascript" charset="utf-8">
// Pause the video when the modal is closed
$(document).on('click', '.hanging-close, .modal-backdrop, .modal', function (event) {
// Remove the src so the player itself gets removed, as this is the only
// reliable way to ensure the video stops playing in IE
$("#trailer-video-container").empty();
});
// Start playing the video whenever the trailer modal is opened
$(document).on('click', '.movie-tile', function (event) {
var trailerYouTubeId = $(this).attr('data-trailer-youtube-id')
var sourceUrl = 'http://www.youtube.com/embed/' + trailerYouTubeId + '?autoplay=1&html5=1';
$("#trailer-video-container").empty().append($("<iframe></iframe>", {
'id': 'trailer-video',
'type': 'text-html',
'src': sourceUrl,
'frameborder': 0
}));
});
// Animate in the movies when the page loads
$(document).ready(function () {
$('.movie-tile').hide().first().show("fast", function showNext() {
$(this).next("div").show("fast", showNext);
});
});
</script>
</head>
<body>
<!-- Trailer Video Modal -->
<div class="modal" id="trailer">
<div class="modal-dialog">
<div class="modal-content">
<a href="#" class="hanging-close" data-dismiss="modal" aria-hidden="true">
<img src="https://lh5.ggpht.com/v4-628SilF0HtHuHdu5EzxD7WRqOrrTIDi_MhEG6_qkNtUK5Wg7KPkofp_VJoF7RS2LhxwEFCO1ICHZlc-o_=s0#w=24&h=24"/>
</a>
<div class="scale-media" id="trailer-video-container">
</div>
</div>
</div>
</div>
<!-- Main Page Content -->
<div class="container">
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">Fresh Tomatoes Movie Trailers</a>
</div>
</div>
</div>
</div>
<div class="container">
<div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="o4gHCmTQDVI" data-toggle="modal" data-target="#trailer">
<img class="movie-poster" src="https://images-na.ssl-images-amazon.com/images/M/MV5BMjA4NDI0MTIxNF5BMl5BanBnXkFtZTYwNTM0MzY2._V1_UX182_CR0,0,182,268_AL_.jpg" alt="The Prestige" width="220" height="342">
<h2>The Prestige</h2>
<h6 class="movie-description">Two English magicians duel to create the greatest magic show</h6>
</div>
<div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="8hP9D6kZseM" data-toggle="modal" data-target="#trailer">
<img class="movie-poster" src="https://images-na.ssl-images-amazon.com/images/M/MV5BMjAxMzY3NjcxNF5BMl5BanBnXkFtZTcwNTI5OTM0Mw@@._V1_UX182_CR0,0,182,268_AL_.jpg" alt="Inception" width="220" height="342">
<h2>Inception</h2>
<h6 class="movie-description">A thief enters the dream world to surreptitiously implant an idea</h6>
</div>
<div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="uVdV-lxRPFo" data-toggle="modal" data-target="#trailer">
<img class="movie-poster" src="https://images-na.ssl-images-amazon.com/images/M/MV5BMjQ0MTgyNjAxMV5BMl5BanBnXkFtZTgwNjUzMDkyODE@._V1_UX182_CR0,0,182,268_AL_.jpg" alt="Captain America: Civil War" width="220" height="342">
<h2>Captain America: Civil War</h2>
<h6 class="movie-description">The Avengers are torn apart by an internecine conflict</h6>
</div>
<div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="eOrNdBpGMv8" data-toggle="modal" data-target="#trailer">
<img class="movie-poster" src="https://images-na.ssl-images-amazon.com/images/M/MV5BMTk2NTI1MTU4N15BMl5BanBnXkFtZTcwODg0OTY0Nw@@._V1_UX182_CR0,0,182,268_AL_.jpg" alt="The Avengers" width="220" height="342">
<h2>The Avengers</h2>
<h6 class="movie-description">An unlikely team of superheroes assemble to save the world from an alien threat</h6>
</div>
<div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="5PSNL1qE6VY" data-toggle="modal" data-target="#trailer">
<img class="movie-poster" src="https://images-na.ssl-images-amazon.com/images/M/MV5BMTYwOTEwNjAzMl5BMl5BanBnXkFtZTcwODc5MTUwMw@@._V1_UX182_CR0,0,182,268_AL_.jpg" alt="Avatar" width="220" height="342">
<h2>Avatar</h2>
<h6 class="movie-description">A marine finds himself torn between his own race and the one he was sent to infiltrate</h6>
</div>
<div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="9H4TTjDMTvA" data-toggle="modal" data-target="#trailer">
<img class="movie-poster" src="https://images-na.ssl-images-amazon.com/images/M/MV5BODIxNjhkYjEtYzUyMi00YTNjLWE1YjktNjAyY2I2MWNkNmNmL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_UY268_CR3,0,182,268_AL_.jpg" alt="The Sound of Music" width="220" height="342">
<h2>The Sound of Music</h2>
<h6 class="movie-description">A music-loving nun becomes governess to seven children</h6>
</div>
<div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="nXsu5XArEUw" data-toggle="modal" data-target="#trailer">
<img class="movie-poster" src="https://images-na.ssl-images-amazon.com/images/M/MV5BMTMzMzY5NDc4M15BMl5BanBnXkFtZTcwMzc4NjIxNw@@._V1_UX182_CR0,0,182,268_AL_.jpg" alt="It's a Wonderful Life" width="220" height="342">
<h2>It's a Wonderful Life</h2>
<h6 class="movie-description">A struggling businessman struggles with whether to take his own life</h6>
</div>
<div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="sY1S34973zA" data-toggle="modal" data-target="#trailer">
<img class="movie-poster" src="https://images-na.ssl-images-amazon.com/images/M/MV5BZTRmNjQ1ZDYtNDgzMy00OGE0LWE4N2YtNTkzNWQ5ZDhlNGJmL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyNjU0OTQ0OTY@._V1_UY268_CR3,0,182,268_AL_.jpg" alt="The Godfather" width="220" height="342">
<h2>The Godfather</h2>
<h6 class="movie-description">A young member of a crime family unwillingly becomes the godfather</h6>
</div>
</div>
<div id="credits">
Information courtesy of IMDb (http://www.imdb.com). Used with permission.
</div>
</body>
</html>