Book Flip Animation | CSS ANIMATION | #untoldcoding Best Css Effect

 Book Flip Animation | CSS ANIMATION | #untoldcoding Best Css Effect


Live Demo :  Click here

1. HTML Code :

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=
    device-width, initial-scale=1.0" />
    <title>Book Flip Animation |
    UntoldCoding</title>
    <link rel="stylesheet" href="style.css" />
    <link
      rel="stylesheet"
      href="path/to/font-awesome/
    css/font-awesome.min.css"
    />
  </head>
  <body>
    <div class="container">
      <div class="name">UntoldCoding
    </div>
      <div class="layout">
        <div class="notification-
    header">
          <div class="time">9:41</div>
          <div class="necessities">
          <i class="fas fa-signal"></i>
            <i class="fas fa-wifi">
    <img src="./icons8-wifi-30.png"
    alt="" srcset=""/></i>
       <i class="fas fa-battery-full">
    <img
                width="30"
                height="30"
                src="https://img.icons8.com/
    ios-glyphs/30/000000/full-battery.png"
                alt="full-battery"/></i>
          </div>
        </div>
        <div class="actions">
     <i class="fas fa-chevron-left"></i>
          <i class="fas fa-bookmark"></i>
        </div>
        <div class="book-cover">
          <img class="book-top"
   src="./bg.png" alt="book-top" />
          <img class="book-side"
    src="./book-side.svg" alt="book-side" />
        </div>
        <div class="UntoldCoding">
          <div class="content">
            <div class="header">
              <div class="title">
    Journey of Web Developer</div>
              <div class="icon">
       <i class="fas fa-chevron-down"></i>
              </div>
            </div>
            <div class="author">by
    UntoldCoding</div>
            <div class="body">
              <!--Full code on telegram-->
              <p>
    Becoming a web developer is an exciting
     journey, but it can also
    be challenging. There is a lot to learn,
     and the field is
    constantly evolving. However, if you
    are passionate about
    building websites and applications,
    the rewards can be great.
              </p>
              <p>
                Becoming a web developer is a
    rewarding journey. With hard work
                and dedication, you can achieve
     your goals and build a
                successful career in
    web development.
              </p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

2. CSS Code :

* {
  border: 0;
  margin: 0;
  box-sizing: border-box;
}

:root {
  --mobile-width: 325px;
  --mobile-height: 650px;
  --mobile-radius: 25px;
  --separator-height: 500px;
  --bg: #010101;
  --mobile-bg: #11f0e1;
  --intro-bg: #555558;
  --font-color: #000000;
  --transition: transform 0.7s
     ease-in-out;
}

.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
}

.name {
  font-family: "Quicksand",
     sans-serif;
  font-family: "Open Sans",
     sans-serif;
  font-style: italic;
  font-size: 26px;
  margin-top: 10px;
  color: white;
}

.layout {
  width: var(--mobile-width);
  height: var(--mobile-height);
  margin: 30px 0;
  border-radius: var(--mobile-radius);
  perspective: 500px;
  overflow: hidden;
  color: var(--font-color);
  background: linear-gradient
    (#5de0e6, #004aad);
  box-shadow: 0 0 20px 1px
    #1ba5b5d1;
}
.layout .notification-header {
  position: fixed;
  top: 5px;
  width: 100%;
  padding: 5px 15px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-family: "Open Sans",
     sans-serif;
  font-weight: bold;
  z-index: 6;
}
.layout .actions {
  position: fixed;
  top: 37px;
  width: 100%;
  padding: 50px;
  display: flex;
  justify-content: space-between;
  font-size: 20px;
  z-index: 6;
}
.layout .book-cover {
  position: relative;
  height: var(--separator-height);
  width: calc(var(--mobile-width) * 2);
  left: -52.5%;
  border-top-left-radius:
    var(--mobile-radius);
  border-top-right-radius:
    var(--mobile-radius);
  background-color: var(--intro-bg);
  transform-style: preserve-3d;
  transform-origin: 50% 40%;
  transition: var(--transition);
  z-index: 4;
}
.layout .book-top {
  width: 170px;
  position: absolute;
  top: 180px;
  left: 250px;
  z-index: 5;
  transform: translateZ(28.5px);
}
.layout .book-side {
  position: absolute;
  top: 430px;
  left: 222px;
  transform: translateY(-15px)
    translateX(0px) translateZ(15px)
    rotateX(104deg);
}
.layout .book-cover:hover {
  transform: rotateX(75deg)
    translateZ(3px) scale(0.75);
}
.layout .book-cover:hover + .UntoldCoding {
  transform: translateY(-302px);
}
.layout .book-cover:hover +
    .UntoldCoding .icon {
  transform: rotateX(180deg);
}
.layout .UntoldCoding {
  height: var(--separator-height);
  padding: 50px;
  transition: var(--transition);
  background: white;
}
.layout .UntoldCoding .header {
  display: flex;
  align-items: center;
}
.layout .UntoldCoding .title {
  font-family: "Quicksand", sans-serif;
  font-size: 26px;
  margin-bottom: 10px;
}
.layout .UntoldCoding .author {
  font-family: "Open Sans", sans-serif;
  font-style: italic;
  margin-bottom: 20px;
}
.layout .UntoldCoding .icon {
  transform-origin: top;
  transition: var(--transition);
}
.layout .UntoldCoding .body {
  font-family: "Quicksand", sans-serif;
}
.layout .UntoldCoding .body
    p:first-child {
  margin-bottom: 15px;
}

Want to Download the Source Code : Click here

Join us on Telegram : Click here.

Join with us YouTube : Click here.

Join with us Instagram: Click here.

FAQs (Frequently Asked Questions) on Book Flip Animation with CSS

1. What is a Book Flip Animation with CSS?

A Book Flip Animation with CSS is a visual effect created using Cascading Style Sheets (CSS) to simulate the flipping of pages in a book. This animation technique mimics the physical motion of turning pages in a book, adding a realistic and interactive element to digital content such as e-books, online magazines, or website interfaces.

2. How does the Book Flip Animation with CSS work?

The Book Flip Animation with CSS utilizes CSS animations and transitions to manipulate the appearance and position of two-dimensional shapes representing the pages of a book. By adjusting properties such as rotation, perspective, and opacity, CSS transforms create the illusion of pages flipping from one side to another, simulating the motion of turning pages in a physical book.

3. What are the key components required to create a Book Flip Animation with CSS?

To create a Book Flip Animation with CSS, you'll need:

  • HTML structure: Defines the content of the book, including individual pages represented as HTML elements.
  • CSS styling: Applies visual styles to the book pages, such as size, background color, border, and shadow effects.
  • CSS animations/transitions: Specifies the animations and transitions used to animate the flipping motion of the book pages, including rotation, perspective, and timing functions.

4. Can I customize the appearance and behavior of the Book Flip Animation with CSS?

Yes, the appearance and behavior of the Book Flip Animation with CSS can be customized extensively to match the design requirements of your project. You can adjust properties such as the size and aspect ratio of the book pages, the speed and timing of the flipping animation, and the visual effects applied to simulate the texture of the pages.

5. Is JavaScript required to implement the Book Flip Animation with CSS?

No, JavaScript is not required to implement the basic Book Flip Animation with CSS. The animation effect can be achieved using CSS alone, leveraging CSS transitions and transforms to create the flipping motion. However, JavaScript can be optionally used to add interactivity or advanced features to the animation, such as controlling the animation sequence or triggering additional effects based on user input.

6. Are there any performance considerations when using the Book Flip Animation with CSS?

While the Book Flip Animation with CSS adds visual flair to web content, it's essential to consider performance implications, especially on older devices or browsers. Optimize the CSS animations and transitions to ensure smooth rendering and minimize rendering artifacts. Additionally, consider using hardware acceleration or CSS hardware acceleration techniques to improve performance on supported platforms.

7. Can I access templates or code snippets for creating the Book Flip Animation with CSS?

Yes, there are templates, code snippets, and tutorials available online that demonstrate how to create the Book Flip Animation with CSS. These resources often provide ready-to-use code examples, design inspiration, and customizable templates to help you implement the animation effect in your own projects

No comments

Powered by Blogger.