gsap+lenis实现网页滚动图片相册交叉滚动动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:gsap+lenis实现网页滚动图片相册交叉滚动动画效果代码,滚动是ScrollTrigger插件

代码标签: gsap lenis 网页 滚动 图片 相册 交叉 滚动 动画

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

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

<head>
  <meta charset="UTF-8">
  

<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/modern-normalize.min.css">
  
<style>
:root {
  --color-black: hsla(0, 0%, 12%, 100%);
  --color-white: hsla(0, 0%, 100%, 100%);
  --color-white-50: hsla(0, 0%, 50%, 100%);
  --color-purple: hsla(278, 100%, 75%, 100%);
}

body {
  background-color: var(--color-black);
  color: var(--color-white);
  font-family: "Open Sans", sans-serif;
  font-optical-sizing: auto;
}

main {
  margin: 0;
}

.col-scroll {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
}

.col-scroll__box {
  display: flex;
  flex-direction: column;
  padding: 5vh 0 15vh;
}
.col-scroll__box:nth-child(odd) {
  flex-direction: column-reverse;
  height: 100vh;
}

.col-scroll__list {
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.col-scroll__box:nth-child(odd) .col-scroll__list {
  flex-direction: column-reverse;
}

.col-scroll__img {
  aspect-ratio: 6/7;
  height: auto;
  -o-object-fit: cover;
     object-fit: cover;
  width: 25vw;
}

.col-scroll__title {
  margin: 12px 0 16px;
}
</style.........完整代码请登录后点击上方下载按钮下载查看

网友评论0