Skip to content

A beautiful, responsive web application that transforms markdown documents into an immersive digital book reading experience.

Notifications You must be signed in to change notification settings

raj5ve/Markdown-Flipbook

Β 
Β 

Repository files navigation

πŸ“– Interactive Flip Book Reader

A beautiful, responsive web application that transforms markdown documents into an immersive digital book reading experience. Built with React, TypeScript, and Tailwind CSS.

Interactive Flip Book Reader

✨ Features

πŸ“š Immersive Reading Experience

  • 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

🎯 Smart Content Management

  • 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

🎨 Premium Design

  • 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)

πŸš€ Advanced Features

  • 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

πŸ› οΈ Technical Stack

  • 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

πŸ“ Project Structure

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

πŸš€ Getting Started

Prerequisites

  • Node.js 16+
  • npm or yarn

Installation

  1. Clone the repository

    git clone <repository-url>
    cd interactive-flip-book-reader
  2. Install dependencies

    npm install
  3. Start development server

    npm run dev
  4. Open in browser Navigate to http://localhost:5173

Building for Production

npm run build
npm run preview  # Preview the built app locally

πŸ“ Content Configuration

Markdown Frontmatter

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.

Chapter Structure

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...

Supported Markdown Features

  • 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

🎨 Customization

Styling

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

Content Adaptation

  • 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

πŸ”§ Configuration Options

Parser Settings

// In markdownParser.ts
private static readonly WORDS_PER_PAGE = 280;
private static readonly LINES_PER_PAGE = 25;

Purchase Integration

Enable commercial features by adding purchase information to frontmatter:

  • Automatic purchase modal on last page
  • Customizable call-to-action text
  • External link integration

πŸ“± Browser Support

  • 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

🎯 Use Cases

  • 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

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is open source and available under the MIT License.

πŸ™‹β€β™‚οΈ Support

If you find this project helpful:

  • ⭐ Star the repository
  • πŸ› Report bugs via GitHub issues
  • πŸ’‘ Suggest features or improvements
  • πŸ”€ Submit pull requests

πŸš€ Deployment

The project is optimized for deployment on:

  • Netlify (recommended)
  • Vercel
  • GitHub Pages
  • Any static hosting service

Netlify Deployment

  1. Build the project: npm run build
  2. Deploy the dist folder to Netlify
  3. Configure custom domain if needed

Made with ❀️ for the love of beautiful digital reading experiences

About

A beautiful, responsive web application that transforms markdown documents into an immersive digital book reading experience.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 93.5%
  • HTML 4.4%
  • JavaScript 2.0%
  • CSS 0.1%