Posted in CSS Animations
2571
1:17 am, April 23, 2022

Pure CSS 3D Flipping Book with Animations

What is Pure CSS 3D Flipping Book?

Pure CSS 3D Flipping Book is a pure CSS and HTML flipping book animation that you can use to display content in a virtual book format.

Preview


a preview of Pure CSS 3D Flipping Book 

About the CSS Transform Property

CSS3's transform property allows you to modify the coordinate space of the CSS visual formatting model. Using it, elements can be translated, rotated, scaled, and skewed.  

The coordinate space of an element is the space in which its position and size are calculated. Normally, the position and size of an element are calculated in the coordinate space of its parent element, but the transform property allows you to change that.  

For example, if you translate an element by 50px to the right and 100px down, its position will be calculated as if it were 50px to the right and 100px down from its parent element.

Pure CSS 3D Flipping Book with Animations Demo

View Demo Full Screen View Demo New Tab

Pure CSS 3D Flipping Book with Animations Code

HTML

<div class="book">
  <!-- For Next/Prev Controls -->
  <input type="checkbox" id="c1">
  <input type="checkbox" id="c2">
  <input type="checkbox" id="c3">
  <!-- Book Cover -->
  <div id="cover">
    <img src="https://picsum.photos/250/400?random=0.1285591640803374" alt="Cover">
  </div>
  <!-- Pages -->
  <div class="flip-book">
    <!-- Page 1 -->
    <div class="flip" id="p1">
      <div class="back">
        <img src="https://picsum.photos/250/400?random=0.2" alt="">
        <label for="c1" class="back-btn">Before</label>
      </div>
      <div class="front">
        <h2>Page 1</h2>
        <label for="c1" class="next-btn">NEXT</label>
      </div>
    </div>
    <!-- Page 2 -->
    <div class="flip" id="p2">
      <div class="back">
        <img src="https://picsum.photos/250/400?random=0.3" alt="">
        <label for="c2" class="back-btn">Before</label>
      </div>
      <div class="front">
        <h2>Page 2</h2>
        <label for="c2" class="next-btn">NEXT</label>
      </div>
    </div>
    <!-- Page 3 -->
    <div class="flip" id="p3">
      <div class="back">
        <label for="c3" class="back-btn">Before</label>
      </div>
      <div class="front">
        <h2>Page 3</h2>
        <label for="c3" class="next-btn">NEXT</label>
      </div>
    </div>
  </div>
</div>

CSS

.book {
  display: flex;
}
#cover {
  width: 250px;
  height: 400px;
}
.flip-book {
  width: 250px;
  height: 400px;
  position: relative;
  perspective: 1500px;
}
.flip {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: left;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: .5s;
  color: #000;
}
.front {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: #fff;
  box-sizing: border-box;
  padding: 0 13px;
}
.back {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 99;
  transform: rotateY(180deg);
  backface-visibility: hidden;
  background-color: #000;
}
.next-btn {
  position: absolute;
  bottom: 13px;
  right: 13px;
  cursor: pointer;
  color: #000;
}
.back-btn {
  position: absolute;
  bottom: 13px;
  right: 13px;
  cursor: pointer;
  color: #fff;
}
#p1 {
  z-index: 3;
}
#p2 {
  z-index: 2;
}
#p3 {
  z-index: 1;
}
#c1:checked ~ .flip-book #p1 {
  transform: rotateY(-180deg);
  z-index: 1;
}
#c2:checked ~ .flip-book #p2 {
  transform: rotateY(-180deg);
  z-index: 2;
}
#c3:checked ~ .flip-book #p3 {
  transform: rotateY(-180deg);
  z-index: 3;
}

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Code
Search Code by entering your search text above.
Welcome to CSSBundle.com

Hi there and welcome to CSSBundle. Here at CSS Bundle we aim to find the best css and javascript bundles and demos and add them here to make them easy to find all in one place.

If you would like to stay up to date with our latest updates you can subscribe to our mailing list where we will send you one email per week with the latest updates, no spam emails just the latest updates.

Random Quote


Latest Code
CSS Tools Fancy Border Radius CSS Generator Tool - spin animation keyframes CSS Tools CSS Drop Filter Shadow Creator CSS Slider A CSS and HTML Only Carousel Slider CSS Z-Index Z-Index Code Front - CSS to change z-index when element is active sections section with image to the right text to the left gradient Sections Two Clickable Logo Promo Box Section Foundation HTML CSS Sections Inline Contact Form Formatting HTML CSS Sections Overview full width section in Poppins font with light gray background using foundation Interactive Images Map Image with Easy Dots and Titles using only CSS HTML Sections Social Header Links easy Drop in Code with Font Awesome Icons Sections Responsive Friendly Subscribe to our Newsletter Section CSS Tips Create a button with CSS, HTML and Center it! CSS Text Formatting Truncate Text to an amount of lines using line-clamp CSS Positions Item Positioning in CSS CSS Tips Draw a Circle in CSS css animations Magical Text Effect Bootstrap 4.2 Kitchen Sink CSS Frameworks Make your site look like windows 7 CSS Backgrounds Fancy up your banner image hero sections using overlay gradients CSS Modal Floating Modal Message Fixed on the Bottom of the Screen CSS Modal Create a modal with only CSS css grid display items in a css grid CSS Text Effects Using the selection selector to change the default highlight color Text Truncate your Text with CSS CSS Cursors Change your cursor into an Emoji Cursor or Image Cursor CSS How to Center Everything or Anything with CSS CSS Animations Smooth Scrolling with just CSS CSS Animations Radial Glow under cursor on box hover over effect CSS Shadows Using a filter drop shadow for transparent images CSS Animations Pure CSS 3D Flipping Book with Animations CSS Create a checkerboard background pattern with CSS CSS Animations button animations hover and fill animation CSS Animations button on focus swing animation CSS Animations Animated Button Border when Active Quick CSS create a border with top triangle in css CSS Animations Single Element CSS Spinners CSS Animations CSS Shake - Shake up your elements CSS Framework NES-style(8bit-like) CSS Framework CSS Tips Why to use a CSS Reset? Web Developer Checklists Front-End Checklist Icons Font Awesome Icons CSS Animation Animate Stuff with Animate.css CSS Animations Check Wave Click a Checkbox and Watch the Animation Animation Cloudy spiral animation with CSS3 Notifications Toast Messages and Notifications Standalone Library no JQuery - notify.js Image Zoom Silky Smooth Image Zoom and Lightbox CSS Animations CSS Typing Effect using just CSS css framework A tiny, modern, responsive, 12-column grid system built using CSS Grid Layout Loading Animation Pure CSS Loading Spinner CSS Reset A fresh new and super tiny CSS Reset