css实现创意磨砂玻璃悬浮背景动画效果代码

代码语言:html

所属分类:悬停

代码描述:css实现创意磨砂玻璃悬浮背景动画效果代码

代码标签: 磨砂 玻璃 悬浮 背景 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">

	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" user-scalable="no">
	<style>
	    body{
	min-height: 100hv;
	background: #180415;
	line-height:20px;
}
*{
	margin:0;
	padding:0;
	font-size: 12px;
}
ul{
	list-style:none;
}
.hide{
    display: none;
}
.lf{
	float: left;
}
.lr{
	float: right;
}
.red, .red a,.red a h5, .red a p{
    color:#FF0000 !important;
}
a {
    text-decoration: none;
    color: inherit;
}
.mr2 {
	margin-right: 1rem;
}
.ml2 {
	margin-left: 1rem;
}

.main-group{
	position: relative;
	min-height:100vh;
	align-items: center;
	margin: 0 auto;
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	padding:40px 0;
}

.main-group .item-group{
	position: relative;
	box-sizing: border-box;
	width:calc(33.3% - 60px);
	height:400px;
	display: flex;
	justify-content: center;
	align-items: center;
	margin: 40px 30px;
}
.main-group .item-group::before{
	content: "";
	position: absolute;
	/* left:50px; */
	top:0;
	width:50%;
	height: 100%;
	background-color: #fff;
	border-radius: 8px;
	transform: skewX(15deg);
	transition: 0.5s;
}
.main-group .item-group::after{
	content: "";
	position: absolute;
	/* left:50px; */
	top:0;
	width:50%;
	height: 100%;
	background-color: #fff;
	border-radius: 8px;
	transform: skewX(15deg);
	filter:blur(30px) ;
	transition: 0.5s;
}
.main-group .item-group:hover:before,
.main-group .item-group:hover:after{
	transform: skewX(0deg);
	/* left:20px; */
	width:calc(100% - 90px);
}

.main-group .item-group:nth-child(1):before,
.main-group .item-group:nth-child(1):after{
	background: linear-gradient(315deg, #f8b600, #ff0058);
}
.main-group .item-group:nth-child(2):before,
.main-group .item-group:nth-child(2):after{
	background: linear-gradient(315deg, #0084ff, #eeff00);
}
.main-group .item-group:nth-child(3):before,
.main-group .item-group:nth-child(3):after{
	background: linear-gradient(315deg, #3cff00, #1100ff);
}


.main-group .item-group span{
	display: block;
	top:0;
	left: 0;
	right: 0;
	bottom: 0;
	pointer-events: none;
	z-index: 20;
}

@keyframes animation{
	0%{
		transform: translateY(10px);
	}
	50%{
		transform: translateY(-10px);
	}
}
.main-group .item-group span::before{
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.1);
	opacity: 0;
	transition: 0.5s;
	animation: animation 2s ease-in-out infinite;
}
.main-group .item-group:hover span::before{
	top:-50px;
	left: 50px;
	width: 100px;
	height: 100px;
	opacity: 1;
}

.main-group .item-group span::after{
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.1);
	opacity: 0;
	transition: 0.5s;
	animation: animation 2s ease-in-out infinite;
}
.main-group .item-group:hover span::after{
	bottom:-50px;
	right: 50px;
	width: 100px;
	height: 100px;
	opacity: 1;
}

.main-group .item-group .content{
	z-index: 1;
	position: absolute;
	left:0;
	color: #fff;
	padding: 30px 20px;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 8px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(10px);
	transition: 0.5s;
}

.main-group .item-group:hover .content{
	left:-25px;
	padding:40px 30px;
}

.main-group .item-group .content .title{
	font-size:1.4em;
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0