一分钟搭建影视站,支持Docker等部署方式
fix
developer6bbf7587ed86
diff --git a/index.html b/index.htmlindex 938793a..3772197 100644--- a/index.html+++ b/index.html@@ -193,24 +193,6 @@<p class="text-gray-400 mb-8">自由观影,畅享精彩</p></header>- <!-- 豆瓣热门推荐区域: 默认隐藏 -->- <div id="doubanArea" class="w-full mb-8 hidden">- <div class="flex items-center justify-between mb-4">- <div class="flex items-center">- <h2 class="text-xl font-bold text-white">豆瓣热门</h2>- <div id="douban-tags" class="ml-4 flex flex-wrap"></div>- </div>- <button id="douban-refresh-btn" class="px-3 py-1 bg-[#222] hover:bg-[#333] border border-[#444] text-sm rounded-full flex items-center transition-colors">- <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />- </svg>- 换一批- </button>- </div>-- <div id="douban-results" class="grid grid-cols-2 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8 gap-2"></div>- </div>-<!-- 搜索区域:默认居中 --><div id="searchArea" class="flex-1 flex flex-col items-center justify-center"><h2 class="text-3xl font-bold gradient-text mb-8">视频搜索</h2>@@ -236,6 +218,24 @@</div></div>+ <!-- 豆瓣热门推荐区域: 默认隐藏,现在位于搜索区域下方 -->+ <div id="doubanArea" class="w-full my-8 hidden">+ <div class="flex items-center justify-between mb-4">+ <div class="flex items-center">+ <h2 class="text-xl font-bold text-white">豆瓣热门</h2>+ <div id="douban-tags" class="ml-4 flex flex-wrap"></div>+ </div>+ <button id="douban-refresh-btn" class="px-3 py-1 bg-[#222] hover:bg-[#333] border border-[#444] text-sm rounded-full flex items-center transition-colors">+ <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />+ </svg>+ 换一批+ </button>+ </div>++ <div id="douban-results" class="grid grid-cols-2 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8 gap-2"></div>+ </div>+<!-- 搜索结果:初始隐藏 --><div id="resultsArea" class="w-full hidden"><div id="results" class="grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-6">diff --git a/js/douban.js b/js/douban.jsindex 6a80fa2..a163804 100644--- a/js/douban.js+++ b/js/douban.js@@ -77,6 +77,28 @@ function updateDoubanVisibility() {}}+// 只填充搜索框,不执行搜索,让用户自主决定搜索时机+function fillSearchInput(title) {+ if (!title) return;++ // 安全处理标题,防止XSS+ const safeTitle = title+ .replace(/</g, '<')+ .replace(/>/g, '>')+ .replace(/"/g, '"');++ const input = document.getElementById('searchInput');+ if (input) {+ input.value = safeTitle;++ // 聚焦搜索框,便于用户立即使用键盘操作+ input.focus();++ // 显示一个提示,告知用户点击搜索按钮进行搜索+ showToast('已填充搜索内容,点击搜索按钮开始搜索', 'info');+ }+}+// 填充搜索框并执行搜索function fillAndSearch(title) {if (!title) return;@@ -184,14 +206,16 @@ function renderRecommend(tag, pageLimit, pageStart) {.replace(/</g, '<').replace(/>/g, '>');- // 使用封面代理,确保图片能够正常加载- const coverUrl = PROXY_URL + encodeURIComponent(item.cover);+ // 修复图片加载问题:使用备用图片URL方案+ // 1. 尝试使用原始图片地址但不通过代理+ // 2. 如果加载失败,使用备用图片+ const originalCoverUrl = item.cover;card.innerHTML = `- <div class="relative w-full aspect-[2/3] overflow-hidden cursor-pointer" onclick="fillAndSearch('${safeTitle}')">- <img src="${coverUrl}" alt="${safeTitle}"+ <div class="relative w-full aspect-[2/3] overflow-hidden cursor-pointer" onclick="fillSearchInput('${safeTitle}')">+ <img src="${originalCoverUrl}" alt="${safeTitle}"class="w-full h-full object-cover transition-transform duration-500 hover:scale-110"- onerror="this.onerror=null; this.src='https://via.placeholder.com/300x450?text=无封面'; this.classList.add('object-contain');"+ onerror="this.onerror=null; this.src='https://via.placeholder.com/300x450/111111/FFFFFF?text=${encodeURIComponent(safeTitle)}'; this.classList.add('object-contain');"loading="lazy"><div class="absolute inset-0 bg-gradient-to-t from-black to-transparent opacity-60"></div><div class="absolute bottom-2 left-2 bg-black/70 text-white text-xs px-2 py-1 rounded-sm">@@ -199,7 +223,7 @@ function renderRecommend(tag, pageLimit, pageStart) {</div></div><div class="p-2 text-center bg-[#111]">- <button onclick="fillAndSearch('${safeTitle}')"+ <button onclick="fillSearchInput('${safeTitle}')"class="text-sm font-medium text-white truncate w-full hover:text-pink-400 transition">${safeTitle}</button>