CSS Image Gallery With 3D Effect | Animated Gallery in Pure CSS


How to create a CSS Image Gallery With 3D Effect? This program is about to create an Animated Gallery in Pure CSS.
You must be seen different types of image gallery on websites. Mostly gallery is used on the portfolio and project showcase section. If someone put simple images line-wise then the website will be less attractive than comparing to other websites who use 3D image gallery.
In other words, websites with creative and animated image gallery look attractive. If you want an image gallery on your website then this program is very informative for you. Using this CSS image galleryprogram you can give your site a new and fresh look. This is a pure CSS program with very fewer lines of codes.
So, Today I am sharing a CSS Image Gallery programwith 3D animation effect. This program is with bootstrap to creating the layout, and full functions are is based on CSS. So, you can also call this program Pure CSS Photo Gallery.  First, see how this program looks like:

Preview Of Animated Gallery


See this video preview to getting an idea of how this image gallery looks.


Now you can see how this program looks visually. If you like this then go for source code given below.

3D CSS Image Gallery Source Code

Before sharing the source code, I want to say about this program. I created this image gallery using bootstrap and CSS. I used bootstrap for creating a responsive layout, nothing else. This program is in pure CSS without JavaScript. This program is with fully animated 3D effect. First, I gave 50 deg rotation for images divs, On hover, I had put 0 deg rotation.
You will fully understand when you get the source code. Because there is a quote – ” code never lies, Sometimes comment do!” (source). In other words, You can understand better by looking at code than a read article.
<html>

<head>
  <meta charset="UTF-8">
  <title>3D Image Gallery In CSS | Webdevtrick.com</title>
  <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css'>
   <link rel="stylesheet" href="style.css">
</head>
<body>

  <div class="container">
  <div class="row">
    <div class="col-md-3">
      <div class="cardholder">
        <div class="card">
          <img src="https://webdevtrick.com/wp-content/uploads/image-slider1.jpg" />
<p class="desc">WebDevTrick.com</p>
        </div>
      </div>
    </div>
    
    <div class="col-md-3">
      <div class="cardholder">
        <div class="card">
           <img src="https://webdevtrick.com/wp-content/uploads/image-slider2.jpg" />
          <p class="desc">WebDevTrick.com</p>
        </div>
      </div>
    </div>
    
    <div class="col-md-3">
      <div class="cardholder">
        <div class="card">
          <img src="https://webdevtrick.com/wp-content/uploads/image-slider3.jpg" />
<p class="desc">WebDevTrick.com</p>
        </div>
      </div>
    </div>
    
    <div class="col-md-3">
      <div class="cardholder">
        <div class="card">
          <img src="https://webdevtrick.com/wp-content/uploads/image-slider4.jpg" />
<p class="desc">WebDevTrick.com</p>
        </div>
      </div>
    </div>
    
    
  </div>
</div>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/js/bootstrap.min.js'></script>

 </body>

</html>


style.css


Now create a CSS file named ‘style.css‘ and put these codes.
@import url('https://fonts.googleapis.com/css?family=Titillium+Web');
body {
font-family: 'Titillium Web', sans-serif;
color: white;
background: linear-gradient(to left, #ffc3a0, #FFAFBD ); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}
h1 {
  text-transform: uppercase;
  font-size: 4em;
}
img {
height: 300px;
}
.cardholder {
  margin-top: 150px;
          perspective: 600px;
}
.card {
  width: 300px;
  height: 300px;
  background-color: transparent;
          transform: rotateY(50deg);
  box-shadow: -6px 5px 13px 2px rgba(0, 0, 0, 0.25);
transition: all 1s ease;
  color: transparent;
}
.card:hover {
  width: 300px;
  height: 300px;
  background-color: transparent;
          transform: rotateY(0deg);
  box-shadow: 0px 0px 36px 2px rgba(0, 0, 0, 0.25);
  color: black;
}
.card:hover p {
  background-color: white;
}
p.desc {
  z-index:999;
  position: absolute;
  top: 10px;
  padding: 10px;
}
p.desc:hover {
}


That’s It. You have successfully created a CSS image gallery with 3D animation effect. If you have any doubt or question comment down below.

Comments

Popular posts from this blog

Node.js Cheat Sheet

Codeigniter ! Simple But Powerful

Introducing Cloudflare Pages ⚡