先上效果:
视频被压缩过比较模糊,实际很清晰
毛玻璃模糊效果
源代码:
图片的url是我自己的图片,需要替换成自己的
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
* {
padding: 0;
margin: 0;
}
.box {
width: 600px;
height: 300px;
/* border: 3px solid gray; */
box-shadow: 0 0 5px black;
margin: 50px auto;
display: grid;
background-color: rgb(255, 251, 240);
grid-template-columns: repeat(6,100px);
grid-template-rows: repeat(3,100px);
grid-template-areas: 'a a a a b b'
'a a a a c c'
'd d e f c c';
transition: all linear 0.3s;
}
.box div {
box-sizing: border-box;
/* border: 1px solid red; */
transition: all linear 0.15s;
box-shadow: 0 0 4px rgb(0, 0, 0),
0 0 2px black;
margin: 5px;
filter: brightness(1) saturate(1.2) contrast(0.85);
cursor: pointer;
}
.box div:hover {
transform: scale(1.1);
box-shadow: 0 0 25px rgb(0, 0, 0);
border-radius: 10px 10px;
z-index: 1;
}
.box:hover div:not(:hover) {
filter: brightness(0.85) saturate(1) contrast(1.2) blur(6px);
}
.box div:nth-child(1) {
grid-area: a;
background-image: url(./picture/lifangti/cf手游穿越火线+秋天+落叶+粉色百褶裙美女晴雅4k游戏壁纸3840x2160_彼岸图网.jpg);
background-repeat: no-repeat;
background-size: cover;
}
.box div:nth-child(2) {
grid-area: b;
background-image: url(./picture/lifangti/3D绘画+女仆+美腿+黑丝+高跟鞋+两位女仆进门后的一幕+4k动漫壁纸_彼岸图网.jpg);
background-repeat: no-repeat;
background-size: cover;
}
.box div:nth-child(3) {
grid-area: d;
background-image: url(./picture/lifangti/93123c38ba684d9b80d090ac7dc85235.jpg);
background-repeat: no-repeat;
background-size: cover;
}
.box div:nth-child(4) {
grid-area: e;
background-image: url(./picture/lifangti/Vivo\ X\ Fold内置蝴蝶高清4k电脑壁纸_彼岸图网.jpg);
background-repeat: no-repeat;
background-size: cover;
background-position: -38px;
}
.box div:nth-child(5) {
grid-area: f;
background-image: url(./picture/lifangti/两个女仆\ 女仆装\ 黑裤袜\ 黑色高跟鞋\ 油灯\ 楼梯4k动漫壁纸_彼岸图网.jpg);
background-repeat: no-repeat;
background-size: cover;
background-position: -40px;
}
.box div:nth-child(6) {
grid-area: c;
background-image: url(./picture/lifangti/睡在沙发上的美女+白色睡衣+好看身材4k美女壁纸_彼岸图网.jpg);
background-repeat: no-repeat;
background-size: cover;
background-position: -60px;
}
@media screen and (min-width: 800px) {
.box {
width: 600px;
height: 300px;
grid-template-columns: repeat(6,100px);
grid-template-rows: repeat(3,100px);
}
}
@media screen and (max-width: 800px) and (min-width: 400px) {
.box {
width: 400px;
height: 300px;
grid-template-columns: repeat(4,100px);
grid-template-rows: repeat(3,100px);
}
}
</style>
</head>
<body>
<section>
<div class="box">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</section>
</body>
</html>