Skip to content

一分钟搭建影视站,支持Docker等部署方式

从HTML分离出CSS 文件

developere3ecc78774de
diff --git a/css/index.css b/css/index.css
new file mode 100644
index 0000000..1d3ed14
--- /dev/null
+++ b/css/index.css
@@ -0,0 +1,209 @@
+/* 主页特定样式 */
+
+/* 历史记录和设置按钮定位样式 */
+.top-corner-button {
+ position: fixed;
+ z-index: 10;
+ background: #222;
+ border: 1px solid #333;
+ border-radius: 0.5rem;
+ padding: 0.375rem 0.75rem;
+ transition: all 0.2s ease;
+}
+
+.top-corner-button:hover {
+ background: #333;
+ border-color: white;
+}
+
+/* 搜索区域样式 */
+.search-box {
+ height: 3.5rem;
+ box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
+ border-radius: 0.5rem;
+ overflow: hidden;
+ display: flex;
+ align-items: stretch;
+}
+
+.search-button {
+ width: 5rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: white;
+ color: black;
+ font-weight: 500;
+ transition: background-color 0.2s;
+}
+
+.search-button:hover {
+ background: #f0f0f0;
+}
+
+.search-input {
+ flex: 1;
+ background: #111;
+ border-top: 1px solid #333;
+ border-bottom: 1px solid #333;
+ color: white;
+ padding: 0 1.5rem;
+ font-size: 1rem;
+ outline: none;
+ transition: background-color 0.2s;
+}
+
+.search-input:focus {
+ background: #191919;
+}
+
+/* 最近搜索记录样式 */
+.recent-search-tag {
+ display: inline-block;
+ padding: 0.25rem 0.75rem;
+ margin: 0.25rem;
+ background: rgba(59, 130, 246, 0.1);
+ border: 1px solid rgba(59, 130, 246, 0.2);
+ border-radius: 0.5rem;
+ color: #e5e7eb;
+ font-size: 0.875rem;
+ transition: all 0.2s;
+}
+
+.recent-search-tag:hover {
+ background: rgba(59, 130, 246, 0.2);
+ border-color: rgba(59, 130, 246, 0.4);
+}
+
+/* 豆瓣区域样式 */
+.douban-container {
+ margin: 2rem auto;
+ max-width: 1280px;
+ padding: 0 0.5rem;
+}
+
+.douban-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 1rem;
+}
+
+.douban-toggle {
+ display: flex;
+ align-items: center;
+ background: #222;
+ border-radius: 9999px;
+ padding: 0.25rem;
+}
+
+.douban-toggle-button {
+ padding: 0.25rem 0.75rem;
+ font-size: 0.875rem;
+ border-radius: 9999px;
+}
+
+.douban-toggle-button.active {
+ background: #db2777;
+ color: white;
+}
+
+.douban-toggle-button:not(.active) {
+ color: #9ca3af;
+}
+
+.douban-toggle-button:not(.active):hover {
+ color: white;
+}
+
+.douban-refresh-button {
+ font-size: 0.875rem;
+ padding: 0.25rem 0.75rem;
+ background: #db2777;
+ color: white;
+ border-radius: 0.5rem;
+ display: flex;
+ align-items: center;
+ gap: 0.25rem;
+}
+
+.douban-refresh-button:hover {
+ background: #be185d;
+}
+
+.douban-tags-container {
+ overflow-x: auto;
+ padding-bottom: 0.5rem;
+}
+
+.douban-tags {
+ display: flex;
+ gap: 0.5rem;
+ min-width: max-content;
+}
+
+.douban-tag {
+ padding: 0.25rem 0.75rem;
+ background: rgba(219, 39, 119, 0.1);
+ border: 1px solid rgba(219, 39, 119, 0.2);
+ border-radius: 0.5rem;
+ color: #f9a8d4;
+ font-size: 0.875rem;
+ transition: all 0.2s;
+}
+
+.douban-tag:hover {
+ background: rgba(219, 39, 119, 0.2);
+ border-color: rgba(219, 39, 119, 0.4);
+}
+
+.douban-tag.active {
+ background: #db2777;
+ border-color: #db2777;
+ color: white;
+}
+
+/* 搜索结果样式 */
+.search-results-container {
+ width: 100%;
+ max-width: 1280px;
+ margin: 0 auto;
+ padding: 0 0.5rem;
+}
+
+.search-result-stats {
+ text-align: right;
+ font-size: 0.875rem;
+ color: #9ca3af;
+ margin-bottom: 1rem;
+}
+
+/* 响应式网格布局 */
+.search-results-grid {
+ display: grid;
+ gap: 1rem;
+}
+
+@media (max-width: 640px) {
+ .search-results-grid {
+ grid-template-columns: 1fr;
+ }
+}
+
+@media (min-width: 641px) and (max-width: 768px) {
+ .search-results-grid {
+ grid-template-columns: repeat(2, 1fr);
+ }
+}
+
+@media (min-width: 769px) and (max-width: 1024px) {
+ .search-results-grid {
+ grid-template-columns: repeat(3, 1fr);
+ }
+}
+
+@media (min-width: 1025px) {
+ .search-results-grid {
+ grid-template-columns: repeat(4, 1fr);
+ }
+}
diff --git a/css/modals.css b/css/modals.css
new file mode 100644
index 0000000..837969a
--- /dev/null
+++ b/css/modals.css
@@ -0,0 +1,214 @@
+/* 模态框通用样式 */
+.modal-overlay {
+ position: fixed;
+ inset: 0;
+ background-color: rgba(0, 0, 0, 0.95);
+ display: none;
+ align-items: center;
+ justify-content: center;
+ z-index: 40;
+ transition: opacity 0.3s ease;
+}
+
+.modal-content {
+ background-color: #111;
+ padding: 2rem;
+ border-radius: 0.5rem;
+ border: 1px solid #333;
+ width: 91.666667%;
+ max-width: 56rem;
+ max-height: 90vh;
+ display: flex;
+ flex-direction: column;
+}
+
+.modal-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 1.5rem;
+ flex: none;
+}
+
+.modal-title {
+ font-size: 1.5rem;
+ font-weight: 700;
+ background: linear-gradient(to right, #00ccff, #ff3c78);
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+ word-break: break-word;
+ padding-right: 1rem;
+ max-width: 80%;
+}
+
+.modal-close {
+ color: #9ca3af;
+ font-size: 1.5rem;
+ transition: color 0.2s;
+ flex-shrink: 0;
+}
+
+.modal-close:hover {
+ color: white;
+}
+
+.modal-body {
+ overflow: auto;
+ flex: 1;
+ min-height: 0;
+}
+
+/* 密码验证模态框 */
+.password-modal {
+ z-index: 65;
+}
+
+.password-form {
+ margin-bottom: 1.5rem;
+}
+
+.password-input {
+ width: 100%;
+ background-color: #111;
+ border: 1px solid #333;
+ color: white;
+ padding: 1rem;
+ border-radius: 0.5rem;
+ margin-bottom: 1rem;
+}
+
+.password-input:focus {
+ outline: none;
+ border-color: white;
+}
+
+.password-submit {
+ width: 100%;
+ background-color: #3b82f6;
+ color: white;
+ padding: 0.5rem 1rem;
+ border-radius: 0.25rem;
+ font-weight: 500;
+}
+
+.password-submit:hover {
+ background-color: #2563eb;
+}
+
+.password-error {
+ color: #ef4444;
+ margin-top: 0.5rem;
+ display: none;
+}
+
+/* 声明模态框 */
+.disclaimer-modal {
+ z-index: 60;
+}
+
+.disclaimer-content {
+ color: #d1d5db;
+ line-height: 1.5;
+}
+
+.disclaimer-content p {
+ margin-bottom: 1rem;
+}
+
+.disclaimer-content strong {
+ color: #60a5fa;
+}
+
+.disclaimer-button {
+ margin-top: 1.5rem;
+ padding: 0.75rem 1.5rem;
+ background: linear-gradient(to right, #4f46e5, #8b5cf6, #ec4899);
+ color: white;
+ font-weight: 600;
+ border-radius: 0.5rem;
+ transition: all 0.3s;
+}
+
+.disclaimer-button:hover {
+ box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
+ transform: translateY(-1px);
+}
+
+/* Toast 和 Loading 提示 */
+.toast {
+ position: fixed;
+ top: 1rem;
+ left: 50%;
+ transform: translateX(-50%) translateY(-100%);
+ background-color: #ef4444;
+ color: white;
+ padding: 0.75rem 1.5rem;
+ border-radius: 0.5rem;
+ box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3);
+ transition: all 0.3s;
+ opacity: 0;
+ z-index: 50;
+}
+
+.toast.show {
+ transform: translateX(-50%) translateY(0);
+ opacity: 1;
+}
+
+.loading-overlay {
+ position: fixed;
+ inset: 0;
+ background-color: rgba(0, 0, 0, 0.8);
+ display: none;
+ align-items: center;
+ justify-content: center;
+ z-index: 50;
+}
+
+.loading-content {
+ background-color: #111;
+ padding: 2rem;
+ border-radius: 0.5rem;
+ border: 1px solid #333;
+ display: flex;
+ align-items: center;
+ gap: 1rem;
+}
+
+.loading-spinner {
+ width: 2rem;
+ height: 2rem;
+ border: 4px solid white;
+ border-top-color: transparent;
+ border-radius: 50%;
+ animation: spin 1s linear infinite;
+}
+
+@keyframes spin {
+ to { transform: rotate(360deg); }
+}
+
+.loading-text {
+ color: white;
+ font-size: 1.125rem;
+}
+
+/* 动画效果 */
+@keyframes fadeIn {
+ from { opacity: 0; }
+ to { opacity: 1; }
+}
+
+@keyframes fadeOut {
+ from { opacity: 1; }
+ to { opacity: 0; }
+}
+
+.modal-overlay.show {
+ animation: fadeIn 0.3s forwards;
+ display: flex;
+}
+
+.modal-overlay.hide {
+ animation: fadeOut 0.3s forwards;
+}
diff --git a/css/player.css b/css/player.css
new file mode 100644
index 0000000..b794622
--- /dev/null
+++ b/css/player.css
@@ -0,0 +1,184 @@
+body, html {
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 100%;
+ background-color: #0f1622;
+ color: white;
+}
+.player-container {
+ width: 100%;
+ max-width: 1200px;
+ margin: 0 auto;
+}
+#player {
+ width: 100%;
+ height: 60vh; /* 视频播放器高度 */
+}
+.loading-container {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: rgba(0, 0, 0, 0.7);
+ color: white;
+ z-index: 100;
+ flex-direction: column;
+}
+.loading-spinner {
+ width: 50px;
+ height: 50px;
+ border: 4px solid rgba(255, 255, 255, 0.3);
+ border-radius: 50%;
+ border-top-color: white;
+ animation: spin 1s ease-in-out infinite;
+ margin-bottom: 10px;
+}
+@keyframes spin {
+ to { transform: rotate(360deg); }
+}
+.error-container {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ display: none;
+ align-items: center;
+ justify-content: center;
+ background-color: rgba(0, 0, 0, 0.7);
+ color: white;
+ z-index: 100;
+ flex-direction: column;
+ text-align: center;
+ padding: 1rem;
+}
+.error-icon {
+ font-size: 48px;
+ margin-bottom: 10px;
+}
+.episode-active {
+ background-color: #3b82f6 !important;
+ border-color: #60a5fa !important;
+}
+.episode-grid {
+ max-height: 30vh;
+ overflow-y: auto;
+}
+/* 恢复播放位置提示样式 */
+.position-restore-hint {
+ position: fixed;
+ bottom: 20px;
+ left: 50%;
+ transform: translateX(-50%) translateY(100%);
+ background-color: rgba(0, 0, 0, 0.8);
+ color: white;
+ padding: 10px 20px;
+ border-radius: 4px;
+ z-index: 1000;
+ transition: transform 0.3s ease;
+ font-size: 14px;
+}
+.position-restore-hint.show {
+ transform: translateX(-50%) translateY(0);
+}
+.hint-content {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.switch {
+ position: relative;
+ display: inline-block;
+ width: 46px;
+ height: 24px;
+}
+.switch input {
+ opacity: 0;
+ width: 0;
+ height: 0;
+}
+.slider {
+ position: absolute;
+ cursor: pointer;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: #333;
+ transition: .4s;
+ border-radius: 24px;
+}
+.slider:before {
+ position: absolute;
+ content: "";
+ height: 18px;
+ width: 18px;
+ left: 3px;
+ bottom: 3px;
+ background-color: white;
+ transition: .4s;
+ border-radius: 50%;
+}
+input:checked + .slider {
+ background-color: #00ccff;
+}
+input:checked + .slider:before {
+ transform: translateX(22px);
+}
+/* 添加快捷键提示样式 */
+.shortcut-hint {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ background-color: rgba(0, 0, 0, 0.8);
+ color: white;
+ padding: 1rem 2rem;
+ border-radius: 0.5rem;
+ font-size: 1.5rem;
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ z-index: 1000;
+ opacity: 0;
+ transition: opacity 0.3s ease;
+}
+.shortcut-hint.show {
+ opacity: 1;
+}
+
+/* 原生全屏时,播放器容器铺满 */
+.player-container:-webkit-full-screen,
+.player-container:fullscreen {
+ position: fixed;
+ top: 0; left: 0;
+ width: 100vw; height: 100vh;
+ z-index: 10000;
+ background-color: #000;
+}
+.player-container:-webkit-full-screen #player,
+.player-container:fullscreen #player {
+ width: 100%; height: 100%;
+}
+
+/* 新增:移动端响应式样式 */
+@media (max-width: 640px) {
+ .episode-grid {
+ max-height: 40vh; /* 移动端增加集数列表高度 */
+ }
+
+ /* 改进移动端按钮显示 */
+ button {
+ white-space: nowrap;
+ }
+
+ /* 控制栏在小屏幕上可能需要换行 */
+ .player-container .flex-wrap {
+ margin-bottom: 4px;
+ }
+}
diff --git a/css/styles.css b/css/styles.css
index 017a788..148f259 100644
--- a/css/styles.css
+++ b/css/styles.css
@@ -1,3 +1,13 @@
+/*
+LibreTV 全局样式
+包含多个页面共享的基础样式
+对于特定页面的样式,请参考:
+- index.css: 首页特定样式
+- player.css: 播放器页面特定样式
+- watch.css: 重定向页面特定样式
+- modals.css: 模态框和提示框样式
+*/
+
.close-btn {
position: absolute;
top: 12px;
diff --git a/css/watch.css b/css/watch.css
new file mode 100644
index 0000000..f15be4f
--- /dev/null
+++ b/css/watch.css
@@ -0,0 +1,41 @@
+/* 添加重定向页面的基本样式 */
+body {
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
+ background-color: #0f1622;
+ color: white;
+ margin: 0;
+ padding: 0;
+ height: 100vh;
+}
+
+.redirect-container {
+ text-align: center;
+ padding-top: 100px;
+ max-width: 600px;
+ margin: 0 auto;
+}
+
+.loading-animation {
+ display: inline-block;
+ width: 50px;
+ height: 50px;
+ border: 4px solid rgba(255, 255, 255, 0.3);
+ border-radius: 50%;
+ border-top-color: #00ccff;
+ animation: spin 1s linear infinite;
+ margin-bottom: 20px;
+}
+
+@keyframes spin {
+ to { transform: rotate(360deg); }
+}
+
+.redirect-message {
+ font-size: 1.2rem;
+ margin-bottom: 10px;
+}
+
+.redirect-hint {
+ font-size: 0.9rem;
+ color: #8599b2;
+}
diff --git a/index.html b/index.html
index 3b20c58..31e6fa5 100644
--- a/index.html
+++ b/index.html
@@ -15,6 +15,7 @@
<script src="libs/tailwindcss.min.js"></script>
<link rel="stylesheet" href="css/styles.css">
+ <link rel="stylesheet" href="css/index.css">
</head>
<body class="page-bg text-white">
<!-- 将历史记录按钮移到左上角,并缩小尺寸 -->
diff --git a/player.html b/player.html
index 1e8cfb4..1de4e78 100644
--- a/player.html
+++ b/player.html
@@ -14,191 +14,7 @@
<script src="js/wakelock.js"></script>
<script src="js/version-check.js"></script>
<link rel="stylesheet" href="css/styles.css">
- <style>
- body, html {
- margin: 0;
- padding: 0;
- width: 100%;
- height: 100%;
- background-color: #0f1622;
- color: white;
- }
- .player-container {
- width: 100%;
- max-width: 1200px;
- margin: 0 auto;
- }
- #player {
- width: 100%;
- height: 60vh; /* 视频播放器高度 */
- }
- .loading-container {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: rgba(0, 0, 0, 0.7);
- color: white;
- z-index: 100;
- flex-direction: column;
- }
- .loading-spinner {
- width: 50px;
- height: 50px;
- border: 4px solid rgba(255, 255, 255, 0.3);
- border-radius: 50%;
- border-top-color: white;
- animation: spin 1s ease-in-out infinite;
- margin-bottom: 10px;
- }
- @keyframes spin {
- to { transform: rotate(360deg); }
- }
- .error-container {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- display: none;
- align-items: center;
- justify-content: center;
- background-color: rgba(0, 0, 0, 0.7);
- color: white;
- z-index: 100;
- flex-direction: column;
- text-align: center;
- padding: 1rem;
- }
- .error-icon {
- font-size: 48px;
- margin-bottom: 10px;
- } .episode-active {
- background-color: #3b82f6 !important;
- border-color: #60a5fa !important;
- }
- .episode-grid {
- max-height: 30vh;
- overflow-y: auto;
- }
- /* 恢复播放位置提示样式 */
- .position-restore-hint {
- position: fixed;
- bottom: 20px;
- left: 50%;
- transform: translateX(-50%) translateY(100%);
- background-color: rgba(0, 0, 0, 0.8);
- color: white;
- padding: 10px 20px;
- border-radius: 4px;
- z-index: 1000;
- transition: transform 0.3s ease;
- font-size: 14px;
- }
- .position-restore-hint.show {
- transform: translateX(-50%) translateY(0);
- }
- .hint-content {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .switch {
- position: relative;
- display: inline-block;
- width: 46px;
- height: 24px;
- }
- .switch input {
- opacity: 0;
- width: 0;
- height: 0;
- }
- .slider {
- position: absolute;
- cursor: pointer;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: #333;
- transition: .4s;
- border-radius: 24px;
- }
- .slider:before {
- position: absolute;
- content: "";
- height: 18px;
- width: 18px;
- left: 3px;
- bottom: 3px;
- background-color: white;
- transition: .4s;
- border-radius: 50%;
- }
- input:checked + .slider {
- background-color: #00ccff;
- }
- input:checked + .slider:before {
- transform: translateX(22px);
- }
- /* 添加快捷键提示样式 */
- .shortcut-hint {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- background-color: rgba(0, 0, 0, 0.8);
- color: white;
- padding: 1rem 2rem;
- border-radius: 0.5rem;
- font-size: 1.5rem;
- display: flex;
- align-items: center;
- gap: 0.5rem;
- z-index: 1000;
- opacity: 0;
- transition: opacity 0.3s ease;
- }
- .shortcut-hint.show {
- opacity: 1;
- }
-
- /* 原生全屏时,播放器容器铺满 */
- .player-container:-webkit-full-screen,
- .player-container:fullscreen {
- position: fixed;
- top: 0; left: 0;
- width: 100vw; height: 100vh;
- z-index: 10000;
- background-color: #000;
- }
- .player-container:-webkit-full-screen #player,
- .player-container:fullscreen #player {
- width: 100%; height: 100%;
- }
-
- /* 新增:移动端响应式样式 */
- @media (max-width: 640px) {
- .episode-grid {
- max-height: 40vh; /* 移动端增加集数列表高度 */
- }
-
- /* 改进移动端按钮显示 */
- button {
- white-space: nowrap;
- }
-
- /* 控制栏在小屏幕上可能需要换行 */
- .player-container .flex-wrap {
- margin-bottom: 4px;
- }
- }
- </style>
+ <link rel="stylesheet" href="css/player.css">
</head>
<body>
<header class="bg-[#111] p-4 flex items-center border-b border-[#333] gap-2 player-header">
diff --git a/watch.html b/watch.html
index 50fba0c..8627695 100644
--- a/watch.html
+++ b/watch.html
@@ -5,6 +5,7 @@
<meta http-equiv="refresh" content="0; url=player.html">
<title>重定向到播放器</title>
<link rel="manifest" href="manifest.json">
+ <link rel="stylesheet" href="css/watch.css">
<script>
// 获取当前URL的参数,并将它们传递给player.html
window.onload = function() {
@@ -54,8 +55,10 @@
</script>
</head>
<body>
- <div style="text-align: center; padding-top: 100px;">
- 正在重定向到播放器...
+ <div class="redirect-container">
+ <div class="loading-animation"></div>
+ <div class="redirect-message">正在重定向到播放器...</div>
+ <p class="redirect-hint">如果页面没有自动跳转,请<a href="player.html" style="color: #00ccff;">点击这里</a></p>
</div>
</body>
</html>