Fill the phone screen in service mode and open it on the playing song
This commit is contained in:
@@ -2246,7 +2246,18 @@ function updateServiceMode() {
|
||||
|
||||
function enterServiceMode(pl) {
|
||||
if (pl && pl.videos && pl.videos.length) {
|
||||
playFromList(pl.videos, 0, 'playlist:' + pl.id);
|
||||
const source = 'playlist:' + pl.id;
|
||||
const playingId = (current && current.meta) ? current.meta.id : null;
|
||||
if (queueSource === source && playingId) {
|
||||
// Already running this set — service mode is only a view, so keep the
|
||||
// live queue, its position, shuffle order and playback exactly as they
|
||||
// are instead of jumping back to the first song.
|
||||
} else {
|
||||
// Not on this set: open on the playing song if it happens to be in the
|
||||
// playlist, otherwise start from the top.
|
||||
const idx = playingId ? pl.videos.findIndex((v) => v && v.id === playingId) : -1;
|
||||
playFromList(pl.videos, idx >= 0 ? idx : 0, source);
|
||||
}
|
||||
}
|
||||
const el = $('serviceMode');
|
||||
if (el) el.classList.remove('hidden');
|
||||
|
||||
@@ -2769,6 +2769,55 @@ input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.25); }
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
/* Phones — the flat 28px gutters left a narrow centred column on a 390px
|
||||
screen, so service mode never looked full-bleed in the iOS PWA. Pull the
|
||||
gutters in to the safe-area edge and scale type/controls off the viewport
|
||||
width so the set list actually uses the screen. */
|
||||
@media (max-width: 640px) {
|
||||
.service-mode {
|
||||
padding: calc(env(safe-area-inset-top, 0px) + 14px)
|
||||
calc(env(safe-area-inset-right, 0px) + 14px)
|
||||
calc(env(safe-area-inset-bottom, 0px) + 18px)
|
||||
calc(env(safe-area-inset-left, 0px) + 14px);
|
||||
}
|
||||
.service-center {
|
||||
padding: 16px 0;
|
||||
}
|
||||
.service-title {
|
||||
font-size: clamp(30px, 8.5vw, 44px);
|
||||
}
|
||||
.service-channel {
|
||||
font-size: clamp(15px, 4.4vw, 20px);
|
||||
}
|
||||
.service-upnext {
|
||||
margin-top: 18px;
|
||||
font-size: clamp(14px, 4vw, 18px);
|
||||
}
|
||||
.service-note {
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
padding: 12px 14px;
|
||||
}
|
||||
.service-time {
|
||||
font-size: clamp(16px, 4.6vw, 22px);
|
||||
}
|
||||
.service-controls {
|
||||
width: 100%;
|
||||
justify-content: space-evenly;
|
||||
gap: 0;
|
||||
}
|
||||
.service-btn {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
font-size: 24px;
|
||||
}
|
||||
.service-btn-play {
|
||||
width: 84px;
|
||||
height: 84px;
|
||||
font-size: 34px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 520px) {
|
||||
.service-mode {
|
||||
padding: 12px 20px;
|
||||
|
||||
Reference in New Issue
Block a user