gsap模仿apple tv实现图片悬浮视觉差异聚焦效果代码
代码语言:html
所属分类:视觉差异
代码描述:gsap模仿apple tv实现图片悬浮视觉差异聚焦效果代码
代码标签: gsap 模仿 apple tv 图片 悬浮 视觉差异 聚焦
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
overscroll-behavior: none;
cursor: none;
transform-style: preserve-3d;
}
* {
margin: 0;
padding: 0;
}
#container {
width: 100vw;
height: 100vh;
display: grid;
place-items: center;
}
.grid {
display: flex;
flex-wrap: wrap;
}
.grid__wrap {
position: relative;
margin: 0 40px;
}
.grid__button {
width: 200px;
height: 50px;
background-color: indigo;
display: grid;
place-items: center;
color: white;
}
.grid__area {
width: 250px;
height: 150px;
position: absolute;
top: 0;
bottom: 0;
left: -100%;
right: -100%;
margin: auto;
}
.cursor {
position: fixed;
top: 0;
left: 0;
z-index: 9999;
pointer-events: none;
contain: layout size style;
}
.cursor__pointer {
position: absolute;
width: 15px;
height: 15px;
background-color: red;
border-radius: 50%;
opacity: 0;
}
.cursor__decoy {
position: absolute;
}
.cursor__decoy span {
display: block;
width: 10px;
height: 10px;
background-color: rgba(0,255,0,.6);
border-radius: 50%;
opacity: 0;
}
.discography {
display: flex;
perspective: 350px;
}
.discography__unit {
position: relative;
width: 350px;
perspective: 300px;
}
.discography__unit:nth-child(n+2) {
margin-left: 80px;
}
.discography__image {
overflow: hidden;
box-shadow: 21px 42px 42px rgba(0, 0, 0, .33);
}
.discography__image img {
max-width: 100%;
vertical-align: bottom;
}
.discography__area {
position: absolute;
top: -100%;
right: -100%;
bottom: -100%;
left: -100%;
width: 130%;
h.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0