mirror of
https://github.com/sudoxnym/audiobookshelf-atv.git
synced 2026-04-14 11:36:27 +00:00
Update bookshelf item width to more accurately fill shelf for smaller screens #1540
This commit is contained in:
parent
9ca160f1da
commit
ea2e8c7cc9
1 changed files with 12 additions and 2 deletions
|
|
@ -105,8 +105,18 @@ export default {
|
||||||
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
||||||
},
|
},
|
||||||
bookWidth() {
|
bookWidth() {
|
||||||
var coverSize = 100
|
const availableWidth = window.innerWidth - 16
|
||||||
if (window.innerWidth <= 375) coverSize = 90
|
let coverSize = 100
|
||||||
|
|
||||||
|
// Smaller screens fill width with 2 items per row
|
||||||
|
if (availableWidth <= 400) {
|
||||||
|
coverSize = Math.floor(availableWidth / 2 - 24)
|
||||||
|
if (coverSize < 120) {
|
||||||
|
// Fallback to 1 item per row
|
||||||
|
coverSize = Math.min(availableWidth - 24, 200)
|
||||||
|
}
|
||||||
|
if (this.isCoverSquareAspectRatio || this.entityName === 'playlists') coverSize /= 1.6
|
||||||
|
}
|
||||||
|
|
||||||
if (this.isCoverSquareAspectRatio || this.entityName === 'playlists') return coverSize * 1.6
|
if (this.isCoverSquareAspectRatio || this.entityName === 'playlists') return coverSize * 1.6
|
||||||
return coverSize
|
return coverSize
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue