Improve book info readability, simplify to reading time only
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
### 2026-02-01: 1.0.2
|
### 2026-02-01: 1.0.2
|
||||||
|
|
||||||
* Add reading time and page info to book metadata display
|
* Add reading time to book metadata display
|
||||||
|
* Improve book info readability
|
||||||
|
|
||||||
### 2026-02-01: 1.0.1
|
### 2026-02-01: 1.0.1
|
||||||
|
|
||||||
|
|||||||
+8
-16
@@ -233,9 +233,6 @@ function formatReadingTime(minutes) {
|
|||||||
return `${hours}h ${mins}m`;
|
return `${hours}h ${mins}m`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Words per page (standard estimate)
|
|
||||||
const WORDS_PER_PAGE = 250;
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
// Load settings only once on mount
|
// Load settings only once on mount
|
||||||
const [savedSettings] = useState(() => loadSettings());
|
const [savedSettings] = useState(() => loadSettings());
|
||||||
@@ -676,13 +673,7 @@ function App() {
|
|||||||
<div style={styles.bookAuthor}>{bookMetadata.author}</div>
|
<div style={styles.bookAuthor}>{bookMetadata.author}</div>
|
||||||
)}
|
)}
|
||||||
<div style={styles.bookStats}>
|
<div style={styles.bookStats}>
|
||||||
{(() => {
|
{formatReadingTime((words.length - currentIndex) / wpm)} left
|
||||||
const currentPage = Math.floor(currentIndex / WORDS_PER_PAGE) + 1;
|
|
||||||
const totalPages = Math.max(1, Math.ceil(words.length / WORDS_PER_PAGE));
|
|
||||||
const remainingWords = words.length - currentIndex;
|
|
||||||
const remainingMinutes = remainingWords / wpm;
|
|
||||||
return `Page ${currentPage}/${totalPages} · ${formatReadingTime(remainingMinutes)} left`;
|
|
||||||
})()}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1325,23 +1316,24 @@ const styles = {
|
|||||||
minWidth: 0,
|
minWidth: 0,
|
||||||
},
|
},
|
||||||
bookTitle: {
|
bookTitle: {
|
||||||
fontSize: "0.75rem",
|
fontSize: "0.8rem",
|
||||||
fontWeight: "500",
|
fontWeight: "500",
|
||||||
color: "#888",
|
color: "#999",
|
||||||
whiteSpace: "nowrap",
|
whiteSpace: "nowrap",
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
textOverflow: "ellipsis",
|
textOverflow: "ellipsis",
|
||||||
|
marginBottom: "2px",
|
||||||
},
|
},
|
||||||
bookAuthor: {
|
bookAuthor: {
|
||||||
fontSize: "0.7rem",
|
fontSize: "0.75rem",
|
||||||
color: "#555",
|
color: "#666",
|
||||||
whiteSpace: "nowrap",
|
whiteSpace: "nowrap",
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
textOverflow: "ellipsis",
|
textOverflow: "ellipsis",
|
||||||
},
|
},
|
||||||
bookStats: {
|
bookStats: {
|
||||||
fontSize: "0.65rem",
|
fontSize: "0.7rem",
|
||||||
color: "#444",
|
color: "#555",
|
||||||
marginTop: "2px",
|
marginTop: "2px",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user