stevec.dev

2024.
portfolio

Responsive

Fully responsive CSS flip book, thanks to the cqmin unit.

Even more, the book height is dicated by the amount of content in the tallest page. The only thing you need to take care of is how much text you put into a page.

Img 1

JS at its minimum

JavaScript is at its minimum. Basically it's only used to set the initial page index and assign click listeners to the pages. Modifies the CSS Var for the current page, and the rest is handled entirely by CSS.

Crafting CSS magic

The opened (viewing) pages of the flip book are always kept at the same elevation. This is necessary if your book has no inclination (is top-down-view). Have you noticed that you can also click on the pages edge? CSS will nicely animate the group of pages to skip with a staggered animation.

Like in this demo, you can change the perspective of the parent container and change the X axis rotation of the book for extra effect.

The necessary FlipBook's CSS is barely 30 lines, there is no swipe, natural page flip angling, complex shadows, etc. in order to keep it as simple as possible.

Img 2

That's Ali, folks

Steve Campbell