图片/图形

CSS3鼠标hover图片遮罩层折页打开动画特效

阿里云


这是一款 css3 鼠标 hover 图片遮罩层折页打开动画特效。该特效在鼠标悬停到图片上面的时候,图片上的遮罩层会像纸张翻开一样打开,然后显示图片描述文字。
使用方法
在 HTML 文件中引入

  1. <link rel="stylesheet" href="bootstrap.min.css" />
也想出现在这里?联系我们
创客主机

HTML 结构

  1. <div class="container">
  2.     <div class="row">
  3.         <div class="col-md-4 col-sm-6">
  4.             <div class="box">
  5.                 <img src="images/img-1.jpg">
  6.                 <div class="box-content">
  7.                     <h3 class="title">Williamson</h3>
  8.                     <span class="post">Web designer</span>
  9.                 </div>
  10.                 <ul class="icon">
  11.                     <li><a href="#"><i class="fa fa-search"></i></a></li>
  12.                     <li><a href="#"><i class="fa fa-link"></i></a></li>
  13.                 </ul>
  14.             </div>
  15.         </div>
  16.         <div class="col-md-4 col-sm-6">
  17.             <div class="box">
  18.                 <img src="images/img-2.jpg">
  19.                 <div class="box-content">
  20.                     <h3 class="title">Miranda Roy</h3>
  21.                     <span class="post">Web developer</span>
  22.                 </div>
  23.                 <ul class="icon">
  24.                     <li><a href="#"><i class="fa fa-search"></i></a></li>
  25.                     <li><a href="#"><i class="fa fa-link"></i></a></li>
  26.                 </ul>
  27.             </div>
  28.         </div>
  29.     </div>
  30. </div>

CSS 样式

  1. .box{
  2.     font-family: 'Varela Round', sans-serif;
  3.     text-align: center;
  4.     overflow: hidden;
  5.     perspective: 800px;
  6.     position: relative;
  7. }
  8. .box:before,
  9. .box:after{
  10.     content: "";
  11.     background: rgba(255,255,255,0.9);
  12.     width: 44%;
  13.     height: 42%;
  14.     opacity: 0;
  15.     transform: translateY(-50%) rotateY(90deg);
  16.     transform-origin: right center;
  17.     transform-style: preserve-3d;
  18.     position: absolute;
  19.     top: 50%;
  20.     left: 5%;
  21.     z-index: 1;
  22.     transition: all 0.4s ease-out;
  23. }
  24. .box:after{
  25.     transform: translateY(-50%) rotateY(-90deg);
  26.     transform-origin: left center;
  27.     left: auto;
  28.     right: 7%;
  29. }
  30. .box:hover:before,
  31. .box:hover:after{
  32.     opacity: 1;
  33.     transform: translateY(-50%) rotateY(0);
  34. }
  35. .box img{
  36.     width: 100%;
  37.     height: auto;
  38.     transition: all 0.4s ease;
  39. }
  40. .box:hover img{ filter: hue-rotate(100deg); }
  41. .box .box-content{
  42.     color: #6c5ce7;
  43.     width: 100%;
  44.     opacity: 0;
  45.     transform: translateY(-50%);
  46.     position: absolute;
  47.     top: 50%;
  48.     left: 0;
  49.     z-index: 2;
  50.     transition: all 0.4s;
  51. }
  52. .box:hover .box-content{ opacity: 1; }
  53. .box .title{
  54.     font-size: 22px;
  55.     font-weight: 700;
  56.     letter-spacing: 1px;
  57.     margin: 0 0 3px 0;
  58.     text-transform: uppercase;
  59. }
  60. .box .post{ font-size: 16px; }
  61. .box .icon{
  62.     padding: 0;
  63.     margin: 0;
  64.     list-style: none;
  65.     transform: translateX(-50%);
  66.     position: absolute;
  67.     left: 50%;
  68.     bottom: 13px;
  69. }
  70. .box .icon li{
  71.     display: inline-block;
  72.     margin: 0 7px;
  73.     opacity: 0;
  74.     transform: translateY(50px);
  75.     transition: all 0.3s;
  76. }
  77. .box:hover .icon li{
  78.     opacity: 1;
  79.     transform: translateY(0);
  80. }
  81. .box:hover .icon li:nth-child(2){ transition: all 0.3s ease 0.2s; }
  82. .box .icon li a{
  83.     color: #fff;
  84.     background: #6c5ce7;
  85.     font-size: 16px;
  86.     line-height: 30px;
  87.     height: 30px;
  88.     width: 30px;
  89.     border-radius: 50%;
  90.     box-shadow: 0 0 0 2px #fff;
  91.     display: block;
  92.     transition: all 0.5s ease;
  93. }
  94. .box .icon li  a:hover{
  95.     color: #fff;
  96.     text-shadow: 0 0 5px #000;
  97.     border-radius: 10%;
  98. }
  99. @media only screen and (max-width:990px){
  100.     .box { margin: 0 0 30px; }
  101. }

CSS3 鼠标 hover 图片遮罩层折页打开动画特效

已有 369 人购买
  • mtxb
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!