A beautiful, responsive web application that transforms markdown documents into an immersive digital book reading experience. Built with React, TypeScript, and Tailwind CSS.
- Realistic page flipping animations with 3D effects
- Dual-page spread on desktop, single page on mobile
- Beautiful book cover with support for custom cover images
- Responsive design that works perfectly on all devices
- Automatic pagination based on content length and reading comfort
- Intelligent chapter detection from markdown headings (H2, H3, H4, etc.)
- Hierarchical table of contents with proper nesting
- Progress tracking with visual progress bar
- Apple-level design aesthetics with attention to detail
- Smooth animations and micro-interactions
- Professional typography optimized for reading
- Warm, book-like color scheme (amber/orange palette)
- Keyboard navigation (arrow keys, space, home, escape)
- Touch/swipe support for mobile devices
- Fullscreen mode for distraction-free reading
- Purchase integration for commercial books
- SEO optimized with proper meta tags and structured data
- React 18 with TypeScript for type safety
- Tailwind CSS for responsive, utility-first styling
- Vite for fast development and building
- Lucide React for beautiful, consistent icons
- Custom markdown parser for intelligent content processing
src/
βββ components/ # Reusable UI components
β βββ BookReader.tsx # Main reader component with state management
β βββ BookCover.tsx # Animated book cover with hover effects
β βββ BookPage.tsx # Individual page with content formatting
β βββ NavigationControls.tsx # Control buttons and page counter
β βββ TableOfContents.tsx # Hierarchical chapter navigation
β βββ ProgressBar.tsx # Reading progress indicator
β βββ PurchaseModal.tsx # Purchase call-to-action modal
βββ utils/
β βββ markdownParser.ts # Smart content parsing and pagination
βββ types/
β βββ book.ts # TypeScript interfaces for type safety
βββ data/
β βββ manuscript.md # Sample book content with frontmatter
βββ App.tsx # Root component with loading states
- Node.js 16+
- npm or yarn
-
Clone the repository
git clone <repository-url> cd interactive-flip-book-reader
-
Install dependencies
npm install
-
Start development server
npm run dev
-
Open in browser Navigate to
http://localhost:5173
npm run build
npm run preview # Preview the built app locally
Configure your book using YAML frontmatter at the top of your markdown file:
---
title: Your Book Title
subtitle: Optional Subtitle
author: Author Name
cover_image: /cover.jpg
purchase_link: https://example.com/buy
purchase_text: Compelling purchase description
price: $29.99
---
Replace cover.jpg file in the public folder for book cover design.
Use markdown headings to create chapters and sections:
## Chapter 1: Introduction {#introduction}
Content for chapter 1...
### Section 1.1: Getting Started {#getting-started}
Subsection content...
#### Subsection 1.1.1: Details {#details}
More detailed content...
- Headings (H1-H6) with automatic styling
- Bold and italic text formatting
- Paragraphs with proper spacing
- Custom IDs for chapters using
{#id}
syntax - Automatic pagination based on content length
The app uses Tailwind CSS with a custom amber/orange color scheme. Key design elements:
- Color Palette: Warm amber tones for a classic book feel
- Typography: Serif fonts for headings, sans-serif for body text
- Spacing: 8px grid system for consistent layout
- Responsive: Mobile-first design with desktop enhancements
- Words per page: ~280 words (adjustable in
markdownParser.ts
) - Chapter detection: Automatic from H2+ headings
- Page breaks: Smart pagination preserving content flow
- Mobile optimization: Single-page view with stacked page effects
// In markdownParser.ts
private static readonly WORDS_PER_PAGE = 280;
private static readonly LINES_PER_PAGE = 25;
Enable commercial features by adding purchase information to frontmatter:
- Automatic purchase modal on last page
- Customizable call-to-action text
- External link integration
- Modern browsers: Chrome 80+, Firefox 80+, Safari 14+, Edge 80+
- Mobile devices: iOS Safari 14+, Android Chrome 80+
- Features: CSS Grid, Flexbox, CSS Transforms, ES2020
- Digital book publishing with professional presentation
- Documentation sites with enhanced readability
- Educational content with engaging navigation
- Marketing materials with integrated purchase flows
- Portfolio presentations in book format
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is open source and available under the MIT License.
If you find this project helpful:
- β Star the repository
- π Report bugs via GitHub issues
- π‘ Suggest features or improvements
- π Submit pull requests
The project is optimized for deployment on:
- Netlify (recommended)
- Vercel
- GitHub Pages
- Any static hosting service
- Build the project:
npm run build
- Deploy the
dist
folder to Netlify - Configure custom domain if needed
Made with β€οΈ for the love of beautiful digital reading experiences