Fork of Chiri for Astro for my blog
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: correct star display for NeoDB cards

the3ash 157ade17 18a98d5f

+4 -4
+4 -4
src/components/ui/NeoDBCard.astro
··· 42 42 const coverClass = isSquare ? 'music' : 'other' 43 43 const cardHeightClass = isSquare ? 'compact' : 'standard' 44 44 45 - // Round rating to the nearest half-star: 1 point = 0.5 star 46 - const roundedRating = itemRating !== null ? Math.round(itemRating * 2) / 2 : null 45 + // Convert rating to star percentage with half-star precision: 10 points = 100% (5 stars) 46 + const starPercentage = itemRating !== null ? Math.round((itemRating / 10) * 10) * 10 : null 47 47 48 48 // Build field info 49 49 const fieldInfo = [] ··· 127 127 <div class="neodb-info"> 128 128 <div class="neodb-title">${title || ''}</div> 129 129 ${ 130 - roundedRating !== null 130 + starPercentage !== null 131 131 ? `<div class="rating"> 132 132 <span class="allstarbg"> 133 - <span class="allstarfg" style="width:${(roundedRating / 10) * 100}%"></span> 133 + <span class="allstarfg" style="width:${starPercentage}%"></span> 134 134 </span> 135 135 <span class="rating_nums">${itemRating.toFixed(1)}</span> 136 136 </div>`