A bookstore app home screen built with plain CSS and vanilla JavaScript: a currently reading card with progress, genre chips, a bestseller row of CSS-drawn book covers and a bottom tab bar. The warm paper background, oxblood accent and Libre Caslon headings give this book shop app UI a calm, literary feel. It is an HTML mobile template for mobile sites and PWAs, and it can be packaged as a native app with Capacitor.
How it works
The root .bsh-app is a 430 px app column. The sticky .bsh-top bar holds the wordmark, search and the bag button with its .bsh-badge counter.
The .bsh-reading card shows the book in progress next to a small .bsh-cover--sm cover. The script writes a greeting into [data-bsh-greeting] and a start date, computed from today and shown without a year, into [data-bsh-started]. Update opens the .bsh-sheet bottom sheet: a page stepper ([data-bsh-step]), a number input and a range slider stay in sync, and the hint estimates a finish date at 25 pages a day. Saving validates the page, then updates the role="progressbar", the percentage and the page number.
The .bsh-chips buttons filter the .bsh-row of bestsellers by their data-genre value, update the title count and show .bsh-empty when nothing matches. Each .bsh-add button toggles aria-pressed and the bag badge. Covers are pure CSS: .bsh-cover draws the spine, the inner frame and a ribbon with the chart rank.
Customization
--bsh-accenton.bsh-app: oxblood colour of buttons, progress bar, focus rings and badges.--bsh-paperand--bsh-card: page and card backgrounds.--bsh-serif/--bsh-sans: swap Libre Caslon Text and Source Sans 3 for your brand fonts.- Add a colour class like
.bsh-c-teal(it sets--bsh-coverand--bsh-cover-ink) to create new cover styles, or replace the cover div with an<img>of real cover art. TOTAL_PAGESandPACEinscript.js: book length and the reading pace used for the finish estimate.data-genreon.bsh-bookplus a matchingdata-bsh-genrechip: add new genres.--bsh-radius: the 10 px corner radius used on cards, buttons and the tab bar.
Use cases
- Online bookstores: a mobile home that mixes personal reading with bestseller sales.
- E-book and audiobook apps: resume the current title and log progress in a bottom sheet.
- Reading tracker and book club PWAs: show streaks, shelves and finish estimates.
Accessibility
Chips and add buttons use aria-pressed; the bottom tab bar marks the current tab with aria-current="page". The bottom sheet is a role="dialog" with aria-modal, traps Tab focus, closes with Escape, the close button or a backdrop tap, and returns focus to the trigger. Invalid pages set aria-invalid and show an error. A polite role="status" region announces filter results, bag changes and saved progress. All touch targets are at least 44 px and focus rings use the accent colour. The sheet animation is turned off for prefers-reduced-motion. The progress save is local; call fetch() in the form's submit handler to sync it with your backend.