Improve mobile responsiveness and book metadata layout

This commit is contained in:
Roni Laukkarinen
2026-02-01 18:21:42 +02:00
parent 2745d5c417
commit 92e4fa8fba
5 changed files with 76 additions and 39 deletions
+4
View File
@@ -1,3 +1,7 @@
### 2026-02-01: 1.0.4
* Improve mobile responsiveness and book metadata layout
### 2026-02-01: 1.0.3 ### 2026-02-01: 1.0.3
* Add mobile responsiveness * Add mobile responsiveness
+1 -1
View File
@@ -1,6 +1,6 @@
# ⚡ Speed reader # ⚡ Speed reader
![Version](https://img.shields.io/badge/version-1.0.3-blue?style=for-the-badge) ![Version](https://img.shields.io/badge/version-1.0.4-blue?style=for-the-badge)
![React](https://img.shields.io/badge/React-61DAFB?style=for-the-badge&logo=react&logoColor=black) ![React](https://img.shields.io/badge/React-61DAFB?style=for-the-badge&logo=react&logoColor=black)
![Vite](https://img.shields.io/badge/Vite-646CFF?style=for-the-badge&logo=vite&logoColor=white) ![Vite](https://img.shields.io/badge/Vite-646CFF?style=for-the-badge&logo=vite&logoColor=white)
![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black) ![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "rsvp-speed-reader", "name": "rsvp-speed-reader",
"private": true, "private": true,
"version": "1.0.3", "version": "1.0.4",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
+2 -5
View File
@@ -719,7 +719,6 @@ function App() {
<kbd style={styles.kbd}></kbd> speed <kbd style={styles.kbd}></kbd> speed
<kbd style={styles.kbd}>R</kbd> reset <kbd style={styles.kbd}>R</kbd> reset
</div> </div>
</div>
{/* Book metadata display */} {/* Book metadata display */}
{bookMetadata && (bookMetadata.title || bookMetadata.cover) && ( {bookMetadata && (bookMetadata.title || bookMetadata.cover) && (
@@ -745,6 +744,7 @@ function App() {
</div> </div>
</aside> </aside>
)} )}
</div>
{/* Keyboard shortcuts modal */} {/* Keyboard shortcuts modal */}
{showShortcuts && ( {showShortcuts && (
@@ -1432,14 +1432,11 @@ const styles = {
// Book metadata // Book metadata
bookMetadata: { bookMetadata: {
position: "fixed",
bottom: "20px",
left: "20px",
display: "flex", display: "flex",
alignItems: "flex-end", alignItems: "flex-end",
gap: "12px", gap: "12px",
maxWidth: "280px", maxWidth: "280px",
zIndex: 50, marginTop: "16px",
}, },
bookCover: { bookCover: {
width: "48px", width: "48px",
+45 -9
View File
@@ -48,7 +48,25 @@ button:active {
color: #ccc !important; color: #ccc !important;
} }
/* Desktop: fixed book metadata */
@media (min-width: 866px) {
.book-metadata {
position: fixed !important;
bottom: 20px !important;
left: 20px !important;
margin-top: 0 !important;
z-index: 50;
}
}
/* Mobile responsiveness */ /* Mobile responsiveness */
@media (max-width: 865px) {
/* Controls margin */
.bottom-area > div:first-child {
margin-bottom: 10px !important;
}
}
@media (max-width: 600px) { @media (max-width: 600px) {
/* Hide text labels on buttons */ /* Hide text labels on buttons */
.icon-btn span, .icon-btn span,
@@ -58,7 +76,7 @@ button:active {
/* Reduce top bar padding */ /* Reduce top bar padding */
.top-bar { .top-bar {
padding: 12px 16px !important; padding: 12px 5px !important;
} }
/* Smaller WPM display */ /* Smaller WPM display */
@@ -99,9 +117,8 @@ button:active {
/* Smaller book metadata */ /* Smaller book metadata */
.book-metadata { .book-metadata {
max-width: 200px !important; max-width: 100% !important;
bottom: 12px !important; justify-content: center;
left: 12px !important;
} }
.book-cover { .book-cover {
@@ -128,6 +145,30 @@ button:active {
} }
} }
@media (max-width: 480px) {
/* Book metadata left aligned */
.book-metadata {
justify-content: flex-start !important;
margin-top: 6px !important;
}
/* Reading area vertical centering */
.main-area {
position: relative;
top: 20px;
}
/* WPM selection centered, compact */
.wpm-control {
gap: 0 !important;
}
.wpm-btn {
padding-left: 5px !important;
padding-right: 5px !important;
}
}
@media (max-width: 400px) { @media (max-width: 400px) {
/* Even smaller word display for very small screens */ /* Even smaller word display for very small screens */
.word-display { .word-display {
@@ -137,9 +178,4 @@ button:active {
.word-container { .word-container {
height: 80px !important; height: 80px !important;
} }
/* Hide book metadata on very small screens */
.book-metadata {
display: none !important;
}
} }