A music player that connects to your cloud/distributed storage.
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(theme/winamp): ability to toggle between elapsed and remaining time

+10 -4
+10 -4
src/facets/themes/winamp/winamp/element.js
··· 256 256 #balance = signal(0); 257 257 #stopped = signal(false); 258 258 #seekingProgress = signal(/** @type {number | null} */ (null)); 259 + #timeCountdown = signal(false); 259 260 #focusedWindow = signal( 260 261 /** @type {"main" | "eq" | "playlist" | "milkdrop"} */ ("main"), 261 262 ); ··· 1556 1557 ); 1557 1558 }; 1558 1559 1560 + #toggleTimeCountdown = () => { 1561 + this.#timeCountdown.value = !this.#timeCountdown.value; 1562 + }; 1563 + 1559 1564 #toggleMainShade = () => { 1560 1565 this.#mainShade.value = !this.#mainShade.value; 1561 1566 const ui = loadUiState(); ··· 1755 1760 : []; 1756 1761 1757 1762 const seekPct = this.#seekingProgress.value; 1758 - const timeSeconds = seekPct !== null 1759 - ? seekPct * (audio?.duration() ?? 0) 1760 - : audio?.currentTime() ?? 0; 1763 + const duration = audio?.duration() ?? 0; 1764 + const elapsed = seekPct !== null ? seekPct * duration : audio?.currentTime() ?? 0; 1765 + const isCountdown = this.#timeCountdown.value; 1766 + const timeSeconds = isCountdown ? Math.max(0, duration - elapsed) : elapsed; 1761 1767 const timeMinutes = Math.floor(timeSeconds / 60); 1762 1768 const timeSecs = Math.floor(timeSeconds % 60); 1763 1769 const miniTimeStr = `${String(timeMinutes).padStart(2, "0")}:${ ··· 1980 1986 </div> 1981 1987 <div id="play-pause"></div> 1982 1988 <div id="work-indicator"></div> 1983 - <div id="time"> 1989 + <div id="time" class="${isCountdown ? "countdown" : ""}" @click="${this.#toggleTimeCountdown}" style="cursor: pointer;"> 1984 1990 <div id="minus-sign"></div> 1985 1991 <div id="minute-first-digit" class="digit digit-${d 1986 1992 .mFirst}"></div>