3D Animation – CodingNepal https://www.codingnepalweb.com CodingNepal is a blog dedicated to providing valuable and informative content about web development technologies such as HTML, CSS, JavaScript, and PHP. Mon, 15 May 2023 09:10:13 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.2 3D Flip Card on Hover using only HTML & CSS https://www.codingnepalweb.com/3d-flip-card-on-hover-html-css/ https://www.codingnepalweb.com/3d-flip-card-on-hover-html-css/#comments Mon, 31 Aug 2020 17:23:00 +0000 https://codingnepalweb.com/2020/08/31/3d-flip-card-on-hover-using-only-html-css/ 3D Flip Card on Hover using only HTML & CSS

Hello readers, Today in this blog you’ll learn how to create a 3D Flip Card on Hover using only HTML & CSS. Earlier I have shared a blog on how to create an Owl-carousel Image or Card Slider using jQuery and now it’s time to create a 3D Flip Image on Hover.

A card is a small rectangular box with images and text. It is an entrance point for users to learn more details. To maintain the usability of the website interface, the card UI pattern is a default choice. Because cards are easy to use, they can also show content that contains different details.

In this program (3D Flip Card on Hover), at first, on the webpage, there is a front part of the card which means image, and when you hover on that image, this card flip or rotate with 3d style and shows you the back part of the card. And in the backside of the card, there is a profile image, title, and some social media icons.

If you’re feeling difficult to understand what I am saying. You can watch a full video tutorial on this program (3D Flip Card on Hover ).

Video Tutorial of Card with 3D Flip Animation on Hover

In the video, you have seen the Profile Card with 3D Flip Animation or Effect and I hope you have understood the basic codes behind creating this program. As you already know, this is a pure CSS program so if you’re a beginner then you can also easily create this type of 3D Flip animation on card or images.

If you like this program (Card with 3D Flip Animation or Effect) and want to get source codes. You can easily get the source codes of this program. To get the source codes you just need to scroll down. You can use this 3D Animation on your website images or project cards.

You might like this:

3D Flip Card on Hover Animation or Effect [Source Codes]

To create this program (Card with 3D Flip Animation). First, you need to create two Files one HTML File and another one is CSS File. After creating these files just paste the following codes in your file.

First, create an HTML file with the name of index.html and paste the given codes in your HTML file. Remember, you’ve to create a file with .html extension and the images that are used on these cards won’t appear. You’ve to download files from the given download button to use images also.

<!DOCTYPE html>
<!-- Created By CodingNepal -->
<html lang="en" dir="ltr">
   <head>
      <meta charset="utf-8">
      <title>3D Flip Card on Hover | CodingLab</title>
      <link rel="stylesheet" href="style.css">
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
   </head>
   <body>
      <div class="wrapper">
         <div class="card front-face">
            <img src="https://images.unsplash.com/photo-1492288991661-058aa541ff43?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80">
         </div>
         <div class="card back-face">
            <img src="https://images.unsplash.com/photo-1492288991661-058aa541ff43?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80">
            <div class="info">
               <div class="title">
                  CodingLab
               </div>
               <p>
                  User interface designer and <br>front-end developer
               </p>
            </div>
            <ul>
               <a href="#"><i class="fab fa-facebook-f"></i></a>
               <a href="#"><i class="fab fa-twitter"></i></a>
               <a href="#"><i class="fab fa-instagram"></i></a>
               <a href="#"><i class="fab fa-youtube"></i></a>
            </ul>
         </div>
      </div>
   </body>
</html>

Second, create a CSS file with the name of style.css and paste the given codes in your CSS file. Remember, you’ve to create a file with .css extension.

@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}
html,body{
  display: grid;
  height: 100%;
  width: 100%;
  place-items: center;
  background: linear-gradient(375deg, #1cc7d0, #2ede98);
}
::selection{
  color: #fff;
  background: #1cc7d0;
}
.wrapper{
  height: 400px;
  width: 320px;
  position: relative;
  transform-style: preserve-3d;
 perspective: 1000px;
}
.wrapper .card{
  position: absolute;
  height: 100%;
  width: 100%;
  padding: 5px;
  background: #fff;
  border-radius: 10px;
  transform: translateY(0deg);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  box-shadow: 0px 10px 15px rgba(0,0,0,0.1);
  transition: transform 0.7s cubic-bezier(0.4,0.2,0.2,1);
}
.wrapper:hover > .front-face{
  transform: rotateY(-180deg);
}
.wrapper .card img{
  height: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
}
.wrapper .back-face{
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  flex-direction: column;
  transform: rotateY(180deg);
}
.wrapper:hover > .back-face{
  transform: rotateY(0deg);
}
.wrapper .back-face img{
  height: 150px;
  width: 150px;
  padding: 5px;
  border-radius: 50%;
  background: linear-gradient(375deg, #1cc7d0, #2ede98);
}
.wrapper .back-face .info{
  text-align: center;
}
.back-face .info .title{
  font-size: 30px;
  font-weight: 500;
}
.back-face ul{
  display: flex;
}
.back-face ul a{
  display: block;
  height: 40px;
  width: 40px;
  color: #fff;
  text-align: center;
  margin: 0 5px;
  line-height: 38px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: linear-gradient(375deg, #1cc7d0, #2ede98);
  transition: all 0.5s ease;
}
.back-face ul a:hover{
  color: #1cc7d0;
  border-color: #1cc7d0;
  background: linear-gradient(375deg, transparent, transparent);
}
]]> https://www.codingnepalweb.com/3d-flip-card-on-hover-html-css/feed/ 9 Image Gallery with 3D Flip Animation in HTML & CSS https://www.codingnepalweb.com/image-gallery-3d-flip-animation-html-css/ https://www.codingnepalweb.com/image-gallery-3d-flip-animation-html-css/#comments Sat, 27 Jun 2020 12:50:00 +0000 https://codingnepalweb.com/2020/06/27/image-gallery-with-3d-flip-animation-in-html-css/ Image Gallery with 3D Flip Animation in HTML & CSS

Hello readers, Today in this blog you’ll learn how to create 3D Animation on Image Gallery using HTML & CSS. Earlier I have shared a blog on how to create Image Slider Controls in JavaScript. And, now it’s time to create an Image Gallery with 3D Flip Animation in HTML & CSS.

As you can see in the image, there is a main preview image at the center and some side images. These side images are used to rotate the main preview image. When you click on the particular side image the main preview image will rotate with 3D visualization and show the particular clicked image. This is a program pure CSS program that means I used only HTML & CSS to create these clickable buttons/images or 3D animation.

If you’re feeling difficult to understand what I am saying. You can watch a full video tutorial on this program (Image Gallery with 3D Flip Animation).

Video Tutorial of 3D Flip Animation on Images

 
In the video, you have seen how these images rotate with 3D visualization with a button/image click. You can use this type of animation on the e-commerce website to show products. As you know, I didn’t use JavaScript or any JavaScript library to create this 3D animation. So if you’re a beginner and you know of HTML & CSS then you can also create this type of animation and use it on your websites, projects, and HTML page.

If you like this program (Image Gallery with 3D Flip Animation) and want to get source codes. You can easily get the source codes of this program. To get the source codes you just need to scroll down.

You might like this:

Image Gallery with 3D Flip Animation [Source Codes]

To create this program (Image Gallery with 3D Flip Animation). First, you need to create two Files one HTML File and another one is CSS File. After creating these files just paste the following codes in your file.

First, create an HTML file with the name of index.html and paste the given codes in your HTML file. Remember, you’ve to create a file with .html extension and the images that are used on this gallery won’t appear. You’ve to download files from the given download button to use images also.

<!DOCTYPE html>
<!-- Created By CodingNepal -->
<html lang="en" dir="ltr">
   <head>
      <meta charset="utf-8">
      <title>3D Image Gallery Animation</title>
      <link rel="stylesheet" href="style.css">
   </head>
   <body>
      <div class="center">
         <input type="radio" checked name="active" id="tab-1">
         <input type="radio" name="active" id="tab-2">
         <input type="radio" name="active" id="tab-3">
         <input type="radio" name="active" id="tab-4">
         <div class="sliders">
            <label for="tab-1"><img src="#"></label>
            <label for="tab-2"><img src="#"></label>
            <label for="tab-3"><img src="#"></label>
            <label for="tab-4"><img src="#"></label>
         </div>
         <div class="img-card">
            <img src="#">
            <img src="#">
            <img src="#">
            <img src="#">
         </div>
      </div>
   </body>
</html>

Second, create a CSS file with the name of style.css and paste the given codes in your CSS file. Remember, you’ve to create a file with .css extension.

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body{
  display: flex;
  height: 100vh;
  text-align: center;
  align-items: center;
  justify-content: center;
}
.center{
  position: relative;
  width: 770px;
  left: -70px;
  perspective: 1200px;
}
.center .img-card{
  position: relative;
  height: 350px;
  width: 400px;
  transform-style: preserve-3d;
  transition: transform .5s ease-in;
}
.img-card img{
  position: absolute;
  height: 100%;
  width: 100%;
  object-fit: cover;
}
.img-card img:nth-child(1){
  transform: rotateX(-270deg) translateY(-175px);
  transform-origin: top left;
}
.img-card img:nth-child(2){
  transform: translateZ(175px);
}
.img-card img:nth-child(3){
  transform: rotateX(-90deg) translateY(175px);
  transform-origin: bottom center;
}
.img-card img:nth-child(4){
  transform: rotateX(-180deg) translateY(350px) translateZ(175px);
  transform-origin: bottom right;
}
#tab-1:checked ~ .img-card{
  transform: rotateX(-90deg);
}
#tab-2:checked ~ .img-card{
  transform: rotateX(0deg);
}
#tab-3:checked ~ .img-card{
  transform: rotateX(90deg);
}
#tab-4:checked ~ .img-card{
  transform: rotateX(180deg);
}
.sliders{
  position: absolute;
  display: block;
  right: 0;
  top: -30px;
}
.sliders label{
  height: 98px;
  width: 110px;
  display: flex;
  overflow: hidden;
  cursor: pointer;
  margin: 6px 0;
  border: 2px solid #2d4052;
}
.sliders label:nth-child(1){
  margin-top: 0;
}
label img{
  height: 100%;
  width: 100%;
  object-fit: cover;
  filter: grayscale(1);
  opacity: .9;
}
label img:hover,
#tab-1:checked ~ .sliders label:nth-child(1) img,
#tab-2:checked ~ .sliders label:nth-child(2) img,
#tab-3:checked ~ .sliders label:nth-child(3) img,
#tab-4:checked ~ .sliders label:nth-child(4) img{
  filter: grayscale(0);
  opacity: 1;
}
input{
  display: none;
}

That’s all, now you’ve successfully created an Image Gallery with 3D Flip Animation in HTML & CSS. If your code doesn’t work or you’ve faced any error/problem then please download the source code files from the given download button. It’s free and a .zip file will be downloaded then you’ve to extract it.

 

]]>
https://www.codingnepalweb.com/image-gallery-3d-flip-animation-html-css/feed/ 4