-
-
tag
-
Название
-
Длительность
+
-
- {createPortal(
-
-
- {item.data.ImageTags?.Primary ? (
-

- ) : (
-
- {getTypeIcon("Playlist")}
-
- )}
+
+
Плейлист
+
{item.data.Name}
+
+ {tracksLabel(trackCount)}
+
+
+ {getRuntimeCompact(item.data.CumulativeRunTimeTicks ?? 0)}
+
-
- {item.data.GenreItems?.map((genre) => (
-
- ))}
-
-
-
,
- document.body,
+
+
+
+
+
+ #
+ Название
+ Время
+
+
+ {musicTracks.data?.Items?.map((track, index) => (
+
+ ))}
+ {trackCount === 0 && (
+ В плейлисте пока нет треков
+ )}
+
+
+ {(genres.length > 0 || item.data.Overview) && (
+
+ О плейлисте
+ {genres.length > 0 && (
+
+ {genres.map((genre) => (
+
+ ))}
+
+ )}
+ {item.data.Overview && (
+
+ )}
+
)}
+
{(similarItems.data?.TotalRecordCount ?? 0) > 0 && (
-
- {similarItems.data?.Items?.map((similar) => {
- return (
+
+
+ {similarItems.data?.Items?.map((similar) => (
- );
- })}
-
+ ))}
+
+
)}
);
}
- if (item.isError || similarItems.isError) {
- return
;
- }
}
export default PlaylistTitlePage;
diff --git a/src/routes/_api/music/playlist/playlist.scss b/src/routes/_api/music/playlist/playlist.scss
deleted file mode 100644
index c130393..0000000
--- a/src/routes/_api/music/playlist/playlist.scss
+++ /dev/null
@@ -1,141 +0,0 @@
-$border-radius: 20px;
-.item-playlist {
- width: 70vw;
- padding-right: 2.2em;
- .item-info {
- display: flex;
- flex-direction: column;
- gap: 1.2em;
- &-container {
- grid-template-columns: 1fr 25%;
- display: grid;
- gap: 3em;
- }
- &-playlist-info {
- gap: 1.2em;
- }
- &-buttons {
- display: flex;
- gap: 1em;
- }
- &-disc-header {
- padding: 1em 2em;
- background: hsla(0, 0, 100%, 10%);
- border-radius: 100px;
- gap: 1em;
- margin-top: 1em;
- }
- }
-}
-.item-info-sidebar {
- display: flex;
- flex-direction: column;
- gap: 1em;
- position: fixed;
- // max-height: 100vh;
- top: 0;
- right: 0;
- width: 30vw;
- padding: 4.4em;
- padding-left: 2.2em;
- &-image {
- width: 100%;
- object-fit: cover;
- border-radius: $border-radius-default;
- }
- &-artist {
- display: flex;
- gap: 1em;
- align-items: center;
- padding: 1em 0;
- color: rgb(255 255 255 / 0.7);
- transition: $transition-time-default;
- cursor: pointer;
- text-decoration: none;
- &:hover {
- color: rgb(255 255 255)
- }
- &-image {
- width: 100%;
- height: 100%;
- object-fit: cover;
- z-index: 1;
- position: relative;
- &-container {
- width: 3em;
- aspect-ratio: 1;
- border-radius: 100%;
- overflow: hidden;
- position: relative;
- .material-symbols-rounded {
- position: absolute;
- top: 0;
- right: 0;
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- background: rgb(255 255 255 / 0.1);
- z-index: 0;
- }
- }
- }
- &-container {
- // max-height: 20em;/
- overflow-y: auto;
- overflow-x: hidden;
- }
- }
- &-overview {
- overflow-y: auto;
- max-height: 28vh;
- padding-bottom: 2px;
- }
-}
-.item-detail- {
- &-track {
- display: grid;
- grid-template-columns: 4% 1fr 80% 1fr;
- align-items: center;
- justify-items: center;
- gap: 0.5em;
- width: 100%;
- padding: 0.25em 0;
- background: rgb(0 0 0 / 0.4);
- transition: background $transition-time-default;
- backdrop-filter: blur(5px);
- &:first-child {
- border-radius: $border-radius $border-radius 8px 8px;
- cursor: default !important;
- }
- &:last-child {
- border-radius: 8px 8px $border-radius $border-radius;
- }
- border-radius: 8px;
- &s {
- background: transparent !important;
- box-shadow: none !important;
- display: flex;
- flex-direction: column;
- gap: 5px;
- }
- &:hover {
- background: rgb(0 0 0 / 0.5);
- cursor: pointer;
- }
- &.playing {
- color: $clr-accent-default;
- }
- }
-}
-
-@media (max-width: 1320px) {
- .item-playlist .item-detail {
- &-cast {
- &-grid {
- grid-template-columns: 1fr;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/routes/_api/player/audio.scss b/src/routes/_api/player/audio.scss
index ed649ac..3270b13 100644
--- a/src/routes/_api/player/audio.scss
+++ b/src/routes/_api/player/audio.scss
@@ -1,317 +1,632 @@
-.audio {
- &-background {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: -1;
- overflow: hidden;
-
- &::after {
- content: "";
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- // No live backdrop-filter here: blurring a full-screen layer over a
- // repainting page made the whole player shimmer.
- background: rgba(0, 0, 0, 0.55);
- }
-
- &-image {
- width: 100%;
- height: 100%;
- object-fit: cover;
- // Blur the image itself instead of the layer behind the page.
- filter: blur(70px) brightness(0.55) saturate(1.2);
- transform: scale(1.2); // Hide blurred edges
- }
- }
-
- &-container {
- // Art size drives the whole left column so everything fits the viewport.
- --np-size: min(420px, 44vh, 80vw);
+/**
+ * Full-screen player, media-player style:
+ * a wall coloured by the sleeve, the cover large in the middle, only the
+ * transport at the bottom, and the play queue sliding in from the right.
+ */
+.music-player {
+ position: fixed;
+ inset: 0;
+ overflow: hidden;
+ color: #fff;
+ background:
+ radial-gradient(
+ 90% 70% at 50% -10%,
+ rgb(255 255 255 / 0.1),
+ transparent 60%
+ ),
+ linear-gradient(180deg, var(--mp-base, #2a1f3d), var(--mp-deep, #120b1c));
- display: grid;
- grid-template-columns: var(--np-size) minmax(0, 560px);
- justify-content: center;
- align-items: center;
- gap: clamp(2rem, 6vw, 6rem);
- height: 100vh;
- width: 100%;
- padding: 5rem 3rem 2.5rem;
- box-sizing: border-box;
- position: relative;
- z-index: 1;
- color: white;
- overflow: hidden;
+ &-chrome {
+ position: absolute;
+ inset: 0 0 auto;
+ z-index: 6;
+ display: flex;
+ align-items: center;
+ min-height: 46px;
+ padding: 4px 8px;
- @media (max-width: 900px) {
- grid-template-columns: minmax(0, var(--np-size));
- grid-template-rows: auto minmax(0, 1fr);
- align-items: start;
- padding: 4.5rem 1rem 1rem;
- gap: 1.5rem;
- overflow-y: auto;
- }
- }
+ &-end {
+ margin-left: auto;
+ }
+ }
- &-now-playing {
- display: flex;
- flex-direction: column;
- gap: 1.25rem;
- width: var(--np-size);
- min-width: 0;
+ &-collapse {
+ position: absolute;
+ top: 58px;
+ right: 22px;
+ z-index: 6;
+ display: grid;
+ place-items: center;
+ width: 44px;
+ height: 44px;
+ padding: 0;
+ border: 0;
+ border-radius: 50%;
+ background: rgb(0 0 0 / 0.18);
+ color: rgb(255 255 255 / 0.85);
+ cursor: pointer;
+ transition: background-color 0.15s ease, transform 0.15s ease,
+ opacity 0.15s ease;
- &-art {
- width: 100%;
- aspect-ratio: 1;
- border-radius: 1.25rem;
- overflow: hidden;
- box-shadow: 0 24px 60px rgb(0 0 0 / 0.55);
- background: rgb(255 255 255 / 0.08);
- display: flex;
- align-items: center;
- justify-content: center;
+ .material-symbols-rounded {
+ font-size: 1.5rem;
+ }
- img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- display: block;
- }
- .material-symbols-rounded {
- font-size: 6rem;
- opacity: 0.6;
- }
- }
+ &:hover {
+ background: rgb(0 0 0 / 0.3);
+ transform: translateY(1px);
+ }
+ }
- &-meta {
- display: flex;
- align-items: center;
- gap: 0.75rem;
- }
+ // The queue panel has its own close button in the same corner.
+ &.has-panel &-collapse {
+ opacity: 0;
+ pointer-events: none;
+ }
- &-text {
- flex: 1;
- min-width: 0;
- }
+ &-stage {
+ position: absolute;
+ inset: 46px 0 96px;
+ z-index: 2;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 0 clamp(1.25rem, 3vw, 3rem);
+ box-sizing: border-box;
+ }
- &-subtitle {
- opacity: 0.7;
+ &-row {
+ display: flex;
+ align-items: flex-start;
+ justify-content: center;
+ gap: clamp(2rem, 4vw, 4rem);
+ width: 100%;
+ max-width: 1680px;
+ }
- a {
- color: inherit;
- text-decoration: none;
- &:hover {
- text-decoration: underline;
- opacity: 1;
- }
- }
- }
+ &-main {
+ position: relative;
+ z-index: 2;
+ display: flex;
+ flex: 0 0 auto;
+ flex-direction: column;
+ align-items: center;
+ min-width: 0;
+ transition: transform 0.32s cubic-bezier(0.2, 0, 0, 1);
+ }
- &-transport {
- display: flex;
- align-items: center;
- justify-content: space-between;
+ // The sleeve slides left as one piece: no resizing, no vertical shift.
+ &.has-panel &-main {
+ transform: translateX(calc(1vw - 255px));
+ }
- // Spread prev / play / next evenly with shuffle and repeat
- .player-controls {
- display: contents !important;
- }
+ &-art {
+ width: clamp(200px, min(48vh, 34vw), 430px);
+ aspect-ratio: 1;
+ overflow: hidden;
+ border-radius: 6px;
+ background: rgb(0 0 0 / 0.25);
+ box-shadow: 0 30px 80px rgb(0 0 0 / 0.45);
+ display: grid;
+ place-items: center;
- // Toggle-style buttons read as "off" until enabled
- > .MuiIconButton-root,
- > span > .MuiIconButton-root {
- color: rgb(255 255 255 / 0.55);
- }
- > .MuiIconButton-root.is-active {
- color: $clr-accent-default;
- }
- }
+ img {
+ display: block;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ }
- &-utility {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 1rem;
- }
+ > .material-symbols-rounded {
+ font-size: 5rem;
+ color: rgb(255 255 255 / 0.4);
+ }
+ }
- &-volume {
- display: flex;
- align-items: center;
- flex: 1;
- max-width: 14rem;
- opacity: 0.85;
+ &-meta {
+ width: min(560px, 100%);
+ margin-top: clamp(1.2rem, 3vh, 2rem);
+ text-align: center;
+ }
- // Secondary control: neutral instead of the accent colour
- .MuiSlider-root {
- color: rgb(255 255 255 / 0.85);
- }
- }
- }
+ &-title {
+ margin: 0;
+ font-size: clamp(1.25rem, 2.2vw, 1.7rem);
+ font-weight: 600;
+ letter-spacing: -0.01em;
+ line-height: 1.2;
+ overflow-wrap: anywhere;
+ }
- &-side {
- display: flex;
- flex-direction: column;
- gap: 1.5rem;
- height: min(80vh, 760px);
- min-height: 0;
+ &-subtitle {
+ margin-top: 0.35em;
+ font-size: 0.95rem;
+ color: rgb(255 255 255 / 0.65);
- @media (max-width: 900px) {
- height: 70vh;
- }
+ a {
+ color: inherit;
+ text-decoration: none;
- &-lyrics {
- flex: 1;
- min-height: 0;
- overflow-y: auto;
- overflow-x: hidden;
- scrollbar-width: none;
- // Fade lines in and out at the edges
- mask-image: linear-gradient(transparent, black 15%, black 85%, transparent);
+ &:hover {
+ color: #fff;
+ text-decoration: underline;
+ }
+ }
+ }
- &::-webkit-scrollbar {
- display: none;
- }
- }
+ &-seek {
+ width: min(420px, 100%);
+ margin: 1.1rem auto 0;
- // "Up next" sits on a quiet card; no blur so the artwork backdrop stays clean
- &-queue {
- flex: 1;
- min-height: 0;
- // The queue view scrolls its own list so the header stays put
- display: flex;
- flex-direction: column;
- overflow: hidden;
- padding: 1rem 1.25rem 0;
+ .MuiSlider-root {
+ padding: 8px 0;
+ color: rgb(255 255 255 / 0.92);
+ }
- .queue {
- flex: 1;
- min-height: 0;
- }
- background: rgb(0 0 0 / 0.22);
- border: 1px solid rgb(255 255 255 / 0.06);
- border-radius: 1.25rem;
+ .MuiSlider-rail {
+ background: rgb(255 255 255 / 0.25);
+ opacity: 1;
+ }
- &::-webkit-scrollbar {
- width: 6px;
- }
- &::-webkit-scrollbar-thumb {
- background: rgba(255, 255, 255, 0.2);
- border-radius: 3px;
- }
- }
+ .MuiSlider-thumb {
+ width: 10px;
+ height: 10px;
+ background: #fff;
+ box-shadow: none;
+ }
+ }
- &.has-lyrics .audio-side-queue {
- flex: 0 1 auto;
- max-height: 40%;
- }
- }
+ &-controls {
+ position: absolute;
+ inset: auto 0 0;
+ z-index: 4;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 16px;
+ height: 96px;
+ padding: 0 clamp(1.25rem, 3vw, 3rem);
+ box-sizing: border-box;
- &-lyrics {
- width: 100%;
+ .MuiIconButton-root {
+ color: rgb(255 255 255 / 0.72);
- &-container {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- // Room above and below so the active line can scroll to the middle
- padding: 35% 0.5rem;
- }
+ &:hover {
+ color: #fff;
+ background: rgb(255 255 255 / 0.1);
+ }
- &-status {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 100%;
- min-height: 200px;
- opacity: 0.7;
- }
+ &.is-active {
+ color: #fff;
+ }
+ }
+ }
- &-line {
- margin: 0 0 0.6rem !important;
- padding: 0.35rem 0.75rem;
- border-radius: 0.75rem;
- font-size: clamp(1.25rem, 2vw, 1.85rem) !important;
- line-height: 1.35 !important;
- font-weight: 700 !important;
- text-align: left;
- opacity: 0.35;
- transition: opacity 0.35s ease, filter 0.35s ease;
- filter: blur(0.4px);
+ &-controls-side {
+ display: flex;
+ flex: 0 0 220px;
+ align-items: center;
+ gap: 0.15rem;
- &[data-active-lyric="true"] {
- opacity: 1;
- filter: none;
- }
+ &.is-end {
+ justify-content: flex-end;
+ }
+ }
- &[data-seekable="true"] {
- cursor: pointer;
- transition: opacity 0.35s ease, filter 0.35s ease, background-color 0.2s ease;
+ &-transport {
+ display: flex;
+ flex: 1 1 auto;
+ align-items: center;
+ justify-content: center;
+ gap: 0.6rem;
+ }
- &:hover,
- &:focus-visible {
- opacity: 0.8;
- filter: none;
- background: rgb(255 255 255 / 0.08);
- outline: none;
- }
- &[data-active-lyric="true"]:hover {
- opacity: 1;
- }
- }
- }
+ &-play {
+ display: grid;
+ place-items: center;
+ width: 56px;
+ height: 56px;
+ margin: 0 0.4rem;
+ padding: 0;
+ border: 0;
+ border-radius: 50%;
+ background: #f5196b;
+ color: #fff;
+ cursor: pointer;
+ box-shadow: 0 10px 26px rgb(0 0 0 / 0.35);
+ transition: transform 0.15s ease, filter 0.15s ease;
- // Unsynced lyrics: plain readable text, no highlight
- &[data-has-synced-lyrics="false"] {
- .audio-lyrics-container {
- padding: 1rem 0.5rem 4rem;
- }
- .audio-lyrics-line {
- font-size: 1.15rem !important;
- font-weight: 500 !important;
- opacity: 0.85;
- filter: none;
- margin-bottom: 0.25rem !important;
- }
- }
+ .material-symbols-rounded {
+ font-size: 1.9rem;
+ }
- &-unsynced-notice {
- position: sticky;
- bottom: 1rem;
- display: inline-flex;
- align-items: center;
- gap: 0.5rem;
- padding: 0.4rem 0.9rem;
- margin-left: 0.5rem;
- background: rgb(0 0 0 / 0.35);
- border-radius: 2rem;
- opacity: 0.85;
+ &:hover {
+ transform: scale(1.05);
+ filter: brightness(1.05);
+ }
+ }
- .material-symbols-rounded {
- font-size: 1.1rem;
- }
- }
- }
-}
-.player-progress-stacked {
- display: flex;
- flex-direction: column;
- width: 100%;
+ &-volume {
+ width: 92px;
+ display: flex;
+ align-items: center;
- .MuiSlider-root {
- padding: 10px 0;
- }
+ .MuiSlider-root {
+ color: rgb(255 255 255 / 0.82);
+ }
- &-times {
- display: flex;
- justify-content: space-between;
- font-size: 0.8rem;
- opacity: 0.7;
- font-variant-numeric: tabular-nums;
- }
+ .MuiSlider-rail {
+ background: rgb(255 255 255 / 0.22);
+ opacity: 1;
+ }
+
+ .MuiSlider-thumb {
+ width: 9px;
+ height: 9px;
+ box-shadow: none;
+ }
+ }
+
+ &-panel {
+ position: absolute;
+ z-index: 1;
+ top: 22%;
+ right: clamp(1.5rem, 3vw, 3rem);
+ bottom: 0;
+ width: clamp(360px, 46vw, 900px);
+ overflow: hidden;
+
+ &-inner {
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ height: 100%;
+ box-sizing: border-box;
+ overflow: hidden;
+ }
+ }
+
+ &-panel-head {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ padding: 0.7rem 0.7rem 0.2rem 0.9rem;
+ }
+
+ &-panel-tabs {
+ display: flex;
+ gap: 0.15rem;
+ flex: 1;
+
+ button {
+ padding: 0.4rem 0.2rem;
+ margin-right: 0.9rem;
+ border: 0;
+ border-radius: 0;
+ background: transparent;
+ color: rgb(255 255 255 / 0.5);
+ font: inherit;
+ font-size: 0.85rem;
+ font-weight: 600;
+ cursor: pointer;
+ transition: color 0.15s ease;
+
+ &:hover:not(:disabled) {
+ color: #fff;
+ }
+
+ &.is-active {
+ color: #fff;
+ }
+
+ &:disabled {
+ opacity: 0.35;
+ cursor: default;
+ }
+ }
+ }
+
+ &-panel-body {
+ flex: 1;
+ min-height: 0;
+ padding: 0.4rem 0.7rem 0.9rem;
+ overflow-y: auto;
+ overflow-x: hidden;
+
+ &::-webkit-scrollbar {
+ width: 6px;
+ }
+
+ &::-webkit-scrollbar-thumb {
+ border-radius: 3px;
+ background: rgb(255 255 255 / 0.18);
+ }
+ }
+
+ &-panel-source {
+ font-size: 0.8rem;
+ color: rgb(255 255 255 / 0.75);
+ }
+
+ &-panel-title {
+ margin: 0.15em 0 0.9em;
+ font-size: 1.65rem;
+ font-weight: 700;
+ letter-spacing: -0.01em;
+ line-height: 1.15;
+ overflow-wrap: anywhere;
+ }
+
+ &-panel-label {
+ margin: 1.6rem 0.2rem 0.5rem;
+ font-size: 0.98rem;
+ font-weight: 600;
+ color: #fff;
+
+ &:first-child {
+ margin-top: 0.2rem;
+ }
+ }
+
+ &-panel-empty {
+ margin: 0;
+ padding: 0.6rem;
+ font-size: 0.85rem;
+ line-height: 1.5;
+ color: rgb(255 255 255 / 0.5);
+ }
+
+ &-panel-lyrics {
+ height: 100%;
+ padding: 0;
+ }
+
+ &-queue-list {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ }
+
+ &-queue-row {
+ display: grid;
+ grid-template-columns: 48px minmax(0, 1fr) 30px 46px;
+ gap: 14px;
+ align-items: center;
+ width: 100%;
+ padding: 7px 4px;
+ border: 0;
+ border-radius: 6px;
+ background: transparent;
+ color: inherit;
+ font: inherit;
+ text-align: left;
+ cursor: pointer;
+ transition: background-color 0.15s ease;
+
+ &:hover {
+ background: rgb(255 255 255 / 0.06);
+ }
+
+ &.is-current {
+ cursor: default;
+
+ .music-player-queue-title {
+ color: #fff;
+ }
+ }
+ }
+
+ &-queue-cover {
+ position: relative;
+ display: grid;
+ place-items: center;
+ width: 48px;
+ height: 48px;
+ overflow: hidden;
+ border-radius: 6px;
+ background: rgb(255 255 255 / 0.08);
+
+ img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ }
+
+ .material-symbols-rounded {
+ font-size: 1.1rem;
+ opacity: 0.5;
+ }
+ }
+
+ &-queue-playing {
+ position: absolute;
+ inset: 0;
+ display: grid;
+ place-items: center;
+ background: rgb(0 0 0 / 0.45);
+
+ .material-symbols-rounded {
+ font-size: 1.5rem !important;
+ color: #fff;
+ opacity: 1 !important;
+ }
+ }
+
+ &-queue-text {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ }
+
+ &-queue-title {
+ font-size: 0.95rem;
+ font-weight: 500;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ &-queue-artist {
+ font-size: 0.8rem;
+ color: rgb(255 255 255 / 0.5);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ &-queue-time {
+ font-size: 0.8rem;
+ font-variant-numeric: tabular-nums;
+ color: rgb(255 255 255 / 0.6);
+ text-align: right;
+ }
+
+ &-queue-like {
+ display: flex;
+ justify-content: center;
+ opacity: 0.8;
+ transition: opacity 0.15s ease;
+
+ .MuiIconButton-root {
+ padding: 4px;
+ color: rgb(255 255 255 / 0.6);
+
+ &:hover {
+ color: #fff;
+ background: transparent;
+ }
+ }
+ }
+
+ &-panel-lyrics .audio-lyrics {
+ height: 100%;
+ }
+
+ .audio-lyrics-container {
+ padding: 24% 0.4rem;
+ }
+
+ .audio-lyrics-line {
+ margin: 0 0 0.45rem !important;
+ padding: 0.2rem 0.55rem;
+ border-radius: 0.6rem;
+ font-size: clamp(1rem, 1.4vw, 1.35rem) !important;
+ line-height: 1.3 !important;
+ font-weight: 600 !important;
+ }
+
+ @media (max-width: 900px) {
+ &-stage {
+ padding: 0 1rem;
+ }
+
+ &-controls-side {
+ flex-basis: auto;
+
+ &:not(.is-end) {
+ display: none;
+ }
+ }
+
+ &-volume {
+ display: none;
+ }
+
+ &-panel {
+ top: 1rem;
+ right: 1rem;
+ width: min(84vw, 520px);
+ }
+
+ &.has-panel &-main {
+ transform: none;
+ }
+ }
+}
+
+// macOS keeps its native traffic lights inside the overlay titlebar.
+html.is-macos .music-player-chrome {
+ padding-top: 12px;
+ padding-left: 84px;
+ min-height: 56px;
+}
+
+/* Lyrics list, shared with the queue panel. */
+.audio-lyrics {
+ width: 100%;
+ height: 100%;
+ overflow-y: auto;
+ overflow-x: hidden;
+ scrollbar-width: none;
+ mask-image: linear-gradient(transparent, black 12%, black 88%, transparent);
+
+ &::-webkit-scrollbar {
+ display: none;
+ }
+
+ &-container {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ padding: 30% 0.5rem;
+ }
+
+ &-status {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 100%;
+ min-height: 200px;
+ opacity: 0.7;
+ }
+
+ &-line {
+ margin: 0 0 0.6rem !important;
+ padding: 0.35rem 0.75rem;
+ border-radius: 0.75rem;
+ font-size: clamp(1.1rem, 1.7vw, 1.6rem) !important;
+ line-height: 1.35 !important;
+ font-weight: 700 !important;
+ text-align: left;
+ opacity: 0.35;
+ transition: opacity 0.35s ease, filter 0.35s ease;
+ filter: blur(0.4px);
+
+ &[data-active-lyric="true"] {
+ opacity: 1;
+ filter: none;
+ }
+
+ &[data-seekable="true"] {
+ cursor: pointer;
+ transition: opacity 0.35s ease, filter 0.35s ease, background-color 0.2s ease;
+
+ &:hover,
+ &:focus-visible {
+ opacity: 0.8;
+ filter: none;
+ background: rgb(255 255 255 / 0.08);
+ outline: none;
+ }
+
+ &[data-active-lyric="true"]:hover {
+ opacity: 1;
+ }
+ }
+ }
+
+ &[data-has-synced-lyrics="false"] {
+ .audio-lyrics-container {
+ padding: 1rem 0.5rem 4rem;
+ }
+
+ .audio-lyrics-line {
+ font-size: 1rem !important;
+ font-weight: 500 !important;
+ opacity: 0.85;
+ filter: none;
+ margin-bottom: 0.25rem !important;
+ }
+ }
}
diff --git a/src/routes/_api/player/audio.tsx b/src/routes/_api/player/audio.tsx
index b6922d4..8bd3e19 100644
--- a/src/routes/_api/player/audio.tsx
+++ b/src/routes/_api/player/audio.tsx
@@ -7,24 +7,23 @@ import {
ListItemIcon,
Menu,
MenuItem,
+ Slider,
Tooltip,
- Typography,
} from "@mui/material";
import { useQuery } from "@tanstack/react-query";
import { createFileRoute, Link, useNavigate } from "@tanstack/react-router";
+import { AnimatePresence, motion } from "motion/react";
import React, { useEffect, useMemo, useState } from "react";
import CastButton from "@/components/buttons/castButton";
-import InstantMixButton from "@/components/buttons/instantMixButton";
import LikeButton from "@/components/buttons/likeButton";
import LyricsPanel, {
getLyricsQueryOptions,
} from "@/components/playback/audioPlayer/components/LyricsPanel";
-import PlayerControls from "@/components/playback/audioPlayer/components/PlayerControls";
-import PlayerProgress from "@/components/playback/audioPlayer/components/PlayerProgress";
import PlayerVolume from "@/components/playback/audioPlayer/components/PlayerVolume";
import StatsPanel from "@/components/playback/audioPlayer/components/StatsPanel";
-import QueueView from "@/components/queue/queueView";
-import { secToTicks, ticksToSec } from "@/utils/date/time";
+import WindowControls from "@/components/windowControls";
+import { getRuntimeMusic, secToTicks, ticksToSec } from "@/utils/date/time";
+import { getCoverPalette } from "@/utils/methods/coverColor";
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
import { getItemQueryOptions } from "@/utils/queries/items";
import { useApiInContext } from "@/utils/store/api";
@@ -34,6 +33,7 @@ import {
useAudioPlayback,
} from "@/utils/store/audioPlayback";
import { useCentralStore } from "@/utils/store/central";
+import { playItemFromQueue } from "@/utils/store/playback";
import useQueue, {
cycleRepeatMode,
type RepeatMode,
@@ -52,44 +52,76 @@ const repeatLabels: Record
= {
one: "Повтор одного",
};
-/** Artists (linked) and album (linked) for the current track. */
-const TrackSubtitle = ({ item }: { item: BaseItemDto }) => {
- const artists = item.ArtistItems?.length
- ? item.ArtistItems
- : (item.AlbumArtists ?? []);
- return (
-
- {artists.map((artist, index) => (
-
- {index > 0 && ", "}
- {artist.Id ? (
-
- {artist.Name}
-
- ) : (
- artist.Name
- )}
-
- ))}
- {item.Album && (
- <>
- {artists.length > 0 && " · "}
- {item.AlbumId ? (
-
- {item.Album}
-
- ) : (
- item.Album
- )}
- >
+const QueueRow = ({
+ item,
+ index,
+ isCurrent,
+ coverUrl,
+ onPlay,
+ queryKey,
+ userId,
+}: {
+ item: BaseItemDto;
+ index: number;
+ isCurrent: boolean;
+ coverUrl?: string;
+ onPlay: (index: number) => void;
+ queryKey: string[];
+ userId?: string;
+}) => (
+ // biome-ignore lint/a11y/useSemanticElements: the row contains its own like button
+ {
+ if (!isCurrent) onPlay(index);
+ }}
+ onKeyDown={(event) => {
+ if (isCurrent) return;
+ if (event.key === "Enter" || event.key === " ") {
+ event.preventDefault();
+ onPlay(index);
+ }
+ }}
+ role="button"
+ tabIndex={0}
+ >
+
+ {coverUrl ? (
+
+ ) : (
+ music_note
)}
-
- );
-};
+ {isCurrent && (
+
+ play_arrow
+
+ )}
+
+
+ {item.Name}
+
+ {item.Artists?.join(", ") ?? item.AlbumArtist ?? item.Album}
+
+
+
event.stopPropagation()}
+ onKeyDown={(event) => event.stopPropagation()}
+ role="presentation"
+ >
+
+
+
+ {getRuntimeMusic(item.RunTimeTicks ?? 0)}
+
+
+);
function AudioPlayerRoute() {
const api = useApiInContext((s) => s.api);
@@ -109,6 +141,8 @@ function AudioPlayerRoute() {
const [progress, setProgress] = useState(0);
const [playing, setPlaying] = useState(false);
+ const [panelOpen, setPanelOpen] = useState(false);
+ const [panelTab, setPanelTab] = useState<"queue" | "lyrics">("queue");
const [menuAnchor, setMenuAnchor] = useState(null);
const [statsOpen, setStatsOpen] = useState(false);
@@ -141,6 +175,9 @@ function AudioPlayerRoute() {
const lyrics = useQuery(getLyricsQueryOptions(item, api));
const hasLyrics = (lyrics.data?.Lyrics?.length ?? 0) > 0;
+ // Wall colour derived from the sleeve.
+ const palette = useMemo(() => getCoverPalette(item), [item]);
+
const handlePlayPause = () => {
const player = audioPlayerRef?.current;
if (!player) return;
@@ -170,52 +207,235 @@ function AudioPlayerRoute() {
[item?.Id, item?.ImageTags?.Primary, api],
);
+ const coverFor = (track: BaseItemDto) =>
+ api && track.ImageTags?.Primary
+ ? getImageUrlsApi(api).getItemImageUrlById(
+ track.AlbumId ?? track.Id ?? "",
+ "Primary",
+ { quality: 70, fillHeight: 96, fillWidth: 96 },
+ )
+ : undefined;
+
const hasUpcoming = (queue?.length ?? 0) > currentTrack + 1;
const isFavorite =
itemDetails.data?.UserData?.IsFavorite ?? item?.UserData?.IsFavorite;
const artistId = item?.ArtistItems?.[0]?.Id ?? item?.AlbumArtists?.[0]?.Id;
+ const tracks = queue ?? [];
+ const current = tracks[currentTrack];
+ const upcoming = tracks.slice(currentTrack + 1);
+
+ const openPanel = (tab: "queue" | "lyrics") => {
+ if (panelOpen && panelTab === tab) {
+ setPanelOpen(false);
+ return;
+ }
+ setPanelTab(tab);
+ setPanelOpen(true);
+ };
return (
<>
-
- {imageUrl && (
-

- )}
-
-
-
-
- {imageUrl ? (
-

- ) : (
-
music_note
- )}
+
+
+
+
+
+
+
+
+
+
+
+ {imageUrl ? (
+
+ ) : (
+ music_note
+ )}
+
+
+
+
{item?.Name}
+
+ {item?.ArtistItems?.length
+ ? item.ArtistItems.map((artist, index) => (
+
+ {index > 0 && ", "}
+ {artist.Id ? (
+
+ {artist.Name}
+
+ ) : (
+ artist.Name
+ )}
+
+ ))
+ : item?.Artists?.join(", ")}
+ {item?.Album && (
+ <>
+ {(item?.ArtistItems?.length || item?.Artists?.length) &&
+ " · "}
+ {item.AlbumId ? (
+
+ {item.Album}
+
+ ) : (
+ item.Album
+ )}
+ >
+ )}
+
+
+
+ {
+ const next = Array.isArray(value) ? value[0] : value;
+ setProgress(ticksToSec(next));
+ }}
+ onChangeCommitted={(_, value) => {
+ const next = Array.isArray(value) ? value[0] : value;
+ handleSeekCommit(next);
+ }}
+ />
+
+
-
-
-
+ {panelOpen && (
+
- {item?.Name}
-
- {item && }
-
- {item &&
}
- {item &&
}
+
+ {panelTab === "lyrics" ? (
+ <>
+
+
+ Текст песни
+
+ setPanelTab("queue")}
+ >
+ close
+
+
+
+ {hasLyrics ? (
+
+ ) : (
+
+ Для этого трека нет текста.
+
+ )}
+
+ >
+ ) : (
+
+
+ Сейчас играет из{" "}
+ {item?.Album ? "альбома" : "очереди"}
+
+
+ {item?.Album ?? "Очередь"}
+
+ {current && (
+
undefined}
+ queryKey={["queue-current"]}
+ userId={user?.Id}
+ />
+ )}
+
+ Далее в очереди
+
+ {upcoming.length === 0 ? (
+
+ Очередь пуста. Запустите альбом или плейлист,
+ чтобы она наполнилась.
+
+ ) : (
+
+ {upcoming.map((track, offset) => (
+
+ playItemFromQueue(index, user?.Id, api)
+ }
+ queryKey={["queue-upcoming"]}
+ userId={user?.Id}
+ />
+ ))}
+
+ )}
+
+ )}
+
+
+ )}
+
+
+
+
+