diff --git a/src/components/r4-app.js b/src/components/r4-app.js index a334d5da..4f0cafa8 100644 --- a/src/components/r4-app.js +++ b/src/components/r4-app.js @@ -226,7 +226,7 @@ export default class R4App extends LitElement { return html`` } return html` - + ${!this.config.singleChannel ? this.renderMenu() : null}
${this.renderRouter()}
- ${this.isPlaying ? this.renderPlaybackIcon() : null} + ${this.isPlaying ? + html`${this.renderPlaybackIcon()} + ${this.config.playingChannel?.name} - ${this.config.playingTrack?.title} + ` : null} ${Object.entries(this.uiStates).map(this.renderUiState.bind(this))} @@ -135,7 +138,7 @@ export default class R4Layout extends LitElement { ` } - onControlClick({target: {value: uiStateNext}}) { + onControlClick({currentTarget: {value: uiStateNext}}) { this.uiState = this.uiStates[uiStateNext] if (!this.detailsRef?.value?.getAttribute('open')) { this.detailsRef?.value?.setAttribute('open', true) diff --git a/src/index.css b/src/index.css index 2bd65e49..29737a48 100644 --- a/src/index.css +++ b/src/index.css @@ -208,9 +208,28 @@ r4-layout[ui-state='close'] [slot='player']::slotted(*) { /* make the player summary not display its icon */ r4-layout::part(playback-summary) { display: flex; - justify-content: flex-end; + /* justify-content: flex-end; */ + background-color: var(--c-bg2); +} + +r4-layout::part(playback-status-title) { + align-self: center; + justify-self: flex-start; + font-size: 14px; + flex-grow: 1; +} + +r4-layout::part(name=[playback-controls]) { + margin-left: auto; } + +r4-layout::part(playback) { + position: sticky; + top: 0; +} + + /* the player */ r4-layout r4-player, r4-layout radio4000-player { @@ -222,7 +241,6 @@ r4-layout r4-player radio4000-player .Layout { r4-layout::part(playback-status) { display: flex; - flex-grow: 1; align-self: center; padding: calc(var(--s) / 3); opacity: 0.3; diff --git a/src/libs/appearence.js b/src/libs/appearence.js index e7b45277..e5548491 100644 --- a/src/libs/appearence.js +++ b/src/libs/appearence.js @@ -1,11 +1,24 @@ -const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches -const THEMES = ['classic', 'jellybeans', 'minimal', 'hash'] -const COLOR_SCHEMES = ['os', 'light', 'dark'] -const UI_STATES = { +// Each of these correspond to a matching css file in public/themes/. +export const THEMES = ['classic', 'jellybeans', 'minimal', 'hash'] + +// We allow the user to choose their prefered appearance as well. It is up to the selected theme to implement. +export const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches +export const COLOR_SCHEMES = ['os', 'light', 'dark'] + +// This determine the position of the player among other things. +export const UI_STATES = { + // and we have a detail Close: 'close', - Dock: 'dock', Minimize: 'minimize', + Dock: 'dock', Fullscreen: 'fullscreen', } -export {UI_STATES, THEMES, COLOR_SCHEMES, prefersDark} +/* +"detail" is "micro" +"close" is close +"mini" is displaying just the video +"dock" is docked to the side/bottom/top (full height or width) +"fullscreen" is full vh/vw/z-index +"close" is to "finish playback" +*/