js+css实现多层卡片鼠标悬停交互视觉差异效果代码
代码语言:html
所属分类:视觉差异
代码描述:js+css实现多层卡片鼠标悬停交互视觉差异效果代码
代码标签: js css 多层 卡片 鼠标 悬停 交互 视觉 差异
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap");
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background: #000;
font-family: "Poppins", serif;
font-weight: 700;
}
.card {
position: relative;
width: 350px;
height: 566px;
perspective: 1000px;
overflow: hidden;
border-radius: 32px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
background-color: #c4d9e9;
}
.parallax-layer {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
transform-origin: center;
}
.parallax-layer img {
height: 115%;
margin-left: -90%;
}
.bg {
height: 100%;
max-height: 600px;
}
.parallax-layer:nth-child(1) {
z-index: 0;
filter: blur(5px);
}
.parallax-layer:nth-child(2) {
z-index: 1;
filter: blur(3px);
}
.parallax-layer:nth-child(3) {
z-index: 2;
filter: blur(2px);
}
.parallax-layer:nth-child(4) {
z-index: 3;
filter: blur(0px);
}
.parallax-layer:nth-child(5) {
z-index: 4;
filter: blur(2px);
}
.parallax-layer:nth-child(6) {
z-index: 5;
filter: blur(3px);
}
.parallax-layer:nth-child(7) {
z-index: 6;
filter: blur(5px);
}
.parallax-laye.........完整代码请登录后点击上方下载按钮下载查看
网友评论0