Skip to content

Commit 72e6db1

Browse files
author
Taois
committed
feat: 播放器布局优化
1 parent e2173d0 commit 72e6db1

2 files changed

Lines changed: 120 additions & 28 deletions

File tree

dashboard/src/components/players/ArtVideoPlayer.vue

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ const initArtPlayer = async (url) => {
837837
controls: [
838838
{
839839
position: 'right',
840-
html: hasNextEpisode() ? '下一集' : '',
840+
html: hasNextEpisode() ? '<span class="player-control-label" data-mobile="下">下一集</span>' : '',
841841
tooltip: hasNextEpisode() ? '播放下一集' : '',
842842
style: hasNextEpisode() ? {} : { display: 'none' },
843843
click: function () {
@@ -846,15 +846,15 @@ const initArtPlayer = async (url) => {
846846
},
847847
{
848848
position: 'right',
849-
html: availableQualities.value.length > 1 ? `画质: ${getCurrentQualityLabel.value}` : '',
849+
html: availableQualities.value.length > 1 ? `<span class="player-control-label" data-mobile="质">画质: ${getCurrentQualityLabel.value}</span>` : '',
850850
style: availableQualities.value.length > 1 ? {} : { display: 'none' },
851851
click: function () {
852852
toggleQualityLayer()
853853
},
854854
},
855855
{
856856
position: 'right',
857-
html: props.episodes.length > 1 ? '选集' : '',
857+
html: props.episodes.length > 1 ? '<span class="player-control-label" data-mobile="集">选集</span>' : '',
858858
tooltip: props.episodes.length > 1 ? '选择集数' : '',
859859
style: props.episodes.length > 1 ? {} : { display: 'none' },
860860
click: function () {
@@ -863,7 +863,7 @@ const initArtPlayer = async (url) => {
863863
},
864864
{
865865
position: 'right',
866-
html: '关闭',
866+
html: '<span class="player-control-label" data-mobile="关">关闭</span>',
867867
tooltip: '关闭播放器',
868868
click: function () {
869869
closePlayer()
@@ -1163,7 +1163,7 @@ const updateQualityControlText = () => {
11631163
for (let i = 0; i < buttons.length; i++) {
11641164
const button = buttons[i]
11651165
if (button.innerHTML.includes('画质')) {
1166-
const newText = `画质: ${getCurrentQualityLabel.value}`
1166+
const newText = `<span class="player-control-label" data-mobile="质">画质: ${getCurrentQualityLabel.value}</span>`
11671167
button.innerHTML = newText
11681168
console.log('更新控制栏画质文本:', newText)
11691169
return
@@ -2140,6 +2140,52 @@ onUnmounted(() => {
21402140
color: #23ade5;
21412141
}
21422142
2143+
:deep(.player-control-label) {
2144+
display: inline-flex;
2145+
align-items: center;
2146+
max-width: 96px;
2147+
overflow: hidden;
2148+
text-overflow: ellipsis;
2149+
white-space: nowrap;
2150+
}
2151+
2152+
@media (max-width: 768px) {
2153+
:deep(.art-bottom) {
2154+
padding: 0 4px;
2155+
}
2156+
2157+
:deep(.art-controls),
2158+
:deep(.art-controls-left),
2159+
:deep(.art-controls-right) {
2160+
min-width: 0;
2161+
}
2162+
2163+
:deep(.art-controls-right) {
2164+
flex: 0 1 auto;
2165+
overflow: hidden;
2166+
}
2167+
2168+
:deep(.art-controls-right .art-control) {
2169+
flex: 0 0 34px;
2170+
width: 34px;
2171+
min-width: 34px;
2172+
padding: 0 4px;
2173+
font-size: 12px;
2174+
}
2175+
2176+
:deep(.art-controls-right .art-control .player-control-label) {
2177+
width: 22px;
2178+
justify-content: center;
2179+
font-size: 0;
2180+
}
2181+
2182+
:deep(.art-controls-right .art-control .player-control-label::before) {
2183+
content: attr(data-mobile);
2184+
font-size: 12px;
2185+
font-weight: 600;
2186+
}
2187+
}
2188+
21432189
/* ArtPlayer selector 弹层位置调整 */
21442190
:deep(.art-selector) {
21452191
bottom: 45px !important; /* 向上调整弹层位置,避免被遮挡 */

dashboard/src/components/players/PlayerHeader.vue

Lines changed: 69 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
:title="`${parser.name} (${parser.type === '1' ? 'JSON' : '嗅探'})`"
8787
:disabled="parser.type === '0' && !snifferEnabled"
8888
>
89-
解析:{{ parser.name }}
89+
解析 · {{ parser.name }}
9090
<span v-if="parser.type === '0' && !snifferEnabled" style="color: #ff4d4f; font-size: 10px;">
9191
(需嗅探器)
9292
</span>
@@ -110,14 +110,14 @@
110110
class="compact-select"
111111
size="small"
112112
>
113-
<a-option value="disabled" title="关闭代理播放功能">代理播放:关闭</a-option>
113+
<a-option value="disabled" title="关闭代理播放功能">代理 · 关闭</a-option>
114114
<a-option
115115
v-for="option in proxyOptions"
116116
:key="option.value"
117117
:value="option.value"
118118
:title="`${option.label}\n完整链接: ${option.url || option.value}`"
119119
>
120-
代理播放:{{ option.label }}
120+
代理 · {{ option.label }}
121121
</a-option>
122122
</a-select>
123123
</div>
@@ -145,7 +145,7 @@
145145
:value="quality.name"
146146
:title="`切换到${quality.name}画质`"
147147
>
148-
画质:{{ quality.name }}
148+
画质 · {{ quality.name }}
149149
</a-option>
150150
</a-select>
151151
</div>
@@ -690,49 +690,95 @@ onUnmounted(() => {
690690
@media (max-width: 768px) {
691691
.player-header {
692692
flex-direction: column;
693-
align-items: flex-start;
693+
align-items: stretch;
694694
gap: 8px;
695+
padding: 8px 2px;
696+
margin-bottom: 6px;
695697
}
696-
698+
697699
.player-header h3 {
700+
width: 100%;
698701
margin-right: 0;
699-
font-size: 15px;
702+
font-size: 14px;
703+
line-height: 1.4;
700704
}
701-
705+
706+
.player-controls {
707+
width: 100%;
708+
min-width: 0;
709+
}
710+
702711
.compact-button-group {
703-
flex-wrap: wrap;
704712
width: 100%;
705-
justify-content: center;
713+
justify-content: flex-start;
714+
gap: 6px;
715+
overflow-x: auto;
716+
overflow-y: hidden;
717+
padding: 4px;
718+
border-radius: 10px;
719+
scroll-snap-type: x proximity;
720+
scrollbar-width: none;
706721
}
707-
722+
723+
.compact-button-group::-webkit-scrollbar {
724+
display: none;
725+
}
726+
708727
.compact-btn {
709-
flex: 1;
710-
min-width: 80px;
728+
flex: 0 0 auto;
729+
min-width: 42px;
730+
min-height: 32px;
711731
justify-content: center;
732+
border-radius: 8px;
733+
scroll-snap-align: start;
712734
}
713-
735+
714736
.btn-text {
715737
display: none;
716738
}
717-
739+
718740
.selector-btn {
719-
flex: 2;
741+
flex: 0 0 auto;
742+
min-width: 136px;
720743
}
721-
744+
722745
.compact-select {
723-
min-width: 100px;
746+
width: 136px;
747+
min-width: 136px;
748+
}
749+
750+
.compact-select :deep(.arco-select-view) {
751+
height: 32px;
752+
padding: 0 8px;
753+
border-radius: 8px;
754+
}
755+
756+
.compact-select :deep(.arco-select-view-value) {
757+
overflow: hidden;
758+
text-overflow: ellipsis;
759+
white-space: nowrap;
724760
}
725761
}
726762
727763
@media (max-width: 480px) {
764+
.compact-button-group {
765+
margin: 0 -2px;
766+
}
767+
728768
.compact-btn {
729-
padding: 4px 6px;
730-
min-height: 26px;
769+
padding: 4px 8px;
770+
min-height: 32px;
731771
}
732-
772+
733773
.btn-icon {
734-
width: 12px;
735-
height: 12px;
774+
width: 14px;
775+
height: 14px;
776+
}
777+
778+
.selector-btn,
779+
.compact-select {
780+
min-width: 142px;
781+
width: 142px;
736782
}
737783
}
738784
</style>

0 commit comments

Comments
 (0)