gsap+ScrollTrigger实现滚动鼠标图片翻页翻书产生骑马动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:gsap+ScrollTrigger实现滚动鼠标图片翻页翻书产生骑马动画效果代码,一本骑马的照片帧通过翻页产生动画。

代码标签: gsap ScrollTrigger 滚动 鼠标 图片 翻页 翻书 产生 骑马 动画

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

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

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


  
  
  
  
<style>
html,
body {
  height:100%;
  width:100%;
}

.header {
  color: white;
  font-size: 50px;
}

.section {
  height: 50%;
  background: #293744;
  color: red;
}
.scene {
  height: 100%;
  width: 100%;
  background: #282828;
}
.center {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.mainPage {
  perspective: 800px;
  position: relative;
  width: 600px;
  height: 300px;
}

.static {
  position: absolute;
  right: 50px;
  top: 50px;
  width: 180px;
  height: 200px;
  background-color: #D5D589;
  box-shadow: -184px 26px 116px -72px rgba(0,0,0,0.26) inset;
  transform-origin: center left;
  transform: rotate3d(0, 1, 0, -110deg);
  z-index: 2;
}

.viewer {
  position: absolute;
  top: 50px;
  right:50px;
  background: #FFFF99;
  height: 200px;
  width: 180px;
  background-image: url(//repo.bfw.wiki/bfwrepo/images/hourseruning.jpg);
  background-repeat: no-repeat;
  background-position: 0 50%;
  background-blend-mode: multiply;
  z-index: 2;
}
#containerLeft, #containerRight {
  width:100%;
  height:100%;
  overflow:hidden;
  position: absolute;
  bottom: 0;
  right: 0;
}
#containerLeft{
  z-index: 3;
}
#containerRight {
  z-index: 1;
}
.divLeft, .divRight {
    position: absolute;
    top: 50px;
  	width:180px;
	  height:200px;
    box-shadow: -184px 26px 116px -72px rgba(0,0,0,0.26) inset;
}

.divLeft {
  background-color: #D5D589;
  right:50px;
}
.divRight {
  right:-20px;
  background-color: #D5D589;
  box-shadow: 1px 0px 2px -1px rgba(0,0,0,0.3);
}
</style>



  
</head>

<body translate="no">
  <header class="header section">
  <div class="center">&darr;</div>
</header>

<section class="scene section center" id="sticky">
  <div class="mainPage" >
    <div id="containerLeft"></div>
    <div class="static"></div>
    <div class="viewer"></div>
    <div id="containerRight"></div>
  </div>
</section>

<section class="section">
  <div class="center">End</div>
</section>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/ScrollTrigger.3.10.4.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gsap.3.12.2.js"></script>
      <script >
gsap.registerPlugin(ScrollTr.........完整代码请登录后点击上方下载按钮下载查看

网友评论0