<div class="hover__wrap">
  <div class="hover__updown">
    <figure class="front">
      <img src="http://oranssy.github.io/coding/animation/img/hoverUp.jpg" alt=""> 
      <figcaption>
        <h3>Mouse Hover Effect</h3>
        <p>마우스 올리면 Up</p>
      </figcaption>
    </figure>
    <figure class="back">
      <img src="https://oranssy.github.io/coding/animation/img/hoverDown.jpg" alt=""> 
      <figcaption>
        <h3>Mouse Hover Effect</h3>
        <p>마우스 내리면 Down</p>
      </figcaption>
    </figure>
  </div>
  <div class="hover__leftright">
    <figure class="front">
      <img src="https://oranssy.github.io/coding/animation/img/hoverLeft.jpg" alt=""> 
      <figcaption>
        <h3>Mouse Hover Effect</h3>
        <p>마우스 올리면 to Right</p>
      </figcaption>
    </figure>
    <figure class="back">
      <img src="https://oranssy.github.io/coding/animation/img/hoverRight.jpg" alt=""> 
      <figcaption>
        <h3>Mouse Hover Effect</h3>
        <p>마우스 내리면 to Left</p>
      </figcaption>
    </figure>
  </div>
</div>
@font-face {
    font-family: 'LocusSangsang';
    font-weight: normal;
    font-style: normal;
    src: url('https://cdn.jsdelivr.net/gh/webfontworld/locus/LocusSangsang.eot');
    src: url('https://cdn.jsdelivr.net/gh/webfontworld/locus/LocusSangsang.eot?#iefix') format('embedded-opentype'),
         url('https://cdn.jsdelivr.net/gh/webfontworld/locus/LocusSangsang.woff2') format('woff2'),
         url('https://cdn.jsdelivr.net/gh/webfontworld/locus/LocusSangsang.woff') format('woff'),
         url('https://cdn.jsdelivr.net/gh/webfontworld/locus/LocusSangsang.ttf') format("truetype");
    font-display: swap;
}

body {
  font-family: 'LocusSangsang';
  background-image: linear-gradient(135deg, #355C7D 0%, #6C5B7B 40%, #C06C84 100%);
  height: 100vh;
}
.hover__wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.hover__wrap > div {
  max-width: 400px;
  margin: 3%;
  position: relative;
  perspective: 1000px;
}

.hover__wrap > div img {
  width: 100%;
  border: 10px solid #f0f8ff;
  box-shadow: 2px 2px 2px 2px rgba(0,0,0,0.2);
  box-sizing: border-box;
  vertical-align: top;
}

.hover__wrap > div .front {
  transition: transform 1.5s;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.hover__wrap > div .back {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  transition: transform 1.5s;
  transform-style: preserve-3d;
}

.hover__wrap > div figcaption {
  background: rgba(0,0,0,0.4);
  color: #f8f8ff;
  padding: 10px;
  text-align: center;
  line-height: 1.0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translatez(100px);
  width: 60%;
  backface-visibility: hidden;
}

/* mouse hover effect */
.hover__updown .front {
  transform: rotatex(0deg);
}

.hover__updown:hover .front {
  transform: rotatex(180deg);
}

.hover__updown .back {
  transform: rotatex(-180deg);
}

.hover__updown:hover .back {
  transform: rotatex(0deg);
}

.hover__leftright .front {
  transform: rotatey(0deg);
}

.hover__leftright:hover .front {
  transform: rotatey(180deg);
}

.hover__leftright .back {
  transform: rotatey(-180deg);
}

.hover__leftright:hover .back {
  transform: rotatey(0deg);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.