mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-17 17:39:56 -04:00
[web] Reduce the size of sliders
While keeping the ability to reach easily sliders, their visual size has been reduce to make them less bulky.
This commit is contained in:
parent
0ec390907d
commit
09a4b0d6f7
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
12
web-src/package-lock.json
generated
12
web-src/package-lock.json
generated
@ -1258,9 +1258,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-vue": {
|
"node_modules/eslint-plugin-vue": {
|
||||||
"version": "9.15.0",
|
"version": "9.15.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.15.1.tgz",
|
||||||
"integrity": "sha512-XYzpK6e2REli100+6iCeBA69v6Sm0D/yK2FZP+fCeNt0yH/m82qZQq+ztseyV0JsKdhFysuSEzeE1yCmSC92BA==",
|
"integrity": "sha512-CJE/oZOslvmAR9hf8SClTdQ9JLweghT6JCBQNrT2Iel1uVw0W0OLJxzvPd6CxmABKCvLrtyDnqGV37O7KQv6+A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.3.0",
|
"@eslint-community/eslint-utils": "^4.3.0",
|
||||||
@ -2409,9 +2409,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/semver": {
|
"node_modules/semver": {
|
||||||
"version": "7.5.2",
|
"version": "7.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz",
|
||||||
"integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==",
|
"integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lru-cache": "^6.0.0"
|
"lru-cache": "^6.0.0"
|
||||||
|
@ -367,6 +367,7 @@
|
|||||||
},
|
},
|
||||||
"now-playing": {
|
"now-playing": {
|
||||||
"info": "Tracks durch Auswählen aus der Bibliothek anfügen",
|
"info": "Tracks durch Auswählen aus der Bibliothek anfügen",
|
||||||
|
"live": "Live",
|
||||||
"title": "Deine Playliste ist leer."
|
"title": "Deine Playliste ist leer."
|
||||||
},
|
},
|
||||||
"playlist": {
|
"playlist": {
|
||||||
|
@ -367,6 +367,7 @@
|
|||||||
},
|
},
|
||||||
"now-playing": {
|
"now-playing": {
|
||||||
"info": "Add some tracks by browsing your library",
|
"info": "Add some tracks by browsing your library",
|
||||||
|
"live": "Live",
|
||||||
"title": "Your play queue is empty"
|
"title": "Your play queue is empty"
|
||||||
},
|
},
|
||||||
"playlist": {
|
"playlist": {
|
||||||
|
@ -367,6 +367,7 @@
|
|||||||
},
|
},
|
||||||
"now-playing": {
|
"now-playing": {
|
||||||
"info": "Ajoutez des pistes en parcourant votre bibliothèque",
|
"info": "Ajoutez des pistes en parcourant votre bibliothèque",
|
||||||
|
"live": "En direct",
|
||||||
"title": "La file d’attente est vide"
|
"title": "La file d’attente est vide"
|
||||||
},
|
},
|
||||||
"playlist": {
|
"playlist": {
|
||||||
|
@ -240,9 +240,10 @@ hr.fd-navbar-divider {
|
|||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
width: var(--th);
|
width: var(--th);
|
||||||
height: var(--th);
|
height: var(--th);
|
||||||
|
box-sizing: border-box;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: $dark;
|
background: $light;
|
||||||
border: none;
|
border: 1px solid $dark;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin track {
|
@mixin track {
|
||||||
@ -252,15 +253,15 @@ hr.fd-navbar-divider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input[type='range'].slider {
|
input[type='range'].slider {
|
||||||
--sh: 0.5rem;
|
--sh: 0.25rem;
|
||||||
--th: calc(var(--sh) * 1.75);
|
--th: calc(var(--sh) * 3);
|
||||||
@include mobile {
|
@include mobile {
|
||||||
--th: calc(var(--sh) * 2.5);
|
--th: calc(var(--sh) * 4);
|
||||||
}
|
}
|
||||||
--sx: calc(var(--th) / 2 + (var(--ratio) * (100% - var(--th))));
|
--sx: calc(var(--th) / 2 + (var(--ratio) * (100% - var(--th))));
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
min-width: 250px;
|
min-width: 250px;
|
||||||
height: calc(var(--sh) * 3);
|
height: calc(var(--sh) * 5);
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
cursor: grab;
|
cursor: grab;
|
||||||
&:active {
|
&:active {
|
||||||
@ -282,7 +283,9 @@ input[type='range'].slider {
|
|||||||
&.is-inactive {
|
&.is-inactive {
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
&::-webkit-slider-thumb {
|
&::-webkit-slider-thumb {
|
||||||
background-color: $grey-light;
|
box-sizing: border-box;
|
||||||
|
background-color: $light;
|
||||||
|
border: 1px $grey-light solid;
|
||||||
}
|
}
|
||||||
&::-webkit-slider-runnable-track {
|
&::-webkit-slider-runnable-track {
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
@ -292,7 +295,9 @@ input[type='range'].slider {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
&::-moz-range-thumb {
|
&::-moz-range-thumb {
|
||||||
background-color: $grey-light;
|
box-sizing: border-box;
|
||||||
|
background-color: $light;
|
||||||
|
border: 1px $grey-light solid;
|
||||||
}
|
}
|
||||||
&::-moz-range-track {
|
&::-moz-range-track {
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
|
@ -10,25 +10,20 @@
|
|||||||
@click="open_dialog(track)"
|
@click="open_dialog(track)"
|
||||||
/>
|
/>
|
||||||
<input
|
<input
|
||||||
v-model.number="item_progress_ms"
|
v-model.number="track_progress"
|
||||||
:step="INTERVAL"
|
:max="track_progress_max"
|
||||||
:max="is_live ? INTERVAL : track.length_ms"
|
|
||||||
type="range"
|
type="range"
|
||||||
class="slider mt-5"
|
class="slider mt-5"
|
||||||
:style="{ '--ratio': progress }"
|
:class="{ 'is-inactive': is_live }"
|
||||||
|
:style="{ '--ratio': track_progress_ratio }"
|
||||||
|
:disabled="is_live"
|
||||||
@change="seek"
|
@change="seek"
|
||||||
@touchstart="start_dragging"
|
@mousedown="start_dragging"
|
||||||
@touchend="end_dragging"
|
@mouseup="end_dragging"
|
||||||
/>
|
/>
|
||||||
<div class="is-flex is-justify-content-space-between">
|
<div class="is-flex is-justify-content-space-between">
|
||||||
<p
|
<p class="subtitle is-7" v-text="track_elapsed_time" />
|
||||||
class="subtitle is-7"
|
<p class="subtitle is-7" v-text="track_total_time" />
|
||||||
v-text="$filters.durationInHours(item_progress_ms)"
|
|
||||||
/>
|
|
||||||
<p
|
|
||||||
class="subtitle is-7"
|
|
||||||
v-text="$filters.durationInHours(track.length_ms)"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<p class="title is-5" v-text="track.title" />
|
<p class="title is-5" v-text="track.title" />
|
||||||
<p class="title is-6" v-text="track.artist" />
|
<p class="title is-6" v-text="track.artist" />
|
||||||
@ -77,22 +72,29 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
INTERVAL,
|
INTERVAL,
|
||||||
item_progress_ms: 0,
|
|
||||||
interval_id: 0,
|
interval_id: 0,
|
||||||
is_dragged: false,
|
is_dragged: false,
|
||||||
|
|
||||||
show_details_modal: false,
|
show_details_modal: false,
|
||||||
selected_item: {}
|
selected_item: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
progress() {
|
is_live() {
|
||||||
return this.is_live ? 2 : this.item_progress_ms / this.track.length_ms
|
return this.track.length_ms === 0
|
||||||
},
|
},
|
||||||
|
|
||||||
is_live() {
|
track_progress: {
|
||||||
return this.track.length_ms == 0
|
get() {
|
||||||
|
return Math.floor(this.player.item_progress_ms / INTERVAL)
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
this.player.item_progress_ms = value * INTERVAL
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
track_progress_ratio() {
|
||||||
|
return this.track_progress / this.track_progress_max
|
||||||
},
|
},
|
||||||
|
|
||||||
player() {
|
player() {
|
||||||
@ -103,6 +105,20 @@ export default {
|
|||||||
return this.$store.getters.now_playing
|
return this.$store.getters.now_playing
|
||||||
},
|
},
|
||||||
|
|
||||||
|
track_progress_max() {
|
||||||
|
return this.is_live ? 1 : Math.floor(this.track.length_ms / INTERVAL)
|
||||||
|
},
|
||||||
|
|
||||||
|
track_elapsed_time() {
|
||||||
|
return this.$filters.durationInHours(this.track_progress * INTERVAL)
|
||||||
|
},
|
||||||
|
|
||||||
|
track_total_time() {
|
||||||
|
return this.is_live
|
||||||
|
? this.$t('page.now-playing.live')
|
||||||
|
: this.$filters.durationInHours(this.track.length_ms)
|
||||||
|
},
|
||||||
|
|
||||||
settings_option_show_composer_now_playing() {
|
settings_option_show_composer_now_playing() {
|
||||||
return this.$store.getters.settings_option_show_composer_now_playing
|
return this.$store.getters.settings_option_show_composer_now_playing
|
||||||
},
|
},
|
||||||
@ -148,7 +164,6 @@ export default {
|
|||||||
window.clearTimeout(this.interval_id)
|
window.clearTimeout(this.interval_id)
|
||||||
this.interval_id = 0
|
this.interval_id = 0
|
||||||
}
|
}
|
||||||
this.item_progress_ms = this.player.item_progress_ms
|
|
||||||
if (this.player.state === 'play') {
|
if (this.player.state === 'play') {
|
||||||
this.interval_id = window.setInterval(this.tick, INTERVAL)
|
this.interval_id = window.setInterval(this.tick, INTERVAL)
|
||||||
}
|
}
|
||||||
@ -156,7 +171,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.item_progress_ms = this.player.item_progress_ms
|
|
||||||
webapi.player_status().then(({ data }) => {
|
webapi.player_status().then(({ data }) => {
|
||||||
this.$store.commit(types.UPDATE_PLAYER_STATUS, data)
|
this.$store.commit(types.UPDATE_PLAYER_STATUS, data)
|
||||||
if (this.player.state === 'play') {
|
if (this.player.state === 'play') {
|
||||||
@ -175,13 +189,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
tick() {
|
tick() {
|
||||||
if (!this.is_dragged) {
|
if (!this.is_dragged) {
|
||||||
if (this.is_live) {
|
this.track_progress += 1
|
||||||
this.item_progress_ms += INTERVAL
|
|
||||||
} else if (this.item_progress_ms + INTERVAL > this.track.length_ms) {
|
|
||||||
this.item_progress_ms = this.track.length_ms
|
|
||||||
} else {
|
|
||||||
this.item_progress_ms += INTERVAL
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -195,9 +203,7 @@ export default {
|
|||||||
|
|
||||||
seek() {
|
seek() {
|
||||||
if (!this.is_live) {
|
if (!this.is_live) {
|
||||||
webapi.player_seek_to_pos(this.item_progress_ms).catch(() => {
|
webapi.player_seek_to_pos(this.track_progress * INTERVAL)
|
||||||
this.item_progress_ms = this.player.item_progress_ms
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user