|
1 | 1 | <template>
|
2 |
| - <div ref="card" :id="`book-card-${index}`" role="button" :style="{ minWidth: coverWidth + 'px', maxWidth: coverWidth + 'px' }" class="absolute rounded-sm z-10 cursor-pointer" @mousedown.prevent @mouseup.prevent @mousemove.prevent @mouseover="mouseover" @mouseleave="mouseleave" @click="clickCard"> |
| 2 | + <article ref="card" :id="`book-card-${index}`" tabindex="0" :aria-label="displayTitle" :style="{ minWidth: coverWidth + 'px', maxWidth: coverWidth + 'px' }" class="absolute rounded-sm z-10 cursor-pointer" @mousedown.prevent @mouseup.prevent @mousemove.prevent @mouseover="mouseover" @mouseleave="mouseleave" @click="clickCard"> |
3 | 3 | <div :id="`cover-area-${index}`" class="relative w-full top-0 left-0 rounded overflow-hidden z-10 bg-primary box-shadow-book" :style="{ height: coverHeight + 'px ' }">
|
4 | 4 | <!-- When cover image does not fill -->
|
5 | 5 | <div cy-id="coverBg" v-show="showCoverBg" class="absolute top-0 left-0 w-full h-full overflow-hidden rounded-sm bg-primary">
|
|
14 | 14 | </div>
|
15 | 15 |
|
16 | 16 | <div class="w-full h-full absolute top-0 left-0 rounded overflow-hidden z-10">
|
17 |
| - <div cy-id="titleImageNotReady" v-show="libraryItem && !imageReady" class="absolute top-0 left-0 w-full h-full flex items-center justify-center" :style="{ padding: 0.5 + 'em' }"> |
| 17 | + <div cy-id="titleImageNotReady" v-show="libraryItem && !imageReady" aria-hidden="true" class="absolute top-0 left-0 w-full h-full flex items-center justify-center" :style="{ padding: 0.5 + 'em' }"> |
18 | 18 | <p :style="{ fontSize: 0.8 + 'em' }" class="text-gray-300 text-center">{{ title }}</p>
|
19 | 19 | </div>
|
20 | 20 |
|
21 | 21 | <!-- Cover Image -->
|
22 |
| - <img cy-id="coverImage" v-show="libraryItem" ref="cover" :src="bookCoverSrc" class="relative w-full h-full transition-opacity duration-300" :class="showCoverBg ? 'object-contain' : 'object-fill'" @load="imageLoaded" :style="{ opacity: imageReady ? 1 : 0 }" /> |
| 22 | + <img cy-id="coverImage" v-show="libraryItem" :alt="`${displayTitle}, ${$strings.LabelCover}`" ref="cover" aria-hidden="true" :src="bookCoverSrc" class="relative w-full h-full transition-opacity duration-300" :class="showCoverBg ? 'object-contain' : 'object-fill'" @load="imageLoaded" :style="{ opacity: imageReady ? 1 : 0 }" /> |
23 | 23 |
|
24 | 24 | <!-- Placeholder Cover Title & Author -->
|
25 | 25 | <div cy-id="placeholderTitle" v-if="!hasCover" class="absolute top-0 left-0 right-0 bottom-0 w-full h-full flex items-center justify-center" :style="{ padding: placeholderCoverPadding + 'em' }">
|
26 | 26 | <div>
|
27 |
| - <p cy-id="placeholderTitleText" class="text-center" style="color: rgb(247 223 187)" :style="{ fontSize: titleFontSize + 'em' }">{{ titleCleaned }}</p> |
| 27 | + <p cy-id="placeholderTitleText" aria-hidden="true" class="text-center" style="color: rgb(247 223 187)" :style="{ fontSize: titleFontSize + 'em' }">{{ titleCleaned }}</p> |
28 | 28 | </div>
|
29 | 29 | </div>
|
30 | 30 | <div cy-id="placeholderAuthor" v-if="!hasCover" class="absolute left-0 right-0 w-full flex items-center justify-center" :style="{ padding: placeholderCoverPadding + 'em', bottom: authorBottom + 'em' }">
|
31 |
| - <p cy-id="placeholderAuthorText" class="text-center" style="color: rgb(247 223 187); opacity: 0.75" :style="{ fontSize: authorFontSize + 'em' }">{{ authorCleaned }}</p> |
| 31 | + <p cy-id="placeholderAuthorText" aria-hidden="true" class="text-center" style="color: rgb(247 223 187); opacity: 0.75" :style="{ fontSize: authorFontSize + 'em' }">{{ authorCleaned }}</p> |
32 | 32 | </div>
|
33 | 33 |
|
34 | 34 | <div v-if="seriesSequenceList" class="absolute rounded-lg bg-black bg-opacity-90 box-shadow-md z-20 text-right" :style="{ top: 0.375 + 'em', right: 0.375 + 'em', padding: `${0.1}em ${0.25}em` }" style="background-color: #78350f">
|
|
93 | 93 |
|
94 | 94 | <!-- rss feed icon -->
|
95 | 95 | <div cy-id="rssFeed" v-if="rssFeed && !isSelectionMode && !isHovering" class="absolute text-success top-0 left-0 z-10" :style="{ padding: 0.375 + 'em' }">
|
96 |
| - <span class="material-symbols" :style="{ fontSize: 1.5 + 'em' }">rss_feed</span> |
| 96 | + <span class="material-symbols" aria-hidden="true" :style="{ fontSize: 1.5 + 'em' }">rss_feed</span> |
97 | 97 | </div>
|
98 | 98 | <!-- media item shared icon -->
|
99 | 99 | <div cy-id="mediaItemShare" v-if="mediaItemShare && !isSelectionMode && !isHovering" class="absolute text-success left-0 z-10" :style="{ padding: 0.375 + 'em', top: rssFeed ? '2em' : '0px' }">
|
100 |
| - <span class="material-symbols" :style="{ fontSize: 1.5 + 'em' }">public</span> |
| 100 | + <span class="material-symbols" aria-hidden="true" :style="{ fontSize: 1.5 + 'em' }">public</span> |
101 | 101 | </div>
|
102 | 102 |
|
103 | 103 | <!-- Series sequence -->
|
|
114 | 114 |
|
115 | 115 | <!-- Podcast Num Episodes -->
|
116 | 116 | <div cy-id="numEpisodes" v-else-if="!numEpisodesIncomplete && numEpisodes && !isHovering && !isSelectionMode" class="absolute rounded-full bg-black bg-opacity-90 box-shadow-md z-10 flex items-center justify-center" :style="{ top: 0.375 + 'em', right: 0.375 + 'em', width: 1.25 + 'em', height: 1.25 + 'em' }">
|
117 |
| - <p :style="{ fontSize: 0.8 + 'em' }">{{ numEpisodes }}</p> |
| 117 | + <p :style="{ fontSize: 0.8 + 'em' }" role="status" :aria-label="$strings.LabelNumberOfEpisodes">{{ numEpisodes }}</p> |
118 | 118 | </div>
|
119 | 119 |
|
120 | 120 | <!-- Podcast Num Episodes -->
|
|
128 | 128 | <div cy-id="detailBottom" :id="`description-area-${index}`" v-if="isAlternativeBookshelfView || isAuthorBookshelfView" dir="auto" class="relative mt-2e mb-2e left-0 z-50 w-full">
|
129 | 129 | <div :style="{ fontSize: 0.9 + 'em' }">
|
130 | 130 | <ui-tooltip v-if="displayTitle" :text="displayTitle" :disabled="!displayTitleTruncated" direction="bottom" :delayOnShow="500" class="flex items-center">
|
131 |
| - <p cy-id="title" ref="displayTitle" class="truncate">{{ displayTitle }}</p> |
| 131 | + <p cy-id="title" ref="displayTitle" aria-hidden="true" class="truncate">{{ displayTitle }}</p> |
132 | 132 | <widgets-explicit-indicator cy-id="explicitIndicator" v-if="isExplicit" />
|
133 | 133 | </ui-tooltip>
|
134 | 134 | </div>
|
|
138 | 138 | <p cy-id="line2" class="truncate text-gray-400" :style="{ fontSize: 0.8 + 'em' }">{{ displayLineTwo || ' ' }}</p>
|
139 | 139 | <p cy-id="line3" v-if="displaySortLine" class="truncate text-gray-400" :style="{ fontSize: 0.8 + 'em' }">{{ displaySortLine }}</p>
|
140 | 140 | </div>
|
141 |
| - </div> |
| 141 | + </article> |
142 | 142 | </template>
|
143 | 143 |
|
144 | 144 | <script>
|
|
0 commit comments