|
<!DOCTYPE html> |
|
<html lang="fr"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
<title>CinéFull - Films Complets en HD</title> |
|
<script src="https://cdn.tailwindcss.com"></script> |
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> |
|
<style> |
|
.player-container { |
|
aspect-ratio: 16/9; |
|
} |
|
.loading-spinner { |
|
border-top-color: transparent; |
|
animation: spin 1s linear infinite; |
|
} |
|
@keyframes spin { |
|
0% { transform: rotate(0deg); } |
|
100% { transform: rotate(360deg); } |
|
} |
|
.quality-badge { |
|
position: absolute; |
|
top: 8px; |
|
right: 8px; |
|
background: rgba(0,0,0,0.7); |
|
} |
|
.server-btn.active { |
|
background-color: #3b82f6; |
|
} |
|
.progress-container { |
|
height: 4px; |
|
background-color: #4b5563; |
|
} |
|
.progress-bar { |
|
height: 100%; |
|
background-color: #3b82f6; |
|
width: 0%; |
|
} |
|
.film-controls { |
|
opacity: 0; |
|
transition: opacity 0.3s; |
|
} |
|
.film-container:hover .film-controls { |
|
opacity: 1; |
|
} |
|
.search-dropdown { |
|
max-height: 400px; |
|
overflow-y: auto; |
|
} |
|
.movie-card:hover .movie-overlay { |
|
opacity: 1; |
|
} |
|
.movie-overlay { |
|
transition: all 0.3s ease; |
|
} |
|
.blur-bg { |
|
position: absolute; |
|
top: 0; |
|
left: 0; |
|
right: 0; |
|
bottom: 0; |
|
background-size: cover; |
|
filter: blur(20px); |
|
opacity: 0.3; |
|
z-index: -1; |
|
} |
|
.category-btn.active { |
|
background-color: #3b82f6; |
|
color: white; |
|
} |
|
</style> |
|
</head> |
|
<body class="bg-gray-900 text-white"> |
|
|
|
<header class="bg-gray-800 shadow-lg sticky top-0 z-50"> |
|
<div class="container mx-auto px-4 py-3 flex items-center justify-between"> |
|
<div class="flex items-center space-x-2"> |
|
<i class="fas fa-film text-blue-500 text-2xl"></i> |
|
<h1 class="text-xl font-bold">Ciné<span class="text-blue-500">Full</span></h1> |
|
</div> |
|
|
|
<div class="hidden md:flex items-center space-x-6"> |
|
<a href="#" class="hover:text-blue-400">Accueil</a> |
|
<a href="#" class="hover:text-blue-400">Films</a> |
|
<a href="#" class="hover:text-blue-400">Séries</a> |
|
<a href="#" class="hover:text-blue-400">Nouveautés</a> |
|
<a href="#" class="hover:text-blue-400">Catégories</a> |
|
</div> |
|
|
|
<div class="flex items-center space-x-4"> |
|
<div class="relative"> |
|
<input type="text" id="search-input" placeholder="Rechercher un film..." |
|
class="bg-gray-700 px-4 py-2 rounded-md w-64 focus:outline-none focus:ring-2 focus:ring-blue-500"> |
|
<div id="search-results" class="absolute left-0 mt-2 w-full bg-gray-800 rounded-md shadow-xl search-dropdown hidden z-50"></div> |
|
</div> |
|
<button class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-md"> |
|
<i class="fas fa-user mr-2"></i>Connexion |
|
</button> |
|
<button class="md:hidden" id="mobile-menu-btn"> |
|
<i class="fas fa-bars text-xl"></i> |
|
</button> |
|
</div> |
|
</div> |
|
</header> |
|
|
|
|
|
<div id="mobile-menu" class="hidden md:hidden bg-gray-800 px-4 py-2"> |
|
<div class="flex flex-col space-y-2"> |
|
<a href="#" class="hover:text-blue-400 py-1">Accueil</a> |
|
<a href="#" class="hover:text-blue-400 py-1">Films</a> |
|
<a href="#" class="hover:text-blue-400 py-1">Séries</a> |
|
<a href="#" class="hover:text-blue-400 py-1">Nouveautés</a> |
|
<a href="#" class="hover:text-blue-400 py-1">Catégories</a> |
|
</div> |
|
</div> |
|
|
|
|
|
<main class="container mx-auto px-4 py-6"> |
|
|
|
<div class="flex overflow-x-auto pb-4 mb-6 scrollbar-hide"> |
|
<div class="flex space-x-2"> |
|
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="all">Tous</button> |
|
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="french">Français</button> |
|
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="action">Action</button> |
|
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="comedy">Comédie</button> |
|
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="drama">Drame</button> |
|
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="sf">Science-Fiction</button> |
|
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="horror">Horreur</button> |
|
<button class="category-btn px-4 py-2 rounded-full bg-gray-800 hover:bg-gray-700" data-category="adventure">Aventure</button> |
|
</div> |
|
</div> |
|
|
|
|
|
<section class="mb-12"> |
|
<div class="relative film-container"> |
|
|
|
<div id="movie-backdrop" class="blur-bg"></div> |
|
|
|
|
|
<div class="relative player-container bg-black rounded-lg overflow-hidden shadow-xl"> |
|
<div id="full-movie-container"> |
|
<div class="flex items-center justify-center h-full bg-gray-800"> |
|
<div class="text-center"> |
|
<i class="fas fa-film text-5xl text-gray-600 mb-4"></i> |
|
<p class="text-gray-400">Sélectionnez un film pour commencer</p> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
<div id="loading-overlay" class="absolute inset-0 bg-black bg-opacity-70 flex items-center justify-center hidden"> |
|
<div class="w-16 h-16 border-4 border-blue-500 border-t-transparent rounded-full loading-spinner"></div> |
|
<span class="ml-3">Chargement du film...</span> |
|
</div> |
|
|
|
|
|
<div class="film-controls absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black to-transparent p-4"> |
|
<div class="progress-container mb-2"> |
|
<div id="progress-bar" class="progress-bar"></div> |
|
</div> |
|
<div class="flex justify-between items-center"> |
|
<div class="flex items-center space-x-4"> |
|
<button id="play-pause-btn" class="text-white hover:text-blue-400"> |
|
<i class="fas fa-pause text-xl"></i> |
|
</button> |
|
<span id="current-time" class="text-sm">00:00</span> |
|
<span class="text-gray-400">/</span> |
|
<span id="duration" class="text-sm">00:00</span> |
|
</div> |
|
<div class="flex items-center space-x-4"> |
|
<button id="mute-btn" class="text-white hover:text-blue-400"> |
|
<i class="fas fa-volume-up text-xl"></i> |
|
</button> |
|
<button class="text-white hover:text-blue-400"> |
|
<i class="fas fa-closed-captioning text-xl"></i> |
|
</button> |
|
<button onclick="toggleFullscreen('full-movie')" class="text-white hover:text-blue-400"> |
|
<i class="fas fa-expand text-xl"></i> |
|
</button> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
<div id="movie-info-container" class="mt-6 bg-gray-800 bg-opacity-80 rounded-lg p-6 backdrop-blur-sm hidden"> |
|
<div class="flex flex-col md:flex-row gap-6"> |
|
<div class="flex-shrink-0"> |
|
<img id="current-movie-poster" src="" alt="" class="w-48 rounded-lg shadow-md"> |
|
</div> |
|
<div class="flex-grow"> |
|
<h2 id="current-movie-title" class="text-3xl font-bold mb-2"></h2> |
|
<div class="flex items-center mb-4"> |
|
<div id="current-movie-rating" class="flex text-yellow-400 mr-3"></div> |
|
<span id="current-movie-rating-value" class="mr-4"></span> |
|
<span id="current-movie-quality" class="px-2 py-1 bg-blue-600 rounded text-xs mr-2"></span> |
|
<span id="current-movie-duration" class="text-gray-400"></span> |
|
</div> |
|
|
|
<p id="current-movie-description" class="text-gray-300 mb-4"></p> |
|
|
|
<div id="current-movie-genres" class="flex flex-wrap gap-2 mb-6"></div> |
|
|
|
<div class="flex items-center space-x-4"> |
|
<button class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-md flex items-center"> |
|
<i class="fas fa-bookmark mr-2"></i> Ajouter à ma liste |
|
</button> |
|
<button class="bg-gray-700 hover:bg-gray-600 px-4 py-2 rounded-md flex items-center"> |
|
<i class="fas fa-share-alt mr-2"></i> Partager |
|
</button> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
<div class="mt-8"> |
|
<h3 class="text-xl font-bold mb-4">Serveurs Disponibles</h3> |
|
<div id="server-buttons" class="flex flex-wrap gap-3"></div> |
|
</div> |
|
</div> |
|
</div> |
|
</section> |
|
|
|
|
|
<section class="mb-12"> |
|
<h2 class="text-2xl font-bold mb-6 flex items-center"> |
|
<i class="fas fa-fire text-red-500 mr-2"></i> Films Tendances |
|
</h2> |
|
<div id="trending-movies" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4"> |
|
|
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
</div> |
|
</section> |
|
|
|
<section class="mb-12"> |
|
<h2 class="text-2xl font-bold mb-6 flex items-center"> |
|
<i class="fas fa-star text-yellow-500 mr-2"></i> Meilleurs Films |
|
</h2> |
|
<div id="top-rated-movies" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4"> |
|
|
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
</div> |
|
</section> |
|
|
|
<section class="mb-12"> |
|
<h2 class="text-2xl font-bold mb-6 flex items-center"> |
|
<i class="fas fa-clock text-blue-500 mr-2"></i> Nouveaux Films |
|
</h2> |
|
<div id="new-releases" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4"> |
|
|
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
<div class="animate-pulse bg-gray-800 rounded-lg aspect-[2/3]"></div> |
|
</div> |
|
</section> |
|
</main> |
|
|
|
|
|
<footer class="bg-gray-900 pt-12 pb-6"> |
|
<div class="container mx-auto px-4"> |
|
<div class="grid grid-cols-1 md:grid-cols-4 gap-8 mb-8"> |
|
<div> |
|
<h3 class="text-xl font-bold mb-4 flex items-center"> |
|
<i class="fas fa-film text-blue-500 mr-2"></i> CinéFull |
|
</h3> |
|
<p class="text-gray-400 mb-4">La meilleure plateforme pour regarder des films complets en streaming gratuit.</p> |
|
<div class="flex space-x-4"> |
|
<a href="#" class="text-gray-400 hover:text-blue-400"> |
|
<i class="fab fa-facebook-f"></i> |
|
</a> |
|
<a href="#" class="text-gray-400 hover:text-blue-400"> |
|
<i class="fab fa-twitter"></i> |
|
</a> |
|
<a href="#" class="text-gray-400 hover:text-blue-400"> |
|
<i class="fab fa-telegram"></i> |
|
</a> |
|
</div> |
|
</div> |
|
|
|
<div> |
|
<h4 class="font-bold mb-4">Navigation</h4> |
|
<ul class="space-y-2"> |
|
<li><a href="#" class="text-gray-400 hover:text-blue-400">Accueil</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-blue-400">Films</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-blue-400">Séries</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-blue-400">Nouveautés</a></li> |
|
</ul> |
|
</div> |
|
|
|
<div> |
|
<h4 class="font-bold mb-4">Catégories</h4> |
|
<ul class="space-y-2"> |
|
<li><a href="#" class="text-gray-400 hover:text-blue-400">Action</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-blue-400">Science-fiction</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-blue-400">Drame</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-blue-400">Aventure</a></li> |
|
</ul> |
|
</div> |
|
|
|
<div> |
|
<h4 class="font-bold mb-4">Légal</h4> |
|
<ul class="space-y-2"> |
|
<li><a href="#" class="text-gray-400 hover:text-blue-400">Mentions légales</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-blue-400">CGU</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-blue-400">DMCA</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-blue-400">Contact</a></li> |
|
</ul> |
|
</div> |
|
</div> |
|
|
|
<div class="pt-6 border-t border-gray-800 text-center text-gray-500 text-sm"> |
|
<p>© 2023 CinéFull. Tous droits réservés.</p> |
|
<p class="mt-2">Ce site fournit des liens vers des serveurs externes.</p> |
|
</div> |
|
</div> |
|
</footer> |
|
|
|
<script> |
|
|
|
const API_CONFIG = { |
|
baseUrl: 'https://api.themoviedb.org/3', |
|
apiKey: '6a4bf6d8e5a9c7f7a9a9a9a9a9a9a9a9', |
|
language: 'fr-FR', |
|
region: 'FR' |
|
}; |
|
|
|
|
|
const CORS_PROXY = 'https://cors-anywhere.herokuapp.com/'; |
|
|
|
|
|
let movieDatabase = []; |
|
|
|
|
|
function toggleFullscreen(videoId) { |
|
const video = document.getElementById(videoId); |
|
if (!document.fullscreenElement) { |
|
video.requestFullscreen().catch(err => { |
|
alert(`Erreur lors du passage en plein écran: ${err.message}`); |
|
}); |
|
} else { |
|
document.exitFullscreen(); |
|
} |
|
} |
|
|
|
|
|
function changeServer(src, serverName) { |
|
const videoContainer = document.getElementById('full-movie-container'); |
|
const loadingOverlay = document.getElementById('loading-overlay'); |
|
|
|
|
|
loadingOverlay.classList.remove('hidden'); |
|
|
|
|
|
document.querySelectorAll('.server-btn').forEach(btn => { |
|
btn.classList.remove('active'); |
|
btn.classList.add('bg-gray-700', 'hover:bg-gray-600'); |
|
}); |
|
|
|
|
|
event.target.classList.add('active'); |
|
event.target.classList.remove('bg-gray-700', 'hover:bg-gray-600'); |
|
|
|
|
|
let videoHTML; |
|
if (src.includes('youtube.com') || src.includes('youtu.be')) { |
|
const videoId = src.includes('youtube.com') |
|
? src.match(/[?&]v=([^&]+)/)[1] |
|
: src.match(/youtu.be\/([^?]+)/)[1]; |
|
videoHTML = `<iframe id="full-movie" class="w-full h-full" src="https://www.youtube.com/embed/${videoId}?autoplay=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`; |
|
} else if (src.includes('vimeo.com')) { |
|
const videoId = src.match(/vimeo.com\/(\d+)/)[1]; |
|
videoHTML = `<iframe id="full-movie" class="w-full h-full" src="https://player.vimeo.com/video/${videoId}?autoplay=1" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>`; |
|
} else if (src.includes('dailymotion.com')) { |
|
const videoId = src.match(/video\/([^_]+)/)[1]; |
|
videoHTML = `<iframe id="full-movie" class="w-full h-full" src="https://www.dailymotion.com/embed/video/${videoId}?autoplay=1" frameborder="0" allow="autoplay" allowfullscreen></iframe>`; |
|
} else { |
|
videoHTML = `<video id="full-movie" class="w-full h-full" autoplay muted controls> |
|
<source src="${src}" type="video/mp4"> |
|
Votre navigateur ne supporte pas la lecture de vidéos. |
|
</video>`; |
|
} |
|
|
|
|
|
videoContainer.innerHTML = videoHTML; |
|
|
|
|
|
setTimeout(() => { |
|
loadingOverlay.classList.add('hidden'); |
|
|
|
|
|
const newVideo = document.getElementById('full-movie'); |
|
if (newVideo.tagName === 'VIDEO') { |
|
setupVideoControls(newVideo); |
|
} |
|
}, 1500); |
|
} |
|
|
|
|
|
function setupVideoControls(video) { |
|
const playPauseBtn = document.getElementById('play-pause-btn'); |
|
const currentTime = document.getElementById('current-time'); |
|
const duration = document.getElementById('duration'); |
|
const progressBar = document.getElementById('progress-bar'); |
|
const muteBtn = document.getElementById('mute-btn'); |
|
|
|
|
|
function formatTime(seconds) { |
|
const minutes = Math.floor(seconds / 60); |
|
const remainingSeconds = Math.floor(seconds % 60); |
|
return `${minutes}:${remainingSeconds < 10 ? '0' : ''}${remainingSeconds}`; |
|
} |
|
|
|
|
|
function updateTime() { |
|
currentTime.textContent = formatTime(video.currentTime); |
|
duration.textContent = formatTime(video.duration); |
|
|
|
|
|
const progress = (video.currentTime / video.duration) * 100; |
|
progressBar.style.width = `${progress}%`; |
|
} |
|
|
|
|
|
playPauseBtn.addEventListener('click', function() { |
|
if (video.paused) { |
|
video.play(); |
|
playPauseBtn.innerHTML = '<i class="fas fa-pause text-xl"></i>'; |
|
} else { |
|
video.pause(); |
|
playPauseBtn.innerHTML = '<i class="fas fa-play text-xl"></i>'; |
|
} |
|
}); |
|
|
|
|
|
muteBtn.addEventListener('click', function() { |
|
video.muted = !video.muted; |
|
muteBtn.innerHTML = video.muted |
|
? '<i class="fas fa-volume-mute text-xl"></i>' |
|
: '<i class="fas fa-volume-up text-xl"></i>'; |
|
}); |
|
|
|
|
|
video.addEventListener('timeupdate', updateTime); |
|
|
|
|
|
video.addEventListener('loadedmetadata', function() { |
|
duration.textContent = formatTime(video.duration); |
|
}); |
|
|
|
|
|
document.querySelector('.progress-container').addEventListener('click', function(e) { |
|
const rect = this.getBoundingClientRect(); |
|
const pos = (e.pageX - rect.left) / this.offsetWidth; |
|
video.currentTime = pos * video.duration; |
|
}); |
|
|
|
|
|
video.muted = true; |
|
video.play().catch(e => { |
|
console.log('Autoplay prevented, showing controls'); |
|
video.controls = true; |
|
}); |
|
|
|
|
|
video.addEventListener('play', function() { |
|
playPauseBtn.innerHTML = '<i class="fas fa-pause text-xl"></i>'; |
|
}); |
|
|
|
video.addEventListener('pause', function() { |
|
playPauseBtn.innerHTML = '<i class="fas fa-play text-xl"></i>'; |
|
}); |
|
} |
|
|
|
|
|
function loadMovie(movieId) { |
|
const movie = movieDatabase.find(m => m.id === movieId); |
|
if (!movie) return; |
|
|
|
|
|
document.getElementById('movie-info-container').classList.remove('hidden'); |
|
|
|
|
|
document.getElementById('current-movie-title').textContent = `${movie.title} (${movie.year})`; |
|
document.getElementById('current-movie-poster').src = movie.poster; |
|
document.getElementById('current-movie-poster').alt = movie.title; |
|
document.getElementById('current-movie-description').textContent = movie.description; |
|
document.getElementById('current-movie-duration').textContent = movie.duration; |
|
|
|
|
|
document.getElementById('movie-backdrop').style.backgroundImage = `url(${movie.backdrop})`; |
|
|
|
|
|
const ratingContainer = document.getElementById('current-movie-rating'); |
|
ratingContainer.innerHTML = ''; |
|
const fullStars = Math.floor(movie.rating); |
|
const hasHalfStar = movie.rating % 1 >= 0.5; |
|
|
|
for (let i = 0; i < 5; i++) { |
|
if (i < fullStars) { |
|
ratingContainer.innerHTML += '<i class="fas fa-star"></i>'; |
|
} else if (i === fullStars && hasHalfStar) { |
|
ratingContainer.innerHTML += '<i class="fas fa-star-half-alt"></i>'; |
|
} else { |
|
ratingContainer.innerHTML += '<i class="far fa-star"></i>'; |
|
} |
|
} |
|
|
|
|
|
document.getElementById('current-movie-rating-value').textContent = `${movie.rating.toFixed(1)}/5`; |
|
|
|
|
|
document.getElementById('current-movie-quality').textContent = movie.quality || 'HD 1080p'; |
|
|
|
|
|
const genresContainer = document.getElementById('current-movie-genres'); |
|
genresContainer.innerHTML = ''; |
|
movie.genres.forEach(genre => { |
|
genresContainer.innerHTML += `<span class="px-3 py-1 bg-gray-700 rounded-full text-sm">${genre.name || genre}</span>`; |
|
}); |
|
|
|
|
|
const serversContainer = document.getElementById('server-buttons'); |
|
serversContainer.innerHTML = ''; |
|
|
|
if (movie.servers && movie.servers.length > 0) { |
|
movie.servers.forEach((server, index) => { |
|
serversContainer.innerHTML += ` |
|
<button class="server-btn px-4 py-2 rounded-md flex items-center ${index === 0 ? 'active bg-blue-600' : 'bg-gray-700 hover:bg-gray-600'}" |
|
onclick="changeServer('${server.url}', '${server.name}')"> |
|
<i class="fas fa-server mr-2"></i> ${server.name} <span class="ml-2 text-xs bg-black bg-opacity-50 px-2 py-1 rounded">${server.quality || 'HD'}</span> |
|
</button> |
|
`; |
|
}); |
|
|
|
|
|
const videoContainer = document.getElementById('full-movie-container'); |
|
let videoHTML; |
|
|
|
if (movie.servers[0].url.includes('youtube.com') || movie.servers[0].url.includes('youtu.be')) { |
|
const videoId = movie.servers[0].url.includes('youtube.com') |
|
? movie.servers[0].url.match(/[?&]v=([^&]+)/)[1] |
|
: movie.servers[0].url.match(/youtu.be\/([^?]+)/)[1]; |
|
videoHTML = `<iframe id="full-movie" class="w-full h-full" src="https://www.youtube.com/embed/${videoId}?autoplay=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`; |
|
} else if (movie.servers[0].url.includes('vimeo.com')) { |
|
const videoId = movie.servers[0].url.match(/vimeo.com\/(\d+)/)[1]; |
|
videoHTML = `<iframe id="full-movie" class="w-full h-full" src="https://player.vimeo.com/video/${videoId}?autoplay=1" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>`; |
|
} else if (movie.servers[0].url.includes('dailymotion.com')) { |
|
const videoId = movie.servers[0].url.match(/video\/([^_]+)/)[1]; |
|
videoHTML = `<iframe id="full-movie" class="w-full h-full" src="https://www.dailymotion.com/embed/video/${videoId}?autoplay=1" frameborder="0" allow="autoplay" allowfullscreen></iframe>`; |
|
} else { |
|
videoHTML = `<video id="full-movie" class="w-full h-full" autoplay muted controls> |
|
<source src="${movie.servers[0].url}" type="video/mp4"> |
|
Votre navigateur ne supporte pas la lecture de vidéos. |
|
</video>`; |
|
} |
|
|
|
videoContainer.innerHTML = videoHTML; |
|
|
|
|
|
const video = document.getElementById('full-movie'); |
|
if (video.tagName === 'VIDEO') { |
|
setupVideoControls(video); |
|
} |
|
} else { |
|
|
|
serversContainer.innerHTML = '<p class="text-gray-400">Aucun serveur disponible pour ce film</p>'; |
|
videoContainer.innerHTML = '<div class="flex items-center justify-center h-full bg-gray-800"><p class="text-gray-400">Aucun lien de streaming disponible</p></div>'; |
|
} |
|
} |
|
|
|
|
|
function createMovieCard(movie) { |
|
return ` |
|
<div class="group movie-card" onclick="loadMovie(${movie.id})"> |
|
<div class="relative overflow-hidden rounded-lg aspect-[2/3]"> |
|
<img src="${movie.poster}" alt="${movie.title}" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"> |
|
<div class="movie-overlay absolute inset-0 bg-black bg-opacity-30 flex items-center justify-center opacity-0"> |
|
<button class="bg-blue-600 hover:bg-blue-700 w-12 h-12 rounded-full flex items-center justify-center"> |
|
<i class="fas fa-play"></i> |
|
</button> |
|
</div> |
|
<span class="absolute top-2 right-2 bg-yellow-500 text-black text-xs font-bold px-2 py-1 rounded">${movie.rating.toFixed(1)}</span> |
|
</div> |
|
<h4 class="mt-2 font-medium">${movie.title} <span class="text-gray-400">(${movie.year})</span></h4> |
|
</div> |
|
`; |
|
} |
|
|
|
|
|
function filterMoviesByCategory(category) { |
|
if (category === 'all') return movieDatabase; |
|
|
|
const categoryMap = { |
|
'french': m => m.original_language === 'fr', |
|
'action': m => m.genre_ids?.includes(28) || m.genres?.some(g => g.id === 28), |
|
'comedy': m => m.genre_ids?.includes(35) || m.genres?.some(g => g.id === 35), |
|
'drama': m => m.genre_ids?.includes(18) || m.genres?.some(g => g.id === 18), |
|
'sf': m => m.genre_ids?.includes(878) || m.genres?.some(g => g.id === 878), |
|
'horror': m => m.genre_ids?.includes(27) || m.genres?.some(g => g.id === 27), |
|
'adventure': m => m.genre_ids?.includes(12) || m.genres?.some(g => g.id === 12) |
|
}; |
|
|
|
return movieDatabase.filter(categoryMap[category] || (() => true)); |
|
} |
|
|
|
|
|
function searchMovies(query) { |
|
if (!query) return []; |
|
return movieDatabase.filter(movie => |
|
movie.title.toLowerCase().includes(query.toLowerCase()) |
|
); |
|
} |
|
|
|
|
|
async function fetchStreamingLinks(movieId, title) { |
|
try { |
|
|
|
|
|
|
|
|
|
const searchQuery = encodeURIComponent(`${title} film complet français`); |
|
|
|
|
|
const youtubeLink = `https://www.youtube.com/results?search_query=${searchQuery}`; |
|
|
|
|
|
const vimeoLink = `https://vimeo.com/search?q=${searchQuery}`; |
|
|
|
|
|
const dailymotionLink = `https://www.dailymotion.com/search/${searchQuery}`; |
|
|
|
|
|
return [ |
|
{ name: "YouTube", url: `https://www.youtube.com/embed/zSWdZVtXT7E?autoplay=1`, quality: "HD 1080p" }, |
|
{ name: "Vimeo", url: `https://player.vimeo.com/video/24456787?autoplay=1`, quality: "HD 720p" }, |
|
{ name: "Dailymotion", url: `https://www.dailymotion.com/embed/video/x8j1j4v?autoplay=1`, quality: "HD 720p" } |
|
]; |
|
|
|
} catch (error) { |
|
console.error("Error fetching streaming links:", error); |
|
return []; |
|
} |
|
} |
|
|
|
|
|
async function fetchMovies() { |
|
try { |
|
|
|
const trendingResponse = await fetch(`${CORS_PROXY}${API_CONFIG.baseUrl}/trending/movie/week?api_key=${API_CONFIG.apiKey}&language=${API_CONFIG.language}®ion=${API_CONFIG.region}`); |
|
const trendingData = await trendingResponse.json(); |
|
|
|
|
|
const topRatedResponse = await fetch(`${CORS_PROXY}${API_CONFIG.baseUrl}/movie/top_rated?api_key=${API_CONFIG.apiKey}&language=${API_CONFIG.language}®ion=${API_CONFIG.region}`); |
|
const topRatedData = await topRatedResponse.json(); |
|
|
|
|
|
const upcomingResponse = await fetch(`${CORS_PROXY}${API_CONFIG.baseUrl}/movie/upcoming?api_key=${API_CONFIG.apiKey}&language=${API_CONFIG.language}®ion=${API_CONFIG.region}`); |
|
const upcomingData = await upcomingResponse.json(); |
|
|
|
|
|
const allMovies = [...trendingData.results, ...topRatedData.results, ...upcomingData.results]; |
|
const uniqueMovies = allMovies.filter((movie, index, self) => |
|
index === self.findIndex(m => m.id === movie.id) |
|
); |
|
|
|
|
|
const genresResponse = await fetch(`${CORS_PROXY}${API_CONFIG.baseUrl}/genre/movie/list?api_key=${API_CONFIG.apiKey}&language=${API_CONFIG.language}`); |
|
const genresData = await genresResponse.json(); |
|
const genresMap = genresData.genres.reduce((map, genre) => { |
|
map[genre.id] = genre; |
|
return map; |
|
}, {}); |
|
|
|
|
|
movieDatabase = await Promise.all(uniqueMovies.map(async (movie) => { |
|
|
|
const detailsResponse = await fetch(`${CORS_PROXY}${API_CONFIG.baseUrl}/movie/${movie.id}?api_key=${API_CONFIG.apiKey}&language=${API_CONFIG.language}`); |
|
const details = await detailsResponse.json(); |
|
|
|
|
|
const servers = await fetchStreamingLinks(movie.id, movie.title); |
|
|
|
return { |
|
id: movie.id, |
|
title: movie.title, |
|
year: new Date(movie.release_date).getFullYear(), |
|
description: details.overview || "Description non disponible", |
|
poster: movie.poster_path ? `https://image.tmdb.org/t/p/w500${movie.poster_path}` : 'https://via.placeholder.com/500x750?text=Poster+non+disponible', |
|
backdrop: movie.backdrop_path ? `https://image.tmdb.org/t/p/original${movie.backdrop_path}` : 'https://via.placeholder.com/1920x1080?text=Backdrop+non+disponible', |
|
rating: movie.vote_average / 2, |
|
duration: movie.runtime ? `${Math.floor(movie.runtime / 60)}h ${movie.runtime % 60}min` : "Durée inconnue", |
|
genres: movie.genre_ids ? movie.genre_ids.map(id => genresMap[id]) : [], |
|
original_language: movie.original_language, |
|
servers: servers, |
|
trending: trendingData.results.some(m => m.id === movie.id), |
|
topRated: topRatedData.results.some(m => m.id === movie.id) |
|
}; |
|
})); |
|
|
|
return movieDatabase; |
|
|
|
} catch (error) { |
|
console.error("Error fetching movies:", error); |
|
|
|
|
|
return [ |
|
|
|
]; |
|
} |
|
} |
|
|
|
|
|
document.addEventListener('DOMContentLoaded', async function() { |
|
|
|
const videoContainer = document.querySelector('.player-container'); |
|
videoContainer.innerHTML = `<div id="full-movie-container"></div>`; |
|
|
|
|
|
await fetchMovies(); |
|
|
|
|
|
const searchInput = document.getElementById('search-input'); |
|
const searchResults = document.getElementById('search-results'); |
|
const mobileMenuBtn = document.getElementById('mobile-menu-btn'); |
|
const mobileMenu = document.getElementById('mobile-menu'); |
|
|
|
searchInput.addEventListener('input', function() { |
|
const query = this.value; |
|
if (query.length > 2) { |
|
const results = searchMovies(query); |
|
if (results.length > 0) { |
|
searchResults.innerHTML = results.map(movie => ` |
|
<div class="p-3 hover:bg-gray-700 cursor-pointer flex items-center" onclick="loadMovie(${movie.id})"> |
|
<img src="${movie.poster}" alt="${movie.title}" class="w-10 h-14 object-cover rounded mr-3"> |
|
<div> |
|
<div class="font-medium">${movie.title}</div> |
|
<div class="text-xs text-gray-400">${movie.year} • ${movie.genres.map(g => g.name).join(', ')}</div> |
|
</div> |
|
</div> |
|
`).join(''); |
|
searchResults.classList.remove('hidden'); |
|
} else { |
|
searchResults.innerHTML = '<div class="p-3 text-gray-400">Aucun résultat trouvé</div>'; |
|
searchResults.classList.remove('hidden'); |
|
} |
|
} else { |
|
searchResults.classList.add('hidden'); |
|
} |
|
}); |
|
|
|
|
|
document.addEventListener('click', function(e) { |
|
if (!searchInput.contains(e.target) && !searchResults.contains(e.target)) { |
|
searchResults.classList.add('hidden'); |
|
} |
|
}); |
|
|
|
|
|
mobileMenuBtn.addEventListener('click', function() { |
|
mobileMenu.classList.toggle('hidden'); |
|
}); |
|
|
|
|
|
document.querySelectorAll('.category-btn').forEach(btn => { |
|
btn.addEventListener('click', function() { |
|
|
|
document.querySelectorAll('.category-btn').forEach(b => b.classList.remove('active', 'bg-blue-600')); |
|
this.classList.add('active', 'bg-blue-600'); |
|
|
|
|
|
const category = this.dataset.category; |
|
const filteredMovies = filterMoviesByCategory(category); |
|
|
|
|
|
document.getElementById('trending-movies').innerHTML = |
|
filteredMovies.filter(m => m.trending).map(createMovieCard).join(''); |
|
|
|
document.getElementById('top-rated-movies').innerHTML = |
|
filteredMovies.filter(m => m.topRated).map(createMovieCard).join(''); |
|
|
|
document.getElementById('new-releases').innerHTML = |
|
filteredMovies.filter(m => m.year >= new Date().getFullYear() - 2).map(createMovieCard).join(''); |
|
}); |
|
}); |
|
|
|
|
|
document.getElementById('trending-movies').innerHTML = |
|
movieDatabase.filter(m => m.trending).map(createMovieCard).join(''); |
|
|
|
document.getElementById('top-rated-movies').innerHTML = |
|
movieDatabase.filter(m => m.topRated).map(createMovieCard).join(''); |
|
|
|
document.getElementById('new-releases').innerHTML = |
|
movieDatabase.filter(m => m.year >= new Date().getFullYear() - 2).map(createMovieCard).join(''); |
|
}); |
|
</script> |
|
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=docto41/cin-full" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> |
|
</html> |