Musik: waehrend ein Titel laedt (Start, Spulen, Wechsel) bleibt er im Player stehen - "Laedt ..." mit Lauflicht im Fortschrittsbalken statt "Gerade laeuft nichts"
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
c55768290d
commit
c86c4620a2
2 changed files with 7 additions and 4 deletions
|
|
@ -10233,6 +10233,8 @@ a.hunt-review-spot-thumb { width: 64px; height: 40px; flex-shrink: 0; }
|
||||||
.music-now-link { font-size: 0.82rem; }
|
.music-now-link { font-size: 0.82rem; }
|
||||||
.music-progress { position: relative; height: 5px; margin-top: 0.7rem; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; transition: height 0.15s; }
|
.music-progress { position: relative; height: 5px; margin-top: 0.7rem; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; transition: height 0.15s; }
|
||||||
.music-progress i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3px; background: linear-gradient(90deg, #a07d1c, var(--gold)); transition: width 0.5s linear; }
|
.music-progress i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3px; background: linear-gradient(90deg, #a07d1c, var(--gold)); transition: width 0.5s linear; }
|
||||||
|
.music-progress.is-loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(227, 189, 110, 0.55), transparent); animation: music-loading 1.1s ease-in-out infinite; }
|
||||||
|
@keyframes music-loading { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
|
||||||
.music-progress.is-seekable { cursor: pointer; }
|
.music-progress.is-seekable { cursor: pointer; }
|
||||||
.music-progress.is-seekable:hover { height: 8px; }
|
.music-progress.is-seekable:hover { height: 8px; }
|
||||||
.music-times { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: 0.3rem; color: var(--text-muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
|
.music-times { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: 0.3rem; color: var(--text-muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@
|
||||||
|
|
||||||
var tick = function () {
|
var tick = function () {
|
||||||
if (!state || !state.current) return;
|
if (!state || !state.current) return;
|
||||||
var elapsed = state.current.elapsed + (state.paused ? 0 : (Date.now() - stateAt) / 1000);
|
var elapsed = state.current.elapsed + (state.paused || state.current.loading ? 0 : (Date.now() - stateAt) / 1000);
|
||||||
var duration = state.current.duration || 0;
|
var duration = state.current.duration || 0;
|
||||||
if (duration) elapsed = Math.min(elapsed, duration);
|
if (duration) elapsed = Math.min(elapsed, duration);
|
||||||
$('[data-music-elapsed]').textContent = fmt(elapsed);
|
$('[data-music-elapsed]').textContent = fmt(elapsed);
|
||||||
|
|
@ -245,12 +245,12 @@
|
||||||
connection.textContent = (bots.length > 1 ? bot.charAt(0).toUpperCase() + bot.slice(1) + ' · ' : '')
|
connection.textContent = (bots.length > 1 ? bot.charAt(0).toUpperCase() + bot.slice(1) + ' · ' : '')
|
||||||
+ (music.connected ? 'Im Sprachkanal ' + music.channel.name : 'Nicht im Sprachkanal');
|
+ (music.connected ? 'Im Sprachkanal ' + music.channel.name : 'Nicht im Sprachkanal');
|
||||||
connection.className = 'music-connection' + (music.connected ? ' is-online' : '');
|
connection.className = 'music-connection' + (music.connected ? ' is-online' : '');
|
||||||
root.classList.toggle('is-playing', !!(music.current && !music.paused));
|
root.classList.toggle('is-playing', !!(music.current && !music.paused && !music.current.loading));
|
||||||
root.classList.toggle('is-paused', !!music.paused);
|
root.classList.toggle('is-paused', !!music.paused);
|
||||||
|
|
||||||
var current = music.current;
|
var current = music.current;
|
||||||
$('[data-music-status]').textContent = current
|
$('[data-music-status]').textContent = current
|
||||||
? (music.paused ? 'Pausiert' : 'Läuft gerade') + ' · ' + (SOURCE_NAMES[current.source] || '')
|
? (current.loading ? 'Lädt …' : music.paused ? 'Pausiert' : 'Läuft gerade') + ' · ' + (SOURCE_NAMES[current.source] || '')
|
||||||
: 'Gerade läuft nichts';
|
: 'Gerade läuft nichts';
|
||||||
$('[data-music-title]').textContent = current ? current.title : (music.connected ? 'Such dir unten etwas aus' : 'Hol den Bot in einen Sprachkanal');
|
$('[data-music-title]').textContent = current ? current.title : (music.connected ? 'Such dir unten etwas aus' : 'Hol den Bot in einen Sprachkanal');
|
||||||
var by = $('[data-music-by]');
|
var by = $('[data-music-by]');
|
||||||
|
|
@ -266,7 +266,8 @@
|
||||||
}
|
}
|
||||||
cover.hidden = !coverUrl;
|
cover.hidden = !coverUrl;
|
||||||
$('[data-music-duration]').textContent = current ? fmt(current.duration) : '0:00';
|
$('[data-music-duration]').textContent = current ? fmt(current.duration) : '0:00';
|
||||||
$('[data-music-progress]').classList.toggle('is-seekable', !!(current && current.duration));
|
$('[data-music-progress]').classList.toggle('is-seekable', !!(current && current.duration && !current.loading));
|
||||||
|
$('[data-music-progress]').classList.toggle('is-loading', !!(current && current.loading));
|
||||||
if (!current) {
|
if (!current) {
|
||||||
$('[data-music-elapsed]').textContent = '0:00';
|
$('[data-music-elapsed]').textContent = '0:00';
|
||||||
$('[data-music-bar]').style.width = '0%';
|
$('[data-music-bar]').style.width = '0%';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue