feat: rebuild frontend as file-manager style explorer SPA

将原来的三页跳转结构(控制台/工作台/文件页)重构为单页资源管理器:
左侧数据源盘符树、主区列表/网格双视图、右侧内嵌播放器与详情面板,
管理功能收进侧栏对话框。媒体引擎(media-core + media-sw)原样复用,
仅把 file.js 的播放器逻辑抽成参数驱动组件。默认路由指向 explorer。

- 新增 explorer.html/js 与 modules/explorer/ 六个组件模块
- 删除旧的 index/source/file 页面及其控制器
- styles.css 新增 explorer 布局与三档响应式断点
This commit is contained in:
2026-07-04 14:53:07 +08:00
parent 10d7b49275
commit fcf56bcbd3
18 changed files with 3444 additions and 3055 deletions
+967
View File
@@ -640,6 +640,98 @@ textarea:focus {
justify-self: end;
}
/* 批量选择 */
.browse-checkbox {
display: flex;
align-items: center;
flex-shrink: 0;
cursor: default;
padding: 4px;
}
.browse-checkbox input {
width: 18px;
height: 18px;
cursor: pointer;
accent-color: var(--accent);
}
.browse-row-selected {
border-color: rgba(15, 118, 110, 0.34) !important;
background: rgba(15, 118, 110, 0.06) !important;
}
/* 批量工具栏 */
.batch-toolbar {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 14px;
margin-top: 14px;
padding: 14px 18px;
border-radius: 18px;
background: rgba(15, 118, 110, 0.06);
border: 1px solid rgba(15, 118, 110, 0.14);
}
.batch-select-all {
display: flex;
gap: 8px;
align-items: center;
cursor: pointer;
font-weight: 600;
font-size: 14px;
}
.batch-select-all input {
width: 18px;
height: 18px;
accent-color: var(--accent);
}
.batch-count {
font-size: 13px;
color: var(--muted);
font-weight: 600;
}
.batch-progress {
margin-top: 14px;
}
/* 凭据弹窗 */
.credential-overlay {
position: fixed;
inset: 0;
z-index: 1000;
display: grid;
place-items: center;
background: rgba(26, 36, 31, 0.5);
backdrop-filter: blur(4px);
}
.credential-overlay-panel {
width: min(520px, calc(100vw - 40px));
max-height: calc(100vh - 60px);
overflow-y: auto;
padding: 28px;
border-radius: 26px;
background: var(--panel);
border: 1px solid var(--line);
box-shadow: var(--shadow);
}
.credential-overlay-panel h3 {
margin: 0 0 8px;
font-size: 18px;
}
.credential-overlay-panel p {
margin: 0 0 16px;
color: var(--muted);
font-size: 14px;
}
.video-frame {
position: relative;
min-height: 320px;
@@ -737,3 +829,878 @@ video {
min-height: 220px;
}
}
/* ═══════════════════════════════════════════════════════════
资源管理器(Explorer)布局
复用 :root 变量与 .panel/.status-pill/.feedback/.summary-* 等既有类
═══════════════════════════════════════════════════════════ */
.explorer-body {
height: 100vh;
overflow: hidden;
}
.serif {
font-family: Georgia, "Times New Roman", serif;
}
.explorer-app {
height: 100vh;
display: grid;
grid-template-rows: 56px auto 1fr;
}
/* 顶栏 */
.explorer-topbar {
display: flex;
align-items: center;
gap: 16px;
padding: 0 18px;
background: var(--panel);
border-bottom: 1px solid var(--line);
}
.explorer-brand {
display: flex;
align-items: center;
gap: 10px;
font-family: Georgia, "Times New Roman", serif;
font-size: 18px;
font-weight: 600;
}
.explorer-logo {
width: 30px;
height: 30px;
display: grid;
place-items: center;
border-radius: 9px;
background: linear-gradient(135deg, var(--accent), #138579);
color: #fff;
font-size: 16px;
}
.explorer-search {
margin-left: auto;
display: flex;
align-items: center;
gap: 8px;
width: min(360px, 32vw);
padding: 6px 14px;
border-radius: 999px;
background: var(--panel-strong);
border: 1px solid var(--line);
color: var(--muted);
}
.explorer-search input {
border: none;
background: transparent;
outline: none;
width: 100%;
padding: 4px 0;
color: var(--ink);
}
.explorer-auth {
display: flex;
align-items: center;
gap: 10px;
font-size: 13px;
color: var(--muted);
}
.explorer-icon-btn {
width: 34px;
height: 34px;
display: grid;
place-items: center;
border-radius: 10px;
border: 1px solid transparent;
background: transparent;
color: var(--muted);
font-size: 15px;
}
.explorer-icon-btn:hover {
background: rgba(15, 118, 110, 0.08);
color: var(--ink);
}
.explorer-hamburger {
display: none;
}
.explorer-feedback {
margin: 0;
border-radius: 0;
}
/* 主分栏 */
.explorer-split {
display: grid;
grid-template-columns: 250px minmax(0, 1fr);
min-height: 0;
height: 100%;
}
.explorer-split.with-detail {
grid-template-columns: 250px minmax(0, 1fr) 320px;
}
/* 左侧栏 */
.explorer-sidebar {
border-right: 1px solid var(--line);
background: rgba(255, 255, 255, 0.42);
padding: 14px 12px;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 6px;
}
.explorer-side-label {
padding: 10px 10px 4px;
font-size: 11px;
letter-spacing: 0.14em;
text-transform: uppercase;
color: var(--accent-strong);
}
.explorer-tree {
display: flex;
flex-direction: column;
gap: 4px;
}
.explorer-tree-empty {
padding: 12px;
color: var(--muted);
font-size: 13px;
line-height: 1.6;
}
.explorer-tree-item {
display: flex;
align-items: center;
gap: 8px;
padding: 9px 10px;
border-radius: 12px;
color: var(--ink);
border: 1px solid transparent;
cursor: pointer;
user-select: none;
}
.explorer-tree-item:hover {
background: rgba(255, 255, 255, 0.7);
}
.explorer-tree-item.active {
background: rgba(15, 118, 110, 0.12);
border-color: rgba(15, 118, 110, 0.22);
color: var(--accent-strong);
font-weight: 600;
}
.explorer-drive-ico {
font-size: 15px;
}
.explorer-tree-name {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.explorer-dot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.explorer-dot.ready {
background: var(--success);
}
.explorer-dot.idle {
background: var(--accent);
}
.explorer-dot.error {
background: var(--danger);
}
.explorer-dot.busy {
background: var(--gold);
}
.explorer-side-divider {
height: 1px;
background: var(--line);
margin: 8px 4px;
}
.explorer-manage-link {
display: flex;
align-items: center;
gap: 9px;
padding: 8px 10px;
border-radius: 11px;
color: var(--muted);
font-size: 14px;
border: 1px solid transparent;
background: transparent;
text-align: left;
}
.explorer-manage-link:hover {
background: rgba(255, 255, 255, 0.7);
color: var(--ink);
}
/* 主内容区 */
.explorer-main {
min-width: 0;
min-height: 0;
display: grid;
grid-template-rows: auto auto 1fr auto auto;
background: rgba(255, 255, 255, 0.28);
}
.explorer-navbar {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 16px;
border-bottom: 1px solid var(--line);
}
.explorer-nav-arrows {
display: flex;
gap: 4px;
}
.explorer-crumbs {
display: flex;
align-items: center;
gap: 6px;
flex: 1;
min-width: 0;
overflow-x: auto;
scrollbar-width: none;
}
.explorer-crumbs::-webkit-scrollbar {
display: none;
}
.explorer-crumb {
padding: 6px 11px;
border-radius: 999px;
background: rgba(15, 118, 110, 0.08);
color: var(--accent-strong);
border: none;
white-space: nowrap;
font: inherit;
}
.explorer-crumb:hover {
background: rgba(15, 118, 110, 0.16);
}
.explorer-crumb-sep {
color: var(--muted);
font-size: 12px;
}
.explorer-view-toggle {
display: flex;
border: 1px solid var(--line-strong);
border-radius: 10px;
overflow: hidden;
}
.explorer-view-toggle button {
width: 38px;
height: 34px;
border: none;
background: transparent;
color: var(--muted);
}
.explorer-view-toggle button.active {
background: rgba(15, 118, 110, 0.14);
color: var(--accent-strong);
}
.explorer-sort {
display: flex;
align-items: center;
gap: 6px;
font-size: 13px;
color: var(--muted);
}
.explorer-sort select {
width: auto;
padding: 7px 10px;
border-radius: 10px;
}
/* 选择操作条 */
.explorer-action-bar {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 16px;
background: rgba(15, 118, 110, 0.06);
border-bottom: 1px solid rgba(15, 118, 110, 0.14);
}
.explorer-select-all {
display: flex;
align-items: center;
gap: 8px;
font-size: 13px;
cursor: pointer;
}
.explorer-select-all input {
width: 17px;
height: 17px;
accent-color: var(--accent);
}
.explorer-pill {
padding: 8px 15px;
font-size: 13px;
}
.explorer-spacer {
flex: 1;
}
/* 文件区 */
.explorer-file-area {
overflow: auto;
min-height: 0;
padding: 8px 12px 16px;
}
/* 列表视图(表格) */
.explorer-tbl {
width: 100%;
border-collapse: collapse;
}
.explorer-tbl thead th {
position: sticky;
top: 0;
z-index: 1;
text-align: left;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.04em;
color: var(--muted);
padding: 10px 12px;
background: var(--bg-strong);
border-bottom: 1px solid var(--line);
user-select: none;
}
.explorer-sortable:hover {
color: var(--ink);
cursor: pointer;
}
.explorer-arrow {
color: var(--accent);
font-size: 10px;
}
.explorer-col-chk {
width: 42px;
text-align: center;
}
.explorer-col-size {
width: 110px;
text-align: right;
}
.explorer-col-type {
width: 120px;
}
.explorer-col-time {
width: 175px;
}
.explorer-tbl tbody tr {
border-bottom: 1px solid rgba(26, 36, 31, 0.06);
cursor: pointer;
}
.explorer-tbl tbody tr:hover {
background: rgba(255, 255, 255, 0.72);
}
.explorer-tbl tbody tr.selected {
background: rgba(15, 118, 110, 0.08);
}
.explorer-tbl tbody tr.active {
outline: 2px solid rgba(15, 118, 110, 0.28);
outline-offset: -2px;
}
.explorer-tbl td {
padding: 8px 12px;
font-size: 14px;
vertical-align: middle;
}
.explorer-row-check {
width: 17px;
height: 17px;
accent-color: var(--accent);
}
.explorer-name-cell {
display: flex;
align-items: center;
gap: 11px;
min-width: 0;
}
.explorer-thumb {
position: relative;
width: 46px;
height: 32px;
flex-shrink: 0;
border-radius: 8px;
overflow: hidden;
display: grid;
place-items: center;
background: rgba(255, 255, 255, 0.82);
border: 1px solid rgba(26, 36, 31, 0.08);
}
.explorer-thumb.folder {
background: linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(15, 118, 110, 0.04));
}
.explorer-thumb img {
width: 100%;
height: 100%;
object-fit: cover;
}
.explorer-thumb-ico {
font-size: 17px;
}
.explorer-play {
position: absolute;
width: 18px;
height: 18px;
border-radius: 50%;
background: rgba(0, 0, 0, 0.45);
color: #fff;
display: grid;
place-items: center;
font-size: 9px;
}
.explorer-name-txt {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.explorer-badge-type {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--accent-strong);
}
/* 网格视图 */
.explorer-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 14px;
padding: 6px;
}
.explorer-card {
border-radius: 16px;
padding: 12px;
background: var(--panel);
border: 1px solid var(--line);
box-shadow: var(--shadow-soft, 0 8px 22px rgba(31, 35, 32, 0.08));
display: flex;
flex-direction: column;
gap: 9px;
position: relative;
cursor: pointer;
transition: transform 0.14s ease, border-color 0.14s ease;
}
.explorer-card:hover {
transform: translateY(-2px);
border-color: rgba(15, 118, 110, 0.26);
}
.explorer-card.selected {
border-color: rgba(15, 118, 110, 0.4);
background: rgba(15, 118, 110, 0.06);
}
.explorer-card.active {
outline: 2px solid rgba(15, 118, 110, 0.28);
}
.explorer-card-check {
position: absolute;
top: 12px;
left: 12px;
z-index: 1;
}
.explorer-cover {
position: relative;
aspect-ratio: 4 / 3;
border-radius: 11px;
overflow: hidden;
display: grid;
place-items: center;
font-size: 34px;
background: rgba(255, 255, 255, 0.72);
border: 1px solid rgba(26, 36, 31, 0.08);
}
.explorer-cover.folder {
background: linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(15, 118, 110, 0.04));
}
.explorer-cover img {
width: 100%;
height: 100%;
object-fit: cover;
}
.explorer-play-lg {
position: absolute;
width: 34px;
height: 34px;
border-radius: 50%;
background: rgba(0, 0, 0, 0.45);
color: #fff;
display: grid;
place-items: center;
}
.explorer-card-cap {
font-size: 13px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.explorer-card-sub {
font-size: 12px;
color: var(--muted);
}
/* 批量进度 */
.explorer-batch-progress {
padding: 0 16px 12px;
}
/* 状态栏 */
.explorer-statusbar {
display: flex;
align-items: center;
gap: 16px;
padding: 8px 16px;
font-size: 12px;
color: var(--muted);
border-top: 1px solid var(--line);
background: var(--panel);
}
.explorer-link-like {
color: var(--accent-strong);
background: none;
border: none;
font: inherit;
}
/* 右侧详情面板 */
.explorer-detail {
border-left: 1px solid var(--line);
background: rgba(255, 255, 255, 0.5);
overflow-y: auto;
}
.explorer-split:not(.with-detail) .explorer-detail {
display: none;
}
.explorer-detail-content {
padding: 16px;
display: flex;
flex-direction: column;
gap: 14px;
}
.explorer-detail-head {
display: flex;
align-items: center;
gap: 12px;
}
.explorer-detail-ico {
font-size: 28px;
}
.explorer-detail-ico-lg {
font-size: 44px;
}
.explorer-detail-title {
font-size: 16px;
font-weight: 600;
word-break: break-word;
}
.explorer-preview-frame {
border-radius: 14px;
overflow: hidden;
background: linear-gradient(160deg, rgba(17, 24, 39, 0.92), rgba(38, 48, 62, 0.95));
display: grid;
place-items: center;
min-height: 180px;
}
.explorer-preview-frame video {
width: 100%;
display: block;
min-height: 180px;
background: transparent;
}
.explorer-preview-static {
aspect-ratio: 16 / 10;
color: #fff;
}
.explorer-preview-static img {
width: 100%;
height: 100%;
object-fit: cover;
}
.explorer-detail-status {
font-size: 13px;
color: var(--muted);
padding: 10px 12px;
border-radius: 12px;
background: var(--panel-strong);
word-break: break-word;
}
.explorer-detail-actions {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
/* 右键菜单 */
.explorer-context-menu {
position: fixed;
z-index: 50;
min-width: 180px;
padding: 6px;
border-radius: 14px;
background: var(--panel);
border: 1px solid var(--line);
box-shadow: var(--shadow);
}
.explorer-context-menu[hidden] {
display: none;
}
.explorer-context-menu button {
width: 100%;
text-align: left;
display: flex;
align-items: center;
gap: 10px;
padding: 9px 11px;
border: none;
background: transparent;
border-radius: 9px;
font: inherit;
color: var(--ink);
}
.explorer-context-menu button:hover {
background: rgba(15, 118, 110, 0.1);
}
.explorer-context-menu .danger {
color: var(--danger);
}
.explorer-context-menu hr {
border: none;
border-top: 1px solid var(--line);
margin: 4px 2px;
}
/* 对话框 */
.explorer-overlay {
position: fixed;
inset: 0;
z-index: 100;
background: rgba(26, 36, 31, 0.5);
backdrop-filter: blur(4px);
display: grid;
place-items: center;
}
.explorer-overlay[hidden] {
display: none;
}
.explorer-dialog {
width: min(560px, calc(100vw - 40px));
max-height: calc(100vh - 60px);
overflow-y: auto;
border-radius: 22px;
background: var(--panel);
border: 1px solid var(--line);
box-shadow: var(--shadow);
padding: 24px;
}
.explorer-dialog-wide {
width: min(760px, calc(100vw - 40px));
}
.explorer-dialog-head {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 16px;
}
.explorer-dialog-head h3 {
font-size: 22px;
}
.explorer-manage-content {
display: grid;
gap: 16px;
}
/* 移动端遮罩 */
.explorer-backdrop {
display: none;
}
/* ── 响应式:平板 ── */
@media (max-width: 1080px) {
.explorer-split,
.explorer-split.with-detail {
grid-template-columns: 220px minmax(0, 1fr);
}
/* 详情面板改为从右滑入的覆盖式抽屉 */
.explorer-split.with-detail .explorer-detail {
position: fixed;
top: 56px;
right: 0;
bottom: 0;
width: min(360px, 90vw);
z-index: 40;
box-shadow: var(--shadow);
display: block;
}
/* 隐藏类型列,节省空间 */
.explorer-col-type {
display: none;
}
}
/* ── 响应式:手机 ── */
@media (max-width: 760px) {
.explorer-hamburger {
display: grid;
}
.explorer-brand span:last-child {
display: none;
}
.explorer-split,
.explorer-split.with-detail {
grid-template-columns: minmax(0, 1fr);
}
/* 侧栏改为离屏抽屉 */
.explorer-sidebar {
position: fixed;
top: 56px;
left: 0;
bottom: 0;
width: min(260px, 82vw);
z-index: 45;
transform: translateX(-100%);
transition: transform 0.2s ease;
}
.explorer-sidebar.open {
transform: translateX(0);
box-shadow: var(--shadow);
}
.explorer-backdrop {
display: block;
position: fixed;
inset: 56px 0 0 0;
z-index: 44;
background: rgba(26, 36, 31, 0.4);
}
.explorer-backdrop[hidden] {
display: none;
}
/* 详情/播放器全屏覆盖 */
.explorer-split.with-detail .explorer-detail {
width: 100vw;
top: 56px;
}
.explorer-search {
width: auto;
flex: 1;
}
.explorer-grid {
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.explorer-col-size {
display: none;
}
.explorer-action-bar {
flex-wrap: wrap;
}
}