threejs打造一个鼠标跟随点击跳跃的三维山羊效果代码

代码语言:html

所属分类:三维

代码描述:threejs打造一个鼠标跟随点击跳跃的三维山羊效果代码

代码标签: 鼠标 跟随 点击 跳跃 三维 山羊 效果

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

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

<head>

  <meta charset="UTF-8">
  

  
<style>
@import url(https://fonts.googleapis.com/css2?family=Roboto:wght@400;700);
.app {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  overflow: hidden;
}

* {
  -webkit-tap-highlight-color: transparent;
}

.scene-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: rgb(85,121,56);
  background-image: linear-gradient(0deg, #7cb64c 0%, #81a459  100%);
}

.infos {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 84px;
  z-index: 1;
  text-align: center;
  pointer-events: none;
  color: #fff;
  font-family:'Roboto', sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.instructions {
  margin-bottom: 10px;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  line-height: 1.3;
  padding: 0 50px;
}

.infos .link {
  pointer-events: all;
  cursor: pointer;
  text-decoration: none;
  color: #000000;
  font-weight: bold;
  transition: all 0.5s ease-out;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}
.infos .link:hover {
  color: #fff;
}
</style>


</head>

<body >
  <div class='scene-background'></div>
  <canvas class='app'></canvas>
  <div class='infos'>
    <p class='instructions'>
      Click and hold to make the sheep jump the highest.
    </p>
  
  </div>

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.126.js"></script>
<script.........完整代码请登录后点击上方下载按钮下载查看

网友评论0