diff --git a/src/app/test/page.tsx b/src/app/test/page.tsx new file mode 100644 index 0000000..d669951 --- /dev/null +++ b/src/app/test/page.tsx @@ -0,0 +1,41 @@ +import React from 'react'; + +import EpisodeSelector from '@/components/EpisodeSelector'; + +export default function TestPage() { + return ( +
+

+ 🧪 剧集选择器测试页面 +

+ +
+
+ { + // 选择了第 {_episode + 1} 集 + }} + availableSources={[]} + sourceSearchLoading={false} + sourceSearchError={null} + /> +
+
+ +
+

测试说明:

+ +
+
+ ); +} diff --git a/src/components/EpisodeSelector.tsx b/src/components/EpisodeSelector.tsx index 4b57b6b..4355a90 100644 --- a/src/components/EpisodeSelector.tsx +++ b/src/components/EpisodeSelector.tsx @@ -399,14 +399,36 @@ const EpisodeSelector: React.FC = ({ - {/* 集数网格 - 超灵活响应式布局 */} + {/* 测试区域 - 验证响应式是否工作 */} +
+

🔧 响应式测试区域

+
+ {[1,2,3,4,5,6,7,8,9,10].map(n => ( +
+ {n} +
+ ))} +
+

如果这个网格随着浏览器缩放改变,说明响应式正常工作

+
+ + {/* 集数网格 - 超响应式布局 */}
{/* 调试信息 */} -
- 总共{totalEpisodes}集 | 每页{episodesPerPage}集 | 当前第{currentPage + 1}页 | 共{pageCount}页 +
+ 📊 总共 {totalEpisodes} 集 | 每页 {episodesPerPage} 集 | 当前第 {currentPage + 1} 页 | 共 {pageCount}
-
+ {/* 响应式网格 - 简化但有效的方案 */} +
{(() => { const len = currentEnd - currentStart + 1; const episodes = Array.from({ length: len }, (_, i) => @@ -420,150 +442,44 @@ const EpisodeSelector: React.FC = ({ key={episodeNumber} onClick={() => handleEpisodeClick(episodeNumber - 1)} className={` - episode-btn relative overflow-hidden group - flex items-center justify-center font-bold rounded-xl border-2 - transition-all duration-300 ease-out transform hover:scale-105 active:scale-95 hover:rotate-1 + aspect-square relative group overflow-hidden + min-h-[28px] min-w-[28px] + xs:min-h-[32px] xs:min-w-[32px] + sm:min-h-[36px] sm:min-w-[36px] + md:min-h-[42px] md:min-w-[42px] + lg:min-h-[48px] lg:min-w-[48px] + xl:min-h-[54px] xl:min-w-[54px] + 2xl:min-h-[60px] 2xl:min-w-[60px] + flex items-center justify-center + text-xs xs:text-sm sm:text-base lg:text-lg font-black + rounded-xl border-3 + transition-all duration-300 ease-out + transform hover:scale-110 hover:rotate-3 active:scale-95 active:rotate-0 ${ isActive - ? 'bg-gradient-to-br from-emerald-400 via-green-500 to-teal-600 text-white border-emerald-300 shadow-2xl shadow-emerald-500/50 scale-105' - : 'bg-gradient-to-br from-white via-gray-50 to-slate-100 text-gray-800 border-gray-300 hover:from-blue-50 hover:via-indigo-50 hover:to-purple-100 hover:border-blue-400 hover:text-blue-700 hover:shadow-xl hover:shadow-blue-200/30 dark:from-slate-700 dark:via-gray-800 dark:to-zinc-800 dark:text-slate-200 dark:border-slate-600 dark:hover:from-blue-900/70 dark:hover:to-purple-900/70 dark:hover:border-blue-500' + ? 'bg-gradient-to-br from-red-500 via-pink-500 to-purple-600 text-white border-red-300 shadow-2xl shadow-red-500/60 scale-110 rotate-6 z-10' + : 'bg-gradient-to-br from-yellow-200 via-orange-200 to-red-200 text-black border-orange-400 hover:from-green-100 hover:via-blue-100 hover:to-purple-100 hover:border-blue-500 hover:text-blue-800 hover:shadow-xl hover:shadow-blue-300/50' } `.trim()} > - + {episodeNumber} - {/* 动态光效 */} -
+ + {/* 流光效果 */} +
+ + {/* 光晕效果 */} +
); })}
- - )} diff --git a/tailwind.config.ts b/tailwind.config.ts index 1634058..57c05e0 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -16,6 +16,12 @@ const config: Config = { raw: '(orientation: landscape) and (max-height: 700px)', }, }, + gridTemplateColumns: { + '13': 'repeat(13, minmax(0, 1fr))', + '14': 'repeat(14, minmax(0, 1fr))', + '15': 'repeat(15, minmax(0, 1fr))', + '16': 'repeat(16, minmax(0, 1fr))', + }, fontFamily: { primary: ['Inter', ...defaultTheme.fontFamily.sans], },