gsap实现台阶式视觉差异滚动图片效果代码

代码语言:html

所属分类:视觉差异

代码描述:gsap实现台阶式视觉差异滚动图片效果代码

代码标签: 视觉 差异 滚动 图片 效果

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


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  


  
  
<style>
body {
  display: grid;
  width: 100%;
  justify-items: center;
  --progress: 20px;
}
body:before {
  content: "";
  position: fixed;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 3;
  -webkit-mask: linear-gradient(to bottom, #000, transparent 150px, transparent calc(100% - 150px), #000), linear-gradient(to right, #000, transparent 150px, transparent calc(100% - 150px), #000);
          mask: linear-gradient(to bottom, #000, transparent 150px, transparent calc(100% - 150px), #000), linear-gradient(to right, #000, transparent 150px, transparent calc(100% - 150px), #000);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}
body:after {
  content: "";
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 20px;
  height: 30px;
  box-shadow: inset 0 0 0 2px #fff;
  z-index: 999;
  border-radius: 15px;
  background: radial-gradient(circle at center, #fff 2px, rgba(255, 255, 255, 0.001) 2px) 50% 0px/20px 20px no-repeat;
  -webkit-animation: scroll 1s ease-in-out infinite;
          animation: scroll 1s ease-in-out infinite;
}
@-webkit-keyframes scroll {
  75% {
    background-position: 50% 7.5px;
  }
  100% {
    background-position: 50% 7.5px;
  }
}
@keyframes scroll {
  75% {
    background-position: 50% 7.5px;
  }
  100% {
    background-position: 50% 7.5px;
  }
}
body #container {
  position: relative;
  height: 3000px;
  width: 100vw;
  display: grid;
  justify-items: center;
  overflow: hidden;
}
body #container:before, body #container:after {
  content: "";
  position: absolute;
  width: 1200px;
  height: 150%;
  top: -25%;
  right: 50%;
  transform-origin: right;
  background-image: url("//repo.bfw.wiki/bfwrepo/image/5e0c6f2cae508.png");
  background-size: auto 250px;
  background-position: 0px calc((var(--progress) * 10) - 100px);
  transform: skewY(26.5deg);
  box-shadow: inset 0 0 0 100vw rgba(0, 0, 0, 0.75);
}
body #container:after {
  right: auto;
  left: 50%;
  transform: skewY(-26.5deg);
  background-position: 0px calc((var(--progress) * 10) - 50px);
}
body .stepwrap {
  position: relative;
  z-index: 2;
  width: 400px;
  height: 3000px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, 1fr);
  grid-column-gap: 0px;
  grid-row-gap: 0px;
}
body .panel {
  box-shadow: inset 0 0 0 0px #000;
  position: relative;
  z-index: 10;
  width: 400px;
}
body .panel:nth-of-type(2) {
  transform: scaleX(-1);
}
body .panel:nth-of-type(2) .step:after {
  transform: scaleX(-1);
}
body .panel:nth-of-type(2) .step:before {
  transform: skew(-63.5deg) scaleX(-1);
}
body .panel .step {
  width: 100%;
  height: 200px;
  position: absolute;
  top: 0;
  right: 0;
  perspective: 300vw;
}
body .panel .step:after {
  content: "";
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0