@@ -60,9 +60,12 @@ class Footer extends LitElement {
${this.navigation?.map(r => {
if (!r.hide) {
if (Array.isArray(r)) {
- return r.map((r, i) => this.renderLink(r, i == 0))
+ return r.map((r, i) =>
+ html`${i == 0 ? html`` : ''}
+ ${this.renderLink(r, false)}`
+ )
} else {
- return this.renderLink(r, r.path != '/')
+ return this.renderLink(r, r.path != '/' && !r.disabled)
}
}
})}
diff --git a/src/components/ModularPlayer.js b/src/components/ModularPlayer.js
index b64cb1b..5912f43 100644
--- a/src/components/ModularPlayer.js
+++ b/src/components/ModularPlayer.js
@@ -5,7 +5,6 @@ import { formatSeconds } from '../api/utils'
import MainCSS from '../assets/styles/main.scss?inline'
import './RangeSlider.js'
-import './Loading.js'
class ModularPlayer extends LitElement {
static properties = {
@@ -17,7 +16,6 @@ class ModularPlayer extends LitElement {
position: { state: true },
playing: { state: true },
track: { state: true },
- loading: { state: true },
// audio element
audio: { state: true },
@@ -32,13 +30,16 @@ class ModularPlayer extends LitElement {
this.track = 0
this.position = 0
this.duration = 0
- this.loading = true
this._initAudio()
}
- firstUpdated() {
- console.log(this.details)
+ willUpdate(att) {
+ if (att.has('details')) {
+ this.track = 0
+ }
+
+ this.requestUpdate()
}
_getTrack = new Task(
@@ -66,16 +67,6 @@ class ModularPlayer extends LitElement {
_initAudio() {
this.audio = document.createElement('audio')
- this.audio.addEventListener('loadstart', () => {
- this.loading = true
- })
-
- this.audio.addEventListener('canplay', () => {
- if (this.details.tracks) {
- this.loading = false
- }
- })
-
this.audio.addEventListener('play', () => {
this.playing = true
})
@@ -282,13 +273,16 @@ ${ this.details ?
}
.player:has(.tracklist) {
- grid-template-rows: 67% 0.5fr 0.3fr 1fr;
+ grid-template-rows: 67% 1fr 1fr 1fr;
padding-block-end: 2em;
gap: 0;
& > header {
- margin-block-start: 1.5em;
- margin-block-end: 2em;
+ margin-block: 1.25em;
+ }
+
+ & .info {
+ padding-block-end: 1.5em;
}
}
diff --git a/src/components/NavCard.js b/src/components/NavCard.js
index 5736ac7..1f1d50e 100644
--- a/src/components/NavCard.js
+++ b/src/components/NavCard.js
@@ -15,19 +15,10 @@ class NavCard extends LitElement {
this.route = {}
}
- firstUpdated() {
- console.log(this.route)
- this.shadowRoot.host.addEventListener('click', () => {
- if (!this.route.disabled) {
- Router.navigate(this.route.path)
- }
- })
- }
-
- navigate(path) {
- if (!this.route.disabled) {
- path = path || this.route.path
- Router.navigate(path)
+ navigate(route) {
+ route = route || this.route
+ if (!route.disabled) {
+ Router.navigate(route.path)
}
}
@@ -38,23 +29,30 @@ class NavCard extends LitElement {
- ${this.route.map(r =>
- !r.disabled ? html`
-
- ` : ''
- )}
+
+ ${this.route.map(r =>
+ html`
+
+ `
+ )}
+
`
:
html`
-
+
+
+
`
}
@@ -76,11 +74,28 @@ class NavCard extends LitElement {
.card {
display: grid;
- grid-auto-flow: rows;
- gap: 0.5em;
+ grid-template-rows: auto 1fr;
+ gap: 0.4em;
margin-inline: var(--inline-padding);
cursor: pointer;
font-size: 1.65em;
+ height: 100%;
+ }
+
+ .buttons {
+ display: flex;
+ flex-direction: column;
+ gap: 0.4em;
+ padding-block-end: 0.75em;
+
+ &:not(.single) > * {
+ flex-grow: 1;
+ }
+
+ &.single {
+ justify-content: center;
+ padding-block-end: 2em;
+ }
}
mm-icon {
@@ -91,14 +106,14 @@ class NavCard extends LitElement {
}
.title {
- padding-bottom: 0.75em;
- margin-block-start: 1em;
+ padding-bottom: 0.25em;
+ margin-block-start: 0.75em;
font-size: 0.75em;
text-align: center;
border-bottom: thin solid var(--highlight-color);
display: flex;
align-items: center;
- min-height: 2.5em;
+ min-height: 2em;
& > span {
display: block;
@@ -122,8 +137,12 @@ class NavCard extends LitElement {
text-shadow: 0 0 5px #ffffff;
margin: 0;
- &:has(span) {
+ &:has(.disabled) {
+ display: flex;
+ align-items: center;
+ justify-content: center;
background: var(--neutral-gradient-600);
+ text-align: center;
}
&.iconOnly {
diff --git a/src/views/audio.js b/src/views/audio.js
index 1538415..a18fd66 100644
--- a/src/views/audio.js
+++ b/src/views/audio.js
@@ -91,7 +91,7 @@ class AudioView extends LitElement {
-