mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-03 09:34:51 +02:00
Update:Increase cover size on fullscreen audio player #491
This commit is contained in:
parent
d85158bd70
commit
83fdf4fd65
1 changed files with 14 additions and 4 deletions
|
@ -132,6 +132,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
windowHeight: 0,
|
||||
windowWidth: 0,
|
||||
playbackSession: null,
|
||||
showChapterModal: false,
|
||||
showFullscreen: false,
|
||||
|
@ -213,11 +214,19 @@ export default {
|
|||
return 46 / this.bookCoverAspectRatio
|
||||
},
|
||||
fullscreenBookCoverWidth() {
|
||||
var heightScale = (this.windowHeight - 200) / 651
|
||||
if (this.bookCoverAspectRatio === 1) {
|
||||
return 260 * heightScale
|
||||
if (this.windowWidth < this.windowHeight) {
|
||||
// Portrait
|
||||
let sideSpace = 20
|
||||
if (this.bookCoverAspectRatio === 1.6) sideSpace += (this.windowWidth - sideSpace) * 0.375
|
||||
return this.windowWidth - sideSpace
|
||||
} else {
|
||||
// Landscape
|
||||
const heightScale = (this.windowHeight - 200) / 651
|
||||
if (this.bookCoverAspectRatio === 1) {
|
||||
return 260 * heightScale
|
||||
}
|
||||
return 190 * heightScale
|
||||
}
|
||||
return 200 * heightScale
|
||||
},
|
||||
showCastBtn() {
|
||||
return this.$store.state.isCastAvailable
|
||||
|
@ -775,6 +784,7 @@ export default {
|
|||
},
|
||||
updateScreenSize() {
|
||||
this.windowHeight = window.innerHeight
|
||||
this.windowWidth = window.innerWidth
|
||||
const coverHeight = this.fullscreenBookCoverWidth * this.bookCoverAspectRatio
|
||||
document.documentElement.style.setProperty('--cover-image-width', this.fullscreenBookCoverWidth + 'px')
|
||||
document.documentElement.style.setProperty('--cover-image-height', coverHeight + 'px')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue