ScrollTrigger滚动触发动画效果

代码语言:html

所属分类:加载滚动

代码描述:ScrollTrigger滚动触发动画效果

代码标签: 动画 效果

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


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="http://repo.bfw.wiki/bfwrepo/css/all.min.css">
<style>
@import url("https://fonts.googleapis.com/css2?family=Lato&family=Raleway&display=swap");
:root {
  --color: #fff;
  --color2: #000;
  --greenSock: #88ce02;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  height: 100%;
  min-height: 100%;
  margin: 0;
  color: black;
  font-family: 'Lato', sans-serif;
  background: skyblue;
}

a {
  text-decoration: none;
  cursor: pointer;
}

img {
  max-width: 100%;
}

ul {
  list-style: none;
}

h1 {
  color: black;
  font-size: 3rem;
}

h1,
h2 {
  font-family: 'Raleway', sans-serif;
}

span {
  display: inline-block;
  color: white;
}

main {
  position: relative;
}
main .bgImg {
  width: 100%;
  position: fixed;
  top: 200px;
  left: 15%;
  opacity: 0;
  z-index: -420;
}
@media (max-width: 420px) {
  main .bgImg {
    min-width: 125%;
    top: 50px;
    left: 0;
  }
}

.center {
  text-align: center;
}

.scrollMe {
  height: 100vh;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: center;
  justify-items: center;
  align-content: center;
  align-items: center;
  text-align: center;
}

.fauxView, #viewBox {
  will-change: transform;
}

.fauxView {
  width: 305px;
  height: 500px;
  overflow-x: hidden;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-appearance: none;
}
.fauxView::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
  -webkit-appearance: none;
}

.liquid,
.liquidDark,
.scrollText {
  visibility: hidden;
}

.greensockIcon {
  margin-top: 6rem;
  padding: 0 1rem;
  visibility: hidden;
  background: black;
  border-radius: 1rem;
  border: 2px solid var(--greenSock);
  box-shadow: 0 0 1px 4px black;
}
</style>

</head>
<body translate="no">
<main><img class="bgImg" src="https://b1m1nd.github.io/gsapScroll/images/logo-man.svg" alt="" />
<div class="scrollMe grid">
<div class="responsibly">
<h1 class="center">Please Scroll <span>Responsibly</span></h1>
<p> <b>ScrollTrigger </b>a no hijack scroll plugin from GSAP! </p>
<h1><span><i class="fas fa-chevron-circle-down"></i></span></h1>
</div>
</div>
<div class="grid">
<div class="teamwork">
<h2> <span>Your team worked hard</span.........完整代码请登录后点击上方下载按钮下载查看

网友评论0