博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CSS3鼠标hover图片超酷遮罩层动画特效
阅读量:4117 次
发布时间:2019-05-25

本文共 2553 字,大约阅读时间需要 8 分钟。

640?wx_fmt=jpeg
这是一款CSS3鼠标hover图片超酷遮罩层动画特效。 该特效中,当鼠标悬停在图片上面的时候,左右两个遮罩层会向中间收缩,最后合成一个完整的遮罩层。
效果截图如下:
640?wx_fmt=png
 HTML代码

Williamson

Web designer

Miranda Roy

Web developer
CSS
.box{	    font-family: 'Dosis', sans-serif;	    position: relative;	    overflow: hidden;	}	.box:before,	.box:after{	    content: '';	    background: linear-gradient( #000dff 0%,#6b73ff 100%);	    height: 150%;	    width: 100%;	    border-radius: 0 100% 0 0;	    opacity: 0;	    position: absolute;	    left: -50%;	    top: 100%;	    z-index: 1;	    transition: border-radius .5s ease-out,top .5s ease-out,opacity .3s ease-out;	}	.box:after{	    border-radius: 100% 0 0 0;	    left: 50%;	}	.box:hover:before,	.box:hover:after{	    top: -50%;	    opacity: 0.9;	    border-radius: 0 35% 0 0;	}	.box:hover:after{ border-radius: 35% 0 0 0; }	.box img{	    width: 100%;	    height: auto;	}	.box .box-content{	    color: #fff;	    text-align: center;	    width: 80%;	    opacity: 0;	    transform: translateX(-50%) translateY(-50%);	    position: absolute;	    top: 50%;	    left: 50%;	    z-index: 2;	    transition: all 0.3s ease 0.2s;	}	.box:hover .box-content{ opacity: 1; }	.box .title{	    font-size: 25px;	    font-weight: 700;	    text-transform: uppercase;	    letter-spacing: 1px;	    margin: 0 0 7px;	}	.box .post{	    font-size: 18px;	    font-weight: 600;	    letter-spacing: 1px;	    text-transform: capitalize;	    margin: 0 0 10px;	    display: block;	}	.box .icon{	    padding: 0;	    margin: 0;	    list-style: none;	}	.box .icon li{	    margin: 0 5px;	    display: inline-block;	}	.box .icon li a{	    color: #fff;	    background: transparent;	    font-size: 14px;	    line-height: 31px;	    height: 35px;	    width: 35px;	    border: 1px solid #fff;	    border-bottom: none;	    border-right: none;	    border-radius: 50%;	    display: block;	    transition: all 0.3s ease;	}	.box .icon li  a:hover{	    color: #fff;	    box-shadow: 0 0 10px #000;	}	@media only screen and (max-width:990px){	    .box { margin: 0 0 30px; }	}

Demo源码下载:
https://tc5.us/file/21793581-404992058

640?wx_fmt=jpeg
640?wx_fmt=png

转载地址:http://effpi.baihongyu.com/

你可能感兴趣的文章
【JAVA数据结构】双向链表
查看>>
【JAVA数据结构】先进先出队列
查看>>
乘法逆元
查看>>
Objective-C 基础入门(一)
查看>>
Flutter Boost的router管理
查看>>
iOS开发支付集成之微信支付
查看>>
C++模板
查看>>
【C#】如何实现一个迭代器
查看>>
【C#】利用Conditional属性完成编译忽略
查看>>
DirectX11 光照演示示例Demo
查看>>
VUe+webpack构建单页router应用(一)
查看>>
Node.js-模块和包
查看>>
(python版)《剑指Offer》JZ01:二维数组中的查找
查看>>
Spring MVC中使用Thymeleaf模板引擎
查看>>
PHP 7 的五大新特性
查看>>
深入了解php底层机制
查看>>
PHP中的stdClass 【转】
查看>>
XHProf-php轻量级的性能分析工具
查看>>
OpenCV gpu模块样例注释:video_reader.cpp
查看>>
OpenCV meanshift目标跟踪总结
查看>>