Upload index.html
Browse files- templates/index.html +72 -0
templates/index.html
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<!-- Character encoding set to UTF-8 to support various languages -->
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<!-- Viewport meta tag for responsive design on mobile devices -->
|
| 7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 8 |
+
<!-- Title of the web page, displayed on the browser tab -->
|
| 9 |
+
<title>Movie Recommender</title>
|
| 10 |
+
|
| 11 |
+
<!-- Link to Bootstrap CSS framework for styling and layout -->
|
| 12 |
+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
| 13 |
+
<!-- Link to custom CSS file for additional styling, using Flask's url_for to load it from the 'static' folder -->
|
| 14 |
+
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
|
| 15 |
+
</head>
|
| 16 |
+
<body>
|
| 17 |
+
|
| 18 |
+
<!-- Hero Banner Section -->
|
| 19 |
+
<div class="hero-banner">
|
| 20 |
+
<!-- Main heading for the hero banner -->
|
| 21 |
+
<h1>Discover Movies You'll Love</h1>
|
| 22 |
+
<!-- Subtitle in the hero banner, encouraging the user to make a selection -->
|
| 23 |
+
<p>Choose a favorite, and we’ll recommend similar movies!</p>
|
| 24 |
+
</div>
|
| 25 |
+
|
| 26 |
+
<!-- Movie Selection Form Section -->
|
| 27 |
+
<div class="container mt-5">
|
| 28 |
+
<!-- Form for selecting a movie, using POST method to submit data to the server -->
|
| 29 |
+
<form method="POST" class="text-center mb-4">
|
| 30 |
+
<!-- Dropdown selection menu for choosing a movie -->
|
| 31 |
+
<select class="form-control" name="movie" required>
|
| 32 |
+
<!-- Placeholder option to prompt user selection -->
|
| 33 |
+
<option disabled selected>Select a movie...</option>
|
| 34 |
+
<!-- Looping through 'movies' variable from Flask to populate dropdown options -->
|
| 35 |
+
{% for movie in movies %}
|
| 36 |
+
<option>{{ movie }}</option>
|
| 37 |
+
{% endfor %}
|
| 38 |
+
</select>
|
| 39 |
+
<!-- Submit button for the form -->
|
| 40 |
+
<button type="submit" class="btn btn-primary mt-3">Show Recommendations</button>
|
| 41 |
+
</form>
|
| 42 |
+
|
| 43 |
+
<!-- Recommendations Display Section -->
|
| 44 |
+
<!-- Check if there are any recommended movies to display -->
|
| 45 |
+
{% if recommended_movie_names %}
|
| 46 |
+
<h3 class="text-center">Recommendations for "{{ selected_movie }}"</h3>
|
| 47 |
+
<div class="row">
|
| 48 |
+
<!-- Loop through recommended movie names and posters to create a card for each recommendation -->
|
| 49 |
+
{% for name, poster in zip(recommended_movie_names, recommended_movie_posters) %}
|
| 50 |
+
<div class="col-md-3 col-sm-6 mb-3">
|
| 51 |
+
<!-- Bootstrap card for each recommended movie -->
|
| 52 |
+
<div class="card">
|
| 53 |
+
<!-- Image of the recommended movie's poster -->
|
| 54 |
+
<img src="{{ poster }}" class="card-img-top" alt="{{ name }}">
|
| 55 |
+
<!-- Card body containing the movie title -->
|
| 56 |
+
<div class="card-body text-center">
|
| 57 |
+
<h5 class="card-title">{{ name }}</h5>
|
| 58 |
+
</div>
|
| 59 |
+
</div>
|
| 60 |
+
</div>
|
| 61 |
+
{% endfor %}
|
| 62 |
+
</div>
|
| 63 |
+
{% endif %}
|
| 64 |
+
</div>
|
| 65 |
+
|
| 66 |
+
<!-- Footer Section -->
|
| 67 |
+
<footer class="footer">
|
| 68 |
+
<!-- Footer text, including the copyright notice -->
|
| 69 |
+
<p>© 2023 Movie Recommender</p>
|
| 70 |
+
</footer>
|
| 71 |
+
</body>
|
| 72 |
+
</html>
|