Primary Goal:
Browse filesCreate an engaging, interactive web application called "Cinematch" that helps users discover the perfect movie to watch by taking them through a short, fun quiz. The recommendations should feel personalized and tailored to their current mood and preferences.
Part 1: Core Concept & Audience
Website Name: Cinematch
Tagline: "Your perfect movie match is just a few questions away."
Purpose: To solve the "what should I watch?" dilemma by providing personalized movie recommendations through an interactive quiz, instead of endless scrolling through catalogs.
Target Audience: Casual movie watchers, couples, families, and anyone who feels overwhelmed by the sheer volume of choices on streaming platforms.
Tone: Fun, conversational, and enthusiastic, like a knowledgeable friend giving you a great movie tip.
Part 2: The User Journey & The Interactive Quiz
The user experience should be a smooth, linear journey from the homepage to the final recommendation. The quiz is the central feature.
1. Homepage (/)
Visuals: A beautiful, high-impact background (perhaps a stylized collage of iconic movie posters or a cinematic shot).
Main Content: Very minimalist.
The logo "Cinematch."
The tagline: "Your perfect movie match is just a few questions away."
A single, large, and inviting call-to-action button: "Find My Movie!"
2. The Quiz Page (/quiz)
When the user clicks the button, they are taken to a full-screen, immersive quiz interface. Present one question at a time to keep it focused and engaging.
Progress Bar: A simple bar at the top of the screen shows the user's progress through the quiz (e.g., 1 of 5).
Question Flow:
Question 1: The Mood Setter
Question: "What kind of vibe are you in the mood for tonight?"
Answers (Visual Cards): Use icons and short text.
"🤣 A good laugh" (Comedy)
"😱 Edge-of-your-seat suspense" (Thriller, Horror)
"🤯 Something to make me think" (Sci-Fi, Mystery, Drama)
"💖 A heartwarming story" (Romance, Family)
"💥 Action-packed adventure" (Action, Adventure)
Question 2: The Time Machine
Question: "Are you feeling modern or classic?"
Answers (Slider or Buttons):
"Latest Releases (2020s)"
"Modern Hits (2000s)"
"90s Throwback"
"A Timeless Classic (Pre-1990)"
Question 3: The Company
Question: "Who's on the couch with you?"
Answers (Simple Icons):
"Just me" (Wider range of ratings)
"Date night" (Filters for Romance, rated R or PG-13)
"The whole family" (Filters for G, PG ratings)
"With my friends" (Filters for popular, crowd-pleasing genres)
Question 4: The Brain Power
Question: "How much attention can you spare?"
Answers:
"Easy watch. I want to turn my brain off."
"Engaging. Give me a great story."
"Complex. I want a plot with twists and turns."
Final Screen (Loading State):
After the last question, display a fun loading animation with text like: "Analyzing your taste...", "Searching the archives...", "Finding your perfect match..."
3. The Results Page (/recommendations)
Once the "analysis" is complete, this page loads dynamically with the top movie recommendations.
Header: "Here's Your Perfect Movie Match!"
Top Recommendation: Display one movie prominently at the top. This card should be larger and more detailed.
Large Movie Poster.
Movie Title & Year.
A "Why We Picked This For You" Snippet: A short, AI-generated sentence that connects the movie to the user's answers (e.g., "An edge-of-your-seat thriller from the 90s with a plot twist you won't see coming.").
Key Details: Genre, Rating (e.g., PG-13), and Critic Score (e.g., 88% on Rotten Tomatoes).
"Where to Watch" Buttons: Links to popular streaming services where the movie is available (e.g., Netflix, Hulu, Prime Video).
"Watch Trailer" Button.
"Other Great Options" Section:
Display 2-3 alternative recommendations in smaller cards below the main one. These cards should show the poster, title, and year.
"Try Again?" Button: A clear button to let the user easily retake the quiz.
Part 4: Backend Logic & Technology
Movie Data Source: The backend must integrate with a comprehensive movie database API like The Movie Database (TMDb) API or OMDb API to fetch movie posters, details, ratings, and streaming availability.
Recommendation Engine:
The core logic will be a system that maps the user's quiz answers to specific API query parameters.
Example Mapping:
"Edge-of-your-seat suspense" -> query for genre=Thriller,Horror.
"90s Throwback" -> query for primary_release_year between 1990-1999.
"The whole family" -> query for certification=G,PG.
The backend should combine these filters to create a highly specific API request. It should then sort the results by popularity or rating to present the best possible matches.
Dynamic Content Generation: The "Why We Picked This For You" snippet should be dynamically generated by the backend based on the user's answers to make the recommendation feel truly personal. - Initial Deployment
- README.md +6 -4
- index.html +352 -18
- prompts.txt +138 -0
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: purple
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: cinematch
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: pink
|
| 5 |
colorTo: purple
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
@@ -1,19 +1,353 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Cinematch - Find Your Perfect Movie</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
|
| 9 |
+
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 11 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 12 |
+
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.globe.min.js"></script>
|
| 13 |
+
<style>
|
| 14 |
+
#vanta-bg {
|
| 15 |
+
position: absolute;
|
| 16 |
+
top: 0;
|
| 17 |
+
left: 0;
|
| 18 |
+
width: 100%;
|
| 19 |
+
height: 100%;
|
| 20 |
+
z-index: -1;
|
| 21 |
+
}
|
| 22 |
+
.movie-card {
|
| 23 |
+
transition: all 0.3s ease;
|
| 24 |
+
}
|
| 25 |
+
.movie-card:hover {
|
| 26 |
+
transform: translateY(-5px);
|
| 27 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
|
| 28 |
+
}
|
| 29 |
+
.quiz-option {
|
| 30 |
+
transition: all 0.2s ease;
|
| 31 |
+
}
|
| 32 |
+
.quiz-option:hover {
|
| 33 |
+
transform: scale(1.03);
|
| 34 |
+
}
|
| 35 |
+
.quiz-option.selected {
|
| 36 |
+
border-color: #6366f1;
|
| 37 |
+
background-color: rgba(99, 102, 241, 0.1);
|
| 38 |
+
}
|
| 39 |
+
</style>
|
| 40 |
+
</head>
|
| 41 |
+
<body class="min-h-screen bg-gray-900 text-white">
|
| 42 |
+
<div id="vanta-bg"></div>
|
| 43 |
+
|
| 44 |
+
<!-- Homepage -->
|
| 45 |
+
<div id="homepage" class="min-h-screen flex flex-col items-center justify-center px-4">
|
| 46 |
+
<div class="text-center max-w-2xl" data-aos="fade-up">
|
| 47 |
+
<h1 class="text-6xl font-bold mb-4 text-indigo-400">Cinematch</h1>
|
| 48 |
+
<p class="text-xl mb-8 text-gray-300">Your perfect movie match is just a few questions away</p>
|
| 49 |
+
<button onclick="startQuiz()" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-4 px-8 rounded-full text-lg transition-all duration-300 transform hover:scale-105">
|
| 50 |
+
Find My Movie!
|
| 51 |
+
</button>
|
| 52 |
+
</div>
|
| 53 |
+
</div>
|
| 54 |
+
|
| 55 |
+
<!-- Quiz Page -->
|
| 56 |
+
<div id="quiz-page" class="min-h-screen hidden flex-col items-center justify-center px-4 py-12">
|
| 57 |
+
<div class="w-full max-w-2xl">
|
| 58 |
+
<!-- Progress Bar -->
|
| 59 |
+
<div class="w-full bg-gray-700 rounded-full h-2.5 mb-8">
|
| 60 |
+
<div id="progress-bar" class="bg-indigo-600 h-2.5 rounded-full" style="width: 0%"></div>
|
| 61 |
+
</div>
|
| 62 |
+
|
| 63 |
+
<!-- Quiz Container -->
|
| 64 |
+
<div id="quiz-container" class="bg-gray-800 rounded-xl p-8 shadow-xl">
|
| 65 |
+
<!-- Questions will be inserted here dynamically -->
|
| 66 |
+
</div>
|
| 67 |
+
</div>
|
| 68 |
+
</div>
|
| 69 |
+
|
| 70 |
+
<!-- Results Page -->
|
| 71 |
+
<div id="results-page" class="min-h-screen hidden py-12 px-4">
|
| 72 |
+
<div class="max-w-6xl mx-auto">
|
| 73 |
+
<h2 class="text-4xl font-bold mb-8 text-center text-indigo-400">Here's Your Perfect Movie Match!</h2>
|
| 74 |
+
|
| 75 |
+
<!-- Main Recommendation -->
|
| 76 |
+
<div id="main-recommendation" class="bg-gray-800 rounded-xl p-6 mb-12 flex flex-col md:flex-row gap-8" data-aos="fade-up">
|
| 77 |
+
<div class="w-full md:w-1/3">
|
| 78 |
+
<img id="main-poster" src="http://static.photos/movie/640x360/1" alt="Movie Poster" class="w-full rounded-lg shadow-lg">
|
| 79 |
+
</div>
|
| 80 |
+
<div class="w-full md:w-2/3">
|
| 81 |
+
<h3 id="main-title" class="text-3xl font-bold mb-2">Movie Title</h3>
|
| 82 |
+
<div class="flex items-center gap-4 mb-4">
|
| 83 |
+
<span id="main-year" class="text-gray-400">2023</span>
|
| 84 |
+
<span id="main-rating" class="bg-indigo-600 text-white px-2 py-1 rounded text-sm">PG-13</span>
|
| 85 |
+
<span id="main-score" class="text-yellow-400">★ 8.5/10</span>
|
| 86 |
+
</div>
|
| 87 |
+
<p id="main-genre" class="text-gray-300 mb-4">Action, Adventure, Sci-Fi</p>
|
| 88 |
+
<p id="main-description" class="text-lg mb-6">Why we picked this for you: An edge-of-your-seat thriller from the 90s with a plot twist you won't see coming.</p>
|
| 89 |
+
<div class="flex flex-wrap gap-3 mb-6">
|
| 90 |
+
<button class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 91 |
+
<i data-feather="play"></i> Netflix
|
| 92 |
+
</button>
|
| 93 |
+
<button class="bg-purple-600 hover:bg-purple-700 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 94 |
+
<i data-feather="play"></i> Prime Video
|
| 95 |
+
</button>
|
| 96 |
+
<button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center gap-2">
|
| 97 |
+
<i data-feather="play"></i> Watch Trailer
|
| 98 |
+
</button>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
|
| 103 |
+
<!-- Other Recommendations -->
|
| 104 |
+
<h3 class="text-2xl font-bold mb-6">Other Great Options</h3>
|
| 105 |
+
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 mb-12">
|
| 106 |
+
<!-- Other movie cards will be inserted here dynamically -->
|
| 107 |
+
</div>
|
| 108 |
+
|
| 109 |
+
<div class="text-center">
|
| 110 |
+
<button onclick="restartQuiz()" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-3 px-8 rounded-full text-lg transition-all duration-300">
|
| 111 |
+
Try Again?
|
| 112 |
+
</button>
|
| 113 |
+
</div>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
|
| 117 |
+
<script>
|
| 118 |
+
// Initialize animations and effects
|
| 119 |
+
AOS.init();
|
| 120 |
+
feather.replace();
|
| 121 |
+
|
| 122 |
+
// Vanta.js background
|
| 123 |
+
VANTA.GLOBE({
|
| 124 |
+
el: "#vanta-bg",
|
| 125 |
+
mouseControls: true,
|
| 126 |
+
touchControls: true,
|
| 127 |
+
gyroControls: false,
|
| 128 |
+
minHeight: 200.00,
|
| 129 |
+
minWidth: 200.00,
|
| 130 |
+
scale: 1.00,
|
| 131 |
+
scaleMobile: 1.00,
|
| 132 |
+
color: 0x5f27cd,
|
| 133 |
+
backgroundColor: 0x111827,
|
| 134 |
+
size: 0.8
|
| 135 |
+
});
|
| 136 |
+
|
| 137 |
+
// Quiz data
|
| 138 |
+
const quizQuestions = [
|
| 139 |
+
{
|
| 140 |
+
question: "What kind of vibe are you in the mood for tonight?",
|
| 141 |
+
options: [
|
| 142 |
+
{ emoji: "🤣", text: "A good laugh", value: "comedy" },
|
| 143 |
+
{ emoji: "😱", text: "Edge-of-your-seat suspense", value: "thriller" },
|
| 144 |
+
{ emoji: "🤯", text: "Something to make me think", value: "drama" },
|
| 145 |
+
{ emoji: "💖", text: "A heartwarming story", value: "romance" },
|
| 146 |
+
{ emoji: "💥", text: "Action-packed adventure", value: "action" }
|
| 147 |
+
],
|
| 148 |
+
type: "card"
|
| 149 |
+
},
|
| 150 |
+
{
|
| 151 |
+
question: "Are you feeling modern or classic?",
|
| 152 |
+
options: [
|
| 153 |
+
{ text: "Latest Releases (2020s)", value: "2020" },
|
| 154 |
+
{ text: "Modern Hits (2000s)", value: "2000" },
|
| 155 |
+
{ text: "90s Throwback", value: "1990" },
|
| 156 |
+
{ text: "A Timeless Classic (Pre-1990)", value: "1980" }
|
| 157 |
+
],
|
| 158 |
+
type: "button"
|
| 159 |
+
},
|
| 160 |
+
{
|
| 161 |
+
question: "Who's on the couch with you?",
|
| 162 |
+
options: [
|
| 163 |
+
{ emoji: "👤", text: "Just me", value: "adult" },
|
| 164 |
+
{ emoji: "💑", text: "Date night", value: "couple" },
|
| 165 |
+
{ emoji: "👨👩👧👦", text: "The whole family", value: "family" },
|
| 166 |
+
{ emoji: "👯♂️", text: "With my friends", value: "friends" }
|
| 167 |
+
],
|
| 168 |
+
type: "card"
|
| 169 |
+
},
|
| 170 |
+
{
|
| 171 |
+
question: "How much attention can you spare?",
|
| 172 |
+
options: [
|
| 173 |
+
{ text: "Easy watch. I want to turn my brain off.", value: "easy" },
|
| 174 |
+
{ text: "Engaging. Give me a great story.", value: "engaging" },
|
| 175 |
+
{ text: "Complex. I want a plot with twists and turns.", value: "complex" }
|
| 176 |
+
],
|
| 177 |
+
type: "button"
|
| 178 |
+
}
|
| 179 |
+
];
|
| 180 |
+
|
| 181 |
+
// User answers
|
| 182 |
+
let userAnswers = [];
|
| 183 |
+
let currentQuestion = 0;
|
| 184 |
+
|
| 185 |
+
// Start the quiz
|
| 186 |
+
function startQuiz() {
|
| 187 |
+
document.getElementById('homepage').classList.add('hidden');
|
| 188 |
+
document.getElementById('quiz-page').classList.remove('hidden');
|
| 189 |
+
showQuestion(currentQuestion);
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
// Show current question
|
| 193 |
+
function showQuestion(index) {
|
| 194 |
+
const quizContainer = document.getElementById('quiz-container');
|
| 195 |
+
const question = quizQuestions[index];
|
| 196 |
+
|
| 197 |
+
// Update progress bar
|
| 198 |
+
document.getElementById('progress-bar').style.width = `${(index / quizQuestions.length) * 100}%`;
|
| 199 |
+
|
| 200 |
+
// Create question HTML
|
| 201 |
+
let optionsHTML = '';
|
| 202 |
+
|
| 203 |
+
if (question.type === 'card') {
|
| 204 |
+
question.options.forEach((option, i) => {
|
| 205 |
+
optionsHTML += `
|
| 206 |
+
<div onclick="selectOption(${i})" class="quiz-option cursor-pointer bg-gray-700 rounded-xl p-6 text-center border-2 border-gray-600 hover:border-indigo-500">
|
| 207 |
+
<span class="text-4xl mb-2">${option.emoji}</span>
|
| 208 |
+
<p class="text-lg">${option.text}</p>
|
| 209 |
+
</div>
|
| 210 |
+
`;
|
| 211 |
+
});
|
| 212 |
+
} else {
|
| 213 |
+
question.options.forEach((option, i) => {
|
| 214 |
+
optionsHTML += `
|
| 215 |
+
<button onclick="selectOption(${i})" class="quiz-option w-full bg-gray-700 hover:bg-gray-600 text-white font-medium py-3 px-6 rounded-lg border-2 border-gray-600 hover:border-indigo-500">
|
| 216 |
+
${option.text}
|
| 217 |
+
</button>
|
| 218 |
+
`;
|
| 219 |
+
});
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
quizContainer.innerHTML = `
|
| 223 |
+
<h3 class="text-2xl font-bold mb-8 text-center">${question.question}</h3>
|
| 224 |
+
<div class="grid ${question.type === 'card' ? 'grid-cols-1 sm:grid-cols-2' : 'grid-cols-1'} gap-4 mb-8">
|
| 225 |
+
${optionsHTML}
|
| 226 |
+
</div>
|
| 227 |
+
${index > 0 ? `
|
| 228 |
+
<button onclick="previousQuestion()" class="mr-4 bg-gray-700 hover:bg-gray-600 text-white font-medium py-2 px-6 rounded-lg">
|
| 229 |
+
Back
|
| 230 |
+
</button>
|
| 231 |
+
` : ''}
|
| 232 |
+
<button id="next-btn" onclick="nextQuestion()" class="bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-2 px-6 rounded-lg opacity-50 cursor-not-allowed" disabled>
|
| 233 |
+
${index === quizQuestions.length - 1 ? 'Get My Recommendation' : 'Next'}
|
| 234 |
+
</button>
|
| 235 |
+
`;
|
| 236 |
+
|
| 237 |
+
feather.replace();
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
// Select an option
|
| 241 |
+
function selectOption(index) {
|
| 242 |
+
const options = document.querySelectorAll('.quiz-option');
|
| 243 |
+
options.forEach(opt => opt.classList.remove('selected'));
|
| 244 |
+
options[index].classList.add('selected');
|
| 245 |
+
|
| 246 |
+
document.getElementById('next-btn').disabled = false;
|
| 247 |
+
document.getElementById('next-btn').classList.remove('opacity-50', 'cursor-not-allowed');
|
| 248 |
+
|
| 249 |
+
// Store answer
|
| 250 |
+
userAnswers[currentQuestion] = quizQuestions[currentQuestion].options[index].value;
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
// Go to next question
|
| 254 |
+
function nextQuestion() {
|
| 255 |
+
if (currentQuestion < quizQuestions.length - 1) {
|
| 256 |
+
currentQuestion++;
|
| 257 |
+
showQuestion(currentQuestion);
|
| 258 |
+
} else {
|
| 259 |
+
// Quiz completed - show loading then results
|
| 260 |
+
document.getElementById('quiz-page').classList.add('hidden');
|
| 261 |
+
|
| 262 |
+
// Show loading animation
|
| 263 |
+
const quizContainer = document.getElementById('quiz-container');
|
| 264 |
+
quizContainer.innerHTML = `
|
| 265 |
+
<div class="text-center py-12">
|
| 266 |
+
<div class="inline-block mb-6">
|
| 267 |
+
<div class="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-indigo-500"></div>
|
| 268 |
+
</div>
|
| 269 |
+
<h3 class="text-2xl font-bold mb-2">Analyzing your taste...</h3>
|
| 270 |
+
<p class="text-gray-400">Searching the archives for your perfect match</p>
|
| 271 |
+
</div>
|
| 272 |
+
`;
|
| 273 |
+
|
| 274 |
+
// Simulate API call delay
|
| 275 |
+
setTimeout(showResults, 2000);
|
| 276 |
+
}
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
// Go to previous question
|
| 280 |
+
function previousQuestion() {
|
| 281 |
+
if (currentQuestion > 0) {
|
| 282 |
+
currentQuestion--;
|
| 283 |
+
showQuestion(currentQuestion);
|
| 284 |
+
}
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
// Show results
|
| 288 |
+
function showResults() {
|
| 289 |
+
// In a real app, this would fetch from an API based on userAnswers
|
| 290 |
+
// For demo purposes, we'll use mock data
|
| 291 |
+
|
| 292 |
+
// Mock main recommendation
|
| 293 |
+
document.getElementById('main-poster').src = "http://static.photos/movie/640x360/1";
|
| 294 |
+
document.getElementById('main-title').textContent = "Inception";
|
| 295 |
+
document.getElementById('main-year').textContent = "2010";
|
| 296 |
+
document.getElementById('main-rating').textContent = "PG-13";
|
| 297 |
+
document.getElementById('main-score').textContent = "★ 8.8/10";
|
| 298 |
+
document.getElementById('main-genre').textContent = "Action, Adventure, Sci-Fi";
|
| 299 |
+
document.getElementById('main-description').textContent = "Why we picked this for you: A mind-bending sci-fi thriller with incredible visuals and a complex plot that will keep you engaged.";
|
| 300 |
+
|
| 301 |
+
// Mock other recommendations
|
| 302 |
+
const otherMovies = [
|
| 303 |
+
{
|
| 304 |
+
title: "The Matrix",
|
| 305 |
+
year: "1999",
|
| 306 |
+
poster: "http://static.photos/movie/320x240/2",
|
| 307 |
+
genre: "Sci-Fi, Action"
|
| 308 |
+
},
|
| 309 |
+
{
|
| 310 |
+
title: "Interstellar",
|
| 311 |
+
year: "2014",
|
| 312 |
+
poster: "http://static.photos/movie/320x240/3",
|
| 313 |
+
genre: "Adventure, Drama, Sci-Fi"
|
| 314 |
+
},
|
| 315 |
+
{
|
| 316 |
+
title: "The Dark Knight",
|
| 317 |
+
year: "2008",
|
| 318 |
+
poster: "http://static.photos/movie/320x240/4",
|
| 319 |
+
genre: "Action, Crime, Drama"
|
| 320 |
+
}
|
| 321 |
+
];
|
| 322 |
+
|
| 323 |
+
const otherContainer = document.querySelector('#results-page .grid');
|
| 324 |
+
otherContainer.innerHTML = '';
|
| 325 |
+
|
| 326 |
+
otherMovies.forEach(movie => {
|
| 327 |
+
otherContainer.innerHTML += `
|
| 328 |
+
<div class="movie-card bg-gray-800 rounded-lg overflow-hidden shadow-lg hover:shadow-xl transition-all">
|
| 329 |
+
<img src="${movie.poster}" alt="${movie.title}" class="w-full h-48 object-cover">
|
| 330 |
+
<div class="p-4">
|
| 331 |
+
<h4 class="font-bold text-lg mb-1">${movie.title}</h4>
|
| 332 |
+
<div class="flex justify-between items-center">
|
| 333 |
+
<span class="text-gray-400 text-sm">${movie.year}</span>
|
| 334 |
+
<span class="text-gray-300 text-sm">${movie.genre}</span>
|
| 335 |
+
</div>
|
| 336 |
+
</div>
|
| 337 |
+
</div>
|
| 338 |
+
`;
|
| 339 |
+
});
|
| 340 |
+
|
| 341 |
+
document.getElementById('results-page').classList.remove('hidden');
|
| 342 |
+
}
|
| 343 |
+
|
| 344 |
+
// Restart quiz
|
| 345 |
+
function restartQuiz() {
|
| 346 |
+
currentQuestion = 0;
|
| 347 |
+
userAnswers = [];
|
| 348 |
+
document.getElementById('results-page').classList.add('hidden');
|
| 349 |
+
document.getElementById('homepage').classList.remove('hidden');
|
| 350 |
+
}
|
| 351 |
+
</script>
|
| 352 |
+
</body>
|
| 353 |
</html>
|
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Primary Goal:
|
| 2 |
+
Create an engaging, interactive web application called "Cinematch" that helps users discover the perfect movie to watch by taking them through a short, fun quiz. The recommendations should feel personalized and tailored to their current mood and preferences.
|
| 3 |
+
|
| 4 |
+
Part 1: Core Concept & Audience
|
| 5 |
+
Website Name: Cinematch
|
| 6 |
+
|
| 7 |
+
Tagline: "Your perfect movie match is just a few questions away."
|
| 8 |
+
|
| 9 |
+
Purpose: To solve the "what should I watch?" dilemma by providing personalized movie recommendations through an interactive quiz, instead of endless scrolling through catalogs.
|
| 10 |
+
|
| 11 |
+
Target Audience: Casual movie watchers, couples, families, and anyone who feels overwhelmed by the sheer volume of choices on streaming platforms.
|
| 12 |
+
|
| 13 |
+
Tone: Fun, conversational, and enthusiastic, like a knowledgeable friend giving you a great movie tip.
|
| 14 |
+
|
| 15 |
+
Part 2: The User Journey & The Interactive Quiz
|
| 16 |
+
The user experience should be a smooth, linear journey from the homepage to the final recommendation. The quiz is the central feature.
|
| 17 |
+
|
| 18 |
+
1. Homepage (/)
|
| 19 |
+
Visuals: A beautiful, high-impact background (perhaps a stylized collage of iconic movie posters or a cinematic shot).
|
| 20 |
+
|
| 21 |
+
Main Content: Very minimalist.
|
| 22 |
+
|
| 23 |
+
The logo "Cinematch."
|
| 24 |
+
|
| 25 |
+
The tagline: "Your perfect movie match is just a few questions away."
|
| 26 |
+
|
| 27 |
+
A single, large, and inviting call-to-action button: "Find My Movie!"
|
| 28 |
+
|
| 29 |
+
2. The Quiz Page (/quiz)
|
| 30 |
+
When the user clicks the button, they are taken to a full-screen, immersive quiz interface. Present one question at a time to keep it focused and engaging.
|
| 31 |
+
|
| 32 |
+
Progress Bar: A simple bar at the top of the screen shows the user's progress through the quiz (e.g., 1 of 5).
|
| 33 |
+
|
| 34 |
+
Question Flow:
|
| 35 |
+
|
| 36 |
+
Question 1: The Mood Setter
|
| 37 |
+
|
| 38 |
+
Question: "What kind of vibe are you in the mood for tonight?"
|
| 39 |
+
|
| 40 |
+
Answers (Visual Cards): Use icons and short text.
|
| 41 |
+
|
| 42 |
+
"🤣 A good laugh" (Comedy)
|
| 43 |
+
|
| 44 |
+
"😱 Edge-of-your-seat suspense" (Thriller, Horror)
|
| 45 |
+
|
| 46 |
+
"🤯 Something to make me think" (Sci-Fi, Mystery, Drama)
|
| 47 |
+
|
| 48 |
+
"💖 A heartwarming story" (Romance, Family)
|
| 49 |
+
|
| 50 |
+
"💥 Action-packed adventure" (Action, Adventure)
|
| 51 |
+
|
| 52 |
+
Question 2: The Time Machine
|
| 53 |
+
|
| 54 |
+
Question: "Are you feeling modern or classic?"
|
| 55 |
+
|
| 56 |
+
Answers (Slider or Buttons):
|
| 57 |
+
|
| 58 |
+
"Latest Releases (2020s)"
|
| 59 |
+
|
| 60 |
+
"Modern Hits (2000s)"
|
| 61 |
+
|
| 62 |
+
"90s Throwback"
|
| 63 |
+
|
| 64 |
+
"A Timeless Classic (Pre-1990)"
|
| 65 |
+
|
| 66 |
+
Question 3: The Company
|
| 67 |
+
|
| 68 |
+
Question: "Who's on the couch with you?"
|
| 69 |
+
|
| 70 |
+
Answers (Simple Icons):
|
| 71 |
+
|
| 72 |
+
"Just me" (Wider range of ratings)
|
| 73 |
+
|
| 74 |
+
"Date night" (Filters for Romance, rated R or PG-13)
|
| 75 |
+
|
| 76 |
+
"The whole family" (Filters for G, PG ratings)
|
| 77 |
+
|
| 78 |
+
"With my friends" (Filters for popular, crowd-pleasing genres)
|
| 79 |
+
|
| 80 |
+
Question 4: The Brain Power
|
| 81 |
+
|
| 82 |
+
Question: "How much attention can you spare?"
|
| 83 |
+
|
| 84 |
+
Answers:
|
| 85 |
+
|
| 86 |
+
"Easy watch. I want to turn my brain off."
|
| 87 |
+
|
| 88 |
+
"Engaging. Give me a great story."
|
| 89 |
+
|
| 90 |
+
"Complex. I want a plot with twists and turns."
|
| 91 |
+
|
| 92 |
+
Final Screen (Loading State):
|
| 93 |
+
|
| 94 |
+
After the last question, display a fun loading animation with text like: "Analyzing your taste...", "Searching the archives...", "Finding your perfect match..."
|
| 95 |
+
|
| 96 |
+
3. The Results Page (/recommendations)
|
| 97 |
+
Once the "analysis" is complete, this page loads dynamically with the top movie recommendations.
|
| 98 |
+
|
| 99 |
+
Header: "Here's Your Perfect Movie Match!"
|
| 100 |
+
|
| 101 |
+
Top Recommendation: Display one movie prominently at the top. This card should be larger and more detailed.
|
| 102 |
+
|
| 103 |
+
Large Movie Poster.
|
| 104 |
+
|
| 105 |
+
Movie Title & Year.
|
| 106 |
+
|
| 107 |
+
A "Why We Picked This For You" Snippet: A short, AI-generated sentence that connects the movie to the user's answers (e.g., "An edge-of-your-seat thriller from the 90s with a plot twist you won't see coming.").
|
| 108 |
+
|
| 109 |
+
Key Details: Genre, Rating (e.g., PG-13), and Critic Score (e.g., 88% on Rotten Tomatoes).
|
| 110 |
+
|
| 111 |
+
"Where to Watch" Buttons: Links to popular streaming services where the movie is available (e.g., Netflix, Hulu, Prime Video).
|
| 112 |
+
|
| 113 |
+
"Watch Trailer" Button.
|
| 114 |
+
|
| 115 |
+
"Other Great Options" Section:
|
| 116 |
+
|
| 117 |
+
Display 2-3 alternative recommendations in smaller cards below the main one. These cards should show the poster, title, and year.
|
| 118 |
+
|
| 119 |
+
"Try Again?" Button: A clear button to let the user easily retake the quiz.
|
| 120 |
+
|
| 121 |
+
Part 4: Backend Logic & Technology
|
| 122 |
+
Movie Data Source: The backend must integrate with a comprehensive movie database API like The Movie Database (TMDb) API or OMDb API to fetch movie posters, details, ratings, and streaming availability.
|
| 123 |
+
|
| 124 |
+
Recommendation Engine:
|
| 125 |
+
|
| 126 |
+
The core logic will be a system that maps the user's quiz answers to specific API query parameters.
|
| 127 |
+
|
| 128 |
+
Example Mapping:
|
| 129 |
+
|
| 130 |
+
"Edge-of-your-seat suspense" -> query for genre=Thriller,Horror.
|
| 131 |
+
|
| 132 |
+
"90s Throwback" -> query for primary_release_year between 1990-1999.
|
| 133 |
+
|
| 134 |
+
"The whole family" -> query for certification=G,PG.
|
| 135 |
+
|
| 136 |
+
The backend should combine these filters to create a highly specific API request. It should then sort the results by popularity or rating to present the best possible matches.
|
| 137 |
+
|
| 138 |
+
Dynamic Content Generation: The "Why We Picked This For You" snippet should be dynamically generated by the backend based on the user's answers to make the recommendation feel truly personal.
|