图片/图形

CSS3鼠标hover图片超酷遮罩层动画特效

阿里云


这是一款 CSS3 鼠标 hover 图片超酷遮罩层动画特效。该特效中,当鼠标悬停在图片上面的时候,左右两个遮罩层会向中间收缩,最后合成一个完整的遮罩层。

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.                     <ul class="icon">
  10.                         <li><a href="#"><i class="fa fa-search"></i></a></li>
  11.                         <li><a href="#"><i class="fa fa-link"></i></a></li>
  12.                     </ul>
  13.                 </div>
  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.                     <ul class="icon">
  23.                         <li><a href="#"><i class="fa fa-search"></i></a></li>
  24.                         <li><a href="#"><i class="fa fa-link"></i></a></li>
  25.                     </ul>
  26.                 </div>
  27.             </div>
  28.         </div>
  29.     </div>
  30. </div>
也想出现在这里?联系我们
创客主机

CSS

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

CSS3 鼠标 hover 图片超酷遮罩层动画特效

已有 374 人购买
  • 9i18
查看演示升级 VIP立刻购买

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

发表回复

热销模板

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

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