|
| 1 | + |
| 2 | +<!DOCTYPE html> |
| 3 | +<html lang="en"> |
| 4 | +<head> |
| 5 | + <meta charset="utf-8"> |
| 6 | + <title>Fresh Tomatoes!</title> |
| 7 | + |
| 8 | + <!-- Bootstrap 3 --> |
| 9 | + <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css"> |
| 10 | + <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap-theme.min.css"> |
| 11 | + <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> |
| 12 | + <script src="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> |
| 13 | + <style type="text/css" media="screen"> |
| 14 | + body { |
| 15 | + padding-top: 80px; |
| 16 | + } |
| 17 | + #trailer .modal-dialog { |
| 18 | + margin-top: 200px; |
| 19 | + width: 640px; |
| 20 | + height: 480px; |
| 21 | + } |
| 22 | + .hanging-close { |
| 23 | + position: absolute; |
| 24 | + top: -12px; |
| 25 | + right: -12px; |
| 26 | + z-index: 9001; |
| 27 | + } |
| 28 | + #trailer-video { |
| 29 | + width: 100%; |
| 30 | + height: 100%; |
| 31 | + } |
| 32 | + .movie-tile { |
| 33 | + margin-bottom: 20px; |
| 34 | + padding-top: 20px; |
| 35 | + } |
| 36 | + .movie-tile:hover { |
| 37 | + background-color: #EEE; |
| 38 | + cursor: pointer; |
| 39 | + } |
| 40 | + .scale-media { |
| 41 | + padding-bottom: 56.25%; |
| 42 | + position: relative; |
| 43 | + } |
| 44 | + .scale-media iframe { |
| 45 | + border: none; |
| 46 | + height: 100%; |
| 47 | + position: absolute; |
| 48 | + width: 100%; |
| 49 | + left: 0; |
| 50 | + top: 0; |
| 51 | + background-color: white; |
| 52 | + } |
| 53 | + </style> |
| 54 | + <script type="text/javascript" charset="utf-8"> |
| 55 | + // Pause the video when the modal is closed |
| 56 | + $(document).on('click', '.hanging-close, .modal-backdrop, .modal', function (event) { |
| 57 | + // Remove the src so the player itself gets removed, as this is the only |
| 58 | + // reliable way to ensure the video stops playing in IE |
| 59 | + $("#trailer-video-container").empty(); |
| 60 | + }); |
| 61 | + // Start playing the video whenever the trailer modal is opened |
| 62 | + $(document).on('click', '.movie-tile', function (event) { |
| 63 | + var trailerYouTubeId = $(this).attr('data-trailer-youtube-id') |
| 64 | + var sourceUrl = 'http://www.youtube.com/embed/' + trailerYouTubeId + '?autoplay=1&html5=1'; |
| 65 | + $("#trailer-video-container").empty().append($("<iframe></iframe>", { |
| 66 | + 'id': 'trailer-video', |
| 67 | + 'type': 'text-html', |
| 68 | + 'src': sourceUrl, |
| 69 | + 'frameborder': 0 |
| 70 | + })); |
| 71 | + }); |
| 72 | + // Animate in the movies when the page loads |
| 73 | + $(document).ready(function () { |
| 74 | + $('.movie-tile').hide().first().show("fast", function showNext() { |
| 75 | + $(this).next("div").show("fast", showNext); |
| 76 | + }); |
| 77 | + }); |
| 78 | + </script> |
| 79 | +</head> |
| 80 | + |
| 81 | + <body> |
| 82 | + <!-- Trailer Video Modal --> |
| 83 | + <div class="modal" id="trailer"> |
| 84 | + <div class="modal-dialog"> |
| 85 | + <div class="modal-content"> |
| 86 | + <a href="#" class="hanging-close" data-dismiss="modal" aria-hidden="true"> |
| 87 | + <img src="https://lh5.ggpht.com/v4-628SilF0HtHuHdu5EzxD7WRqOrrTIDi_MhEG6_qkNtUK5Wg7KPkofp_VJoF7RS2LhxwEFCO1ICHZlc-o_=s0#w=24&h=24"/> |
| 88 | + </a> |
| 89 | + <div class="scale-media" id="trailer-video-container"> |
| 90 | + </div> |
| 91 | + </div> |
| 92 | + </div> |
| 93 | + </div> |
| 94 | + |
| 95 | + <!-- Main Page Content --> |
| 96 | + <div class="container"> |
| 97 | + <div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> |
| 98 | + <div class="container"> |
| 99 | + <div class="navbar-header"> |
| 100 | + <a class="navbar-brand" href="#">Fresh Tomatoes Movie Trailers</a> |
| 101 | + </div> |
| 102 | + </div> |
| 103 | + </div> |
| 104 | + </div> |
| 105 | + <div class="container"> |
| 106 | + |
| 107 | +<div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="x_7YlGv9u1g" data-toggle="modal" data-target="#trailer"> |
| 108 | + <img src="http://t3.gstatic.com/images?q=tbn:ANd9GcQIXnFlBKGWT1ByyIu3qfxX6opQX6BmeeU_qsiE3X8rX9ZRr63r" width="220" height="342"> |
| 109 | + <h2>Dhangal</h2> |
| 110 | +</div> |
| 111 | + |
| 112 | +<div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="d1_JBMrrYw8" data-toggle="modal" data-target="#trailer"> |
| 113 | + <img src="http://theideasbodega.com.au/wp-content/uploads/2015/01/neytiri_in_avatar_2-wide-do-we-really-need-avatar-2-1024x640.jpeg" width="220" height="342"> |
| 114 | + <h2>Avatar</h2> |
| 115 | +</div> |
| 116 | + |
| 117 | +<div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="blQUlD8g4Pk" data-toggle="modal" data-target="#trailer"> |
| 118 | + <img src="http://pressks.com/wp-content/uploads/2016/10/puli-murugan-first-day-collection.jpg" width="220" height="342"> |
| 119 | + <h2>Pulimurugan</h2> |
| 120 | +</div> |
| 121 | + |
| 122 | +<div class="col-md-6 col-lg-4 movie-tile text-center" data-trailer-youtube-id="KYz2wyBy3kc" data-toggle="modal" data-target="#trailer"> |
| 123 | + <img src="https://lumiere-a.akamaihd.net/v1/images/open-uri20150422-20810-m8zzyx_5670999f.jpeg?region=0,0,300,450" width="220" height="342"> |
| 124 | + <h2>Toy Story</h2> |
| 125 | +</div> |
| 126 | + |
| 127 | + </div> |
| 128 | + </body> |
| 129 | +</html> |
0 commit comments