|
1 | | -// pages/index.tsx |
2 | 1 | "use client"; |
3 | 2 |
|
4 | 3 | import React, { useState } from 'react'; |
@@ -30,40 +29,50 @@ export default function Home() { |
30 | 29 | }; |
31 | 30 |
|
32 | 31 | return ( |
33 | | - <> |
34 | | - <div className="min-h-screen bg-gray-900 text-white flex flex-col items-center justify-center px-4" style={{ backgroundImage: "url('/background.jpg'), backgroundSize: 'cover', backgroundPosition: 'center'" }}> |
35 | | - <div className="absolute inset-0 bg-black opacity-50"></div> |
36 | | - <h1 className="text-3xl font-bold mb-6">🎬 Movie Recommender</h1> |
| 32 | + <div |
| 33 | + className="min-h-screen bg-gray-900 text-white px-4 relative flex items-center justify-center" |
| 34 | + style={{ |
| 35 | + backgroundImage: "url('/background.jpg')", |
| 36 | + backgroundSize: 'cover', |
| 37 | + backgroundPosition: 'center', |
| 38 | + }} |
| 39 | + > |
| 40 | + {/* 🔲 Background Overlay */} |
| 41 | + <div className="absolute inset-0 bg-black opacity-50 z-0" /> |
37 | 42 |
|
38 | | - <input |
39 | | - type="text" |
40 | | - placeholder="Enter Video ID" |
41 | | - value={selectedId} |
42 | | - onChange={(e) => setSelectedId(e.target.value)} |
43 | | - className="p-2 rounded text-black w-64 mb-4 bg-gray-200" |
44 | | - /> |
| 43 | + {/* 🔳 Foreground UI */} |
| 44 | + <div className="z-10 flex flex-col items-center"> |
| 45 | + <h1 className="text-3xl font-bold mb-6">🎬 Movie Recommender</h1> |
45 | 46 |
|
46 | | - <button |
47 | | - onClick={handleFetch} |
48 | | - className="bg-indigo-600 hover:bg-indigo-700 text-white font-semibold py-2 px-4 rounded" |
49 | | - > |
50 | | - 🔍 Show Recommendations |
51 | | - </button> |
| 47 | + <input |
| 48 | + type="text" |
| 49 | + placeholder="Enter Video ID" |
| 50 | + value={selectedId} |
| 51 | + onChange={(e) => setSelectedId(e.target.value)} |
| 52 | + className="p-2 rounded text-black w-64 mb-4 bg-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-500" |
| 53 | + /> |
52 | 54 |
|
53 | | - {loading && <p className="mt-4">Loading...</p>} |
| 55 | + <button |
| 56 | + onClick={handleFetch} |
| 57 | + className="bg-indigo-600 hover:bg-indigo-700 text-white font-semibold py-2 px-4 rounded transition" |
| 58 | + > |
| 59 | + 🔍 Show Recommendations |
| 60 | + </button> |
54 | 61 |
|
55 | | - <div className="mt-8 w-full max-w-xl"> |
56 | | - {recommendations.map((rec, i) => ( |
57 | | - <div key={i} className="bg-gray-800 rounded p-4 mb-4 shadow"> |
58 | | - <h2 className="text-xl font-semibold mb-2">🎬 Recommendation {i + 1}</h2> |
59 | | - <p><strong>Video ID:</strong> {rec.video_id}</p> |
60 | | - <p><strong>Video Type:</strong> {rec.video_type}</p> |
61 | | - <p><strong>Music Type:</strong> {rec.music_type}</p> |
62 | | - <p><strong>Tag:</strong> {rec.tag}</p> |
63 | | - </div> |
64 | | - ))} |
| 62 | + {loading && <p className="mt-4">Loading...</p>} |
| 63 | + |
| 64 | + <div className="mt-8 w-full max-w-xl"> |
| 65 | + {recommendations.map((rec, i) => ( |
| 66 | + <div key={i} className="bg-gray-800 rounded p-4 mb-4 shadow"> |
| 67 | + <h2 className="text-xl font-semibold mb-2">🎬 Recommendation {i + 1}</h2> |
| 68 | + <p><strong>Video ID:</strong> {rec.video_id}</p> |
| 69 | + <p><strong>Video Type:</strong> {rec.video_type}</p> |
| 70 | + <p><strong>Music Type:</strong> {rec.music_type}</p> |
| 71 | + <p><strong>Tag:</strong> {rec.tag}</p> |
| 72 | + </div> |
| 73 | + ))} |
| 74 | + </div> |
65 | 75 | </div> |
66 | 76 | </div> |
67 | | - </> |
68 | 77 | ); |
69 | 78 | } |
0 commit comments