Repository navigation
feat: add estimated reading time for books (#606) - #1089
Open
aarushii25 wants to merge 1 commit into
Open
aarushii25 wants to merge 1 commit into
aarushii25 wants to merge 1 commit into
Conversation
✅ Deploy Preview for bibliodrift-dm ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📖 feat: Add Estimated Reading Time for Books (Fixes #606)
Hey @devanshi14malhotra! I've implemented the estimated reading time feature as described in Issue #606. Here's a full breakdown:
📋 What Was Done
Added a frontend-only estimated reading time system that calculates and displays how long a book will take to read, updating dynamically based on reading progress.
🗂️ Files Changed
New File:
frontend/js/readingTime.js— Reusable utility with three exported functions:calcReadingTime(pageCount)— total reading time from page countcalcRemainingTime(pageCount, progressPercent)— time left based on progressformatReadingTime(minutes)— formats minutes into human-readable labelModified Files:
frontend/pages/library.html— Added reading time stat item in book detail modal'sbook-stats-rowfrontend/js/library-3d.js— Reading time badge on book spine + modal populationfrontend/js/app.js— Reading time badge on book back face cardsfrontend/css/style.css— Styled.reading-time-badgeand.reading-time-remainingbadges✅ Formula Used
🎯 Where It Appears
Book Detail Modal — "Est. Reading Time" shown in stats row. For books being currently read, shows "X hrs left" based on progress percentage.
Book Spine (3D shelf) — Small vertical time badge on the spine face.
Book Back Face (Discovery cards) — Badge showing total time or remaining time.
📱 Behavior
🔗 Related
Closes #606
GSSoC'26 contribution — frontend assigned to @aarushii25
Let me know if any adjustments are needed! 🙏