diff --git a/client/components/app/LazyBookshelf.vue b/client/components/app/LazyBookshelf.vue index 6e3083e0..fb888cad 100644 --- a/client/components/app/LazyBookshelf.vue +++ b/client/components/app/LazyBookshelf.vue @@ -2,6 +2,10 @@
@@ -65,6 +69,7 @@ export default { tempIsScanning: false, cardWidth: 0, cardHeight: 0, + coverHeight: 0, resizeObserver: null, lastScrollTop: 0, lastTimestamp: 0, @@ -833,6 +838,14 @@ export default { .finally(() => { this.tempIsScanning = false }) + }, + entitiesInShelf(shelf) { + return shelf == this.totalShelves ? this.totalEntities % this.entitiesPerShelf : this.entitiesPerShelf + }, + entityTransform(entityIndex) { + const shelfOffsetY = this.shelfPaddingHeight * this.sizeMultiplier + const shelfOffsetX = (entityIndex - 1) * this.totalEntityCardWidth + this.bookshelfMarginLeft + return `translate3d(${shelfOffsetX}px, ${shelfOffsetY}px, 0px)` } }, async mounted() { diff --git a/client/components/cards/AuthorCard.vue b/client/components/cards/AuthorCard.vue index 597aca99..27e67725 100644 --- a/client/components/cards/AuthorCard.vue +++ b/client/components/cards/AuthorCard.vue @@ -68,6 +68,9 @@ export default { cardHeight() { return this.height * this.sizeMultiplier }, + coverHeight() { + return this.cardHeight + }, userToken() { return this.store.getters['user/getToken'] }, diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue index 09424b3c..12a96dcb 100644 --- a/client/components/cards/LazyBookCard.vue +++ b/client/components/cards/LazyBookCard.vue @@ -19,7 +19,7 @@
- +
diff --git a/client/mixins/bookshelfCardsHelpers.js b/client/mixins/bookshelfCardsHelpers.js index 802b2cc8..01a6869b 100644 --- a/client/mixins/bookshelfCardsHelpers.js +++ b/client/mixins/bookshelfCardsHelpers.js @@ -57,9 +57,10 @@ export default { for (let entry of entries) { this.cardWidth = entry.borderBoxSize[0].inlineSize this.cardHeight = entry.borderBoxSize[0].blockSize - this.resizeObserver.disconnect() - this.$refs.bookshelf.removeChild(instance.$el) } + this.coverHeight = instance.coverHeight + this.resizeObserver.disconnect() + this.$refs.bookshelf.removeChild(instance.$el) }) instance.$el.style.visibility = 'hidden' instance.$el.style.position = 'absolute'