Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/pink-crab/book-viewer-block/releases/download/1.0.0/book-viewer-block.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
A Gutenberg block for displaying images as a flipable book with realistic page-turn effects.
If you want to install this plugin, DON'T DOWNLOAD THIS REPO. You can download the latest stable version from the releases page or just click here.
Features
- Realistic page-flip animations powered by StPageFlip
- Front and back cover support
- Drag-and-drop page reordering in the editor
- Insert blank pages anywhere in the book
- Full-screen viewing mode
- Zoom functionality on individual pages
- Responsive design (single-page view on mobile, two-page spread on desktop)
- CSS fallback for no-JavaScript environments
- Lazy loading with IntersectionObserver
- Customisable page dimensions
- Customisable padding/border colour
Requirements
- WordPress 6.0 or higher
- PHP 7.4 or higher
Installation
- Download the latest release from the releases page
- Upload the
pinkcrab-book-blockfolder to your/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Add the "Book Viewer" block to any post or page
Usage
- Add the Book Viewer block to your post or page
- Click "Select Pages" to choose images from your Media Library
- Optionally set front and back covers in the block sidebar
- Adjust page dimensions and padding colour as needed
- Drag and drop pages to reorder them
- Add blank pages where needed
Building
Run npm install to install all the Node.js dependencies.
Below you will find some information on how to run scripts.
npm start
- Use to compile and run the block in development mode.
- Watches for any changes and reports back any errors in your code.
npm run build
- Use to build production code for your block inside
buildfolder. - Runs once and reports back the gzip file sizes of the produced code.
Changelog
1.0.0
- Initial release
License
GPL-2.0-or-later
Credits
- Page flip animation: StPageFlip by Nickolay Odintsov
- Drag and drop: dnd kit
Author
Glynn Quelch
- Website: glynnquelch.co.uk
- GitHub: @Pink-Crab
Releases
3 releases. Each count is every asset in that release; expand a row for the breakdown.