a
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
$apiKey = '23af653f99d2e7ac884415805e7ca84c';
|
||||
|
||||
function searchMovie($query) {
|
||||
global $apiKey;
|
||||
$url = "https://api.themoviedb.org/3/search/multi?api_key=" . $apiKey . "&language=fr-FR&query=" . urlencode($query);
|
||||
|
||||
// On récupère le JSON
|
||||
$response = file_get_contents($url);
|
||||
return json_decode($response, true);
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php include 'functions.php'; ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>WatchGether - Recherche</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
</head>
|
||||
<body class="bg-slate-900 text-white p-8">
|
||||
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<h1 class="text-3xl font-bold mb-8 text-blue-400 text-center">Rechercher un film ou une série</h1>
|
||||
|
||||
<form method="GET" class="flex gap-2 mb-10">
|
||||
<input type="text" name="q" placeholder="Titre du film..."
|
||||
class="flex-grow p-4 rounded-lg bg-slate-800 border border-slate-700 focus:outline-none focus:border-blue-500">
|
||||
<button type="submit" class="bg-blue-600 px-8 py-4 rounded-lg font-bold hover:bg-blue-500 transition">
|
||||
Chercher
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="grid grid-cols-2 md:grid-cols-4 gap-6">
|
||||
<?php
|
||||
if (isset($_GET['q']) && !empty($_GET['q'])) {
|
||||
$results = searchMovie($_GET['q']);
|
||||
|
||||
foreach ($results['results'] as $item) {
|
||||
// On ne prend que les films ou séries qui ont une affiche
|
||||
if (isset($item['poster_path'])) {
|
||||
$title = isset($item['title']) ? $item['title'] : $item['name'];
|
||||
$poster = "https://image.tmdb.org/t/p/w500" . $item['poster_path'];
|
||||
$date = isset($item['release_date']) ? substr($item['release_date'], 0, 4) : (isset($item['first_air_date']) ? substr($item['first_air_date'], 0, 4) : '');
|
||||
|
||||
echo "
|
||||
<div class='bg-slate-800 rounded-xl overflow-hidden border border-slate-700 hover:scale-105 transition-transform cursor-pointer'>
|
||||
<img src='$poster' alt='$title' class='w-full h-auto'>
|
||||
<div class='p-3'>
|
||||
<h3 class='font-bold text-sm truncate'>$title</h3>
|
||||
<p class='text-xs text-gray-400'>$date</p>
|
||||
<button class='mt-2 w-full bg-green-600 text-xs py-1 rounded hover:bg-green-500'>+ Ajouter</button>
|
||||
</div>
|
||||
</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,64 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>WatchGether - Votre cinéma à deux</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
body { font-family: 'Poppins', sans-serif; }
|
||||
.bg-gradient-custom {
|
||||
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gradient-custom text-white min-h-screen flex flex-col">
|
||||
|
||||
<header class="p-6 flex justify-between items-center">
|
||||
<h1 class="text-2xl font-bold tracking-tighter text-blue-400">WATCH<span class="text-white">GETHER</span></h1>
|
||||
<a href="#login" class="bg-blue-600 hover:bg-blue-500 px-6 py-2 rounded-full font-semibold transition duration-300">
|
||||
Connexion
|
||||
</a>
|
||||
</header>
|
||||
|
||||
<main class="flex-grow flex flex-col items-center justify-center px-4 text-center">
|
||||
<div class="max-w-3xl">
|
||||
<h2 class="text-5xl md:text-6xl font-extrabold mb-6">
|
||||
Fini de chercher pendant des heures.
|
||||
</h2>
|
||||
<p class="text-xl text-gray-300 mb-10 leading-relaxed">
|
||||
Ajoutez vos films, synchronisez vos envies. <br class="hidden md:block">
|
||||
La liste commune trouve vos <strong>doublons</strong> instantanément pour des soirées ciné sans prise de tête.
|
||||
</p>
|
||||
|
||||
<div class="grid md:grid-cols-3 gap-6 mb-12">
|
||||
<div class="bg-white/5 p-6 rounded-2xl border border-white/10">
|
||||
<div class="text-3xl mb-2">🍿</div>
|
||||
<h3 class="font-bold mb-2">Listes Perso</h3>
|
||||
<p class="text-sm text-gray-400">Chacun sa liste de films et séries à voir.</p>
|
||||
</div>
|
||||
<div class="bg-white/5 p-6 rounded-2xl border border-white/10">
|
||||
<div class="text-3xl mb-2">🤝</div>
|
||||
<h3 class="font-bold mb-2">Match Automatique</h3>
|
||||
<p class="text-sm text-gray-400">Si vous voulez voir le même film, il apparaît ici.</p>
|
||||
</div>
|
||||
<div class="bg-white/5 p-6 rounded-2xl border border-white/10">
|
||||
<div class="text-3xl mb-2">🎲</div>
|
||||
<h3 class="font-bold mb-2">Mode Aléatoire</h3>
|
||||
<p class="text-sm text-gray-400">Laissez le destin choisir votre programme ce soir.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="bg-white text-blue-900 px-8 py-4 rounded-xl font-bold text-lg hover:scale-105 transition-transform">
|
||||
Lancer le projet
|
||||
</button>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="p-6 text-center text-gray-500 text-sm">
|
||||
© 2026 WatchGether - Propulsé par TMDB API
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user