A quiet, interactive sketchbook built with React and Three.js, with desktop spreads and curled paper on mobile.
| Desktop | Mobile & tablet |
|---|---|
![]() |
![]() |
All sketches were generated with AI for this demo. The cover texture is AI-generated too.
- Two-page 3D desktop spreads with a sculpted binding gutter, curved paper, separate black covers, draggable corners and keyboard navigation.
- A folded-paper mobile reader with tap, swipe, hold and grouped rapid turns.
- An unprinted charcoal cover, 4:5 pages, rounded opening corners and subtle lighting.
- Reduced-motion support, accessible page announcements and a DOM fallback when WebGL is unavailable.
Both layouts share the same Three.js paper material, textures and lighting. The covers open and close independently of the paper stack. The layout switches at 768 px. This is a frontend-only demo with no backend or persistent storage.
To make your own book, fork this repository into your GitHub account first. Customize and publish your fork; the original repository is maintained by Niyas.
Requires Node.js 22 or newer and npm.
git clone https://github.com/YOUR-USERNAME/sketchbook.git
cd sketchbook
npm ci
npm run devUse npm run dev -- --host 0.0.0.0 to preview on a phone on the same network.
npm run build
npm run previewThe production files are generated in dist/.
Use the side chevrons or keyboard arrow keys. Desktop also supports dragging page corners. On mobile, tap or swipe to turn; rapid clicks and holding turn groups of pages. Focus the mobile book to use Enter, Space, Home and End.
- Artwork: add images to
public/sketches/ink/and edit the image paths and alt text insrc/sketch/sketches.ts. - Pages: edit
src/sketch/SketchPage.tsxfor the layout shared by both readers. - Cover: replace
public/textures/charcoal-paper.png. - Appearance: adjust
src/styles/book.cssandsrc/styles/sketchbook.css. - Motion: mobile timing lives in
src/components/mobile-book-motion.ts; desktop settings are insrc/sketch/DesktopSketchbook.tsx.
Update the disclosure in src/sketch/Sketchbook.tsx if you replace the demo artwork.
The included GitHub Actions workflow builds and deploys main to GitHub Pages. The Pages asset base is /sketchbook/; local development uses /.
GITHUB_PAGES=true npm run build
GITHUB_PAGES=true npm run previewOpen /sketchbook/ on the preview server. In your fork, enable GitHub Actions and select Settings → Pages → Build and deployment → Source → GitHub Actions. If you rename the repository, update the Pages base in vite.config.ts to match. Your published book will be at https://YOUR-USERNAME.github.io/YOUR-REPOSITORY/.
For improvements to the shared project, open a pull request from your fork. Changes to main require a pull request, a successful Verify build check and resolved review conversations. Only the maintainer has write access to this repository.
Code is licensed under MIT. Dependencies retain their own licenses.
The navigation chevrons are from the free Pikaicons Stroke set by Ashish Kashyap: Pikaicons · icon license. These icons retain their own license and are not covered by this repository's MIT license.

