gsap实现可调参数的鼠标跟随蜘蛛爬行效果代码

代码语言:html

所属分类:其他

代码描述:gsap实现可调参数的鼠标跟随蜘蛛爬行效果代码,这个大蜘蛛会跟随你的鼠标走动。

代码标签: gsap 可调 参数 鼠标 跟随 蜘蛛 爬行

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

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

<head>

    <meta charset="UTF-8">




    <style>
        body {
          overflow: hidden;
          margin: 0;
          height: 100vh;
          font-family: sans-serif;
        }
        
        canvas {
          height: 100vh;
          width: 100%;
        }
        
        .credits {
          position: fixed;
          z-index: 10;
          bottom: 20px;
          left: 20px;
        }
        .credits a {
          text-decoration: none;
          color: #000;
        }
        .credits span {
          font-size: 11px;
        }
        .credits h1 {
          margin: -2px 0 0;
          padding: 0;
          font-size: 10px;
          font-weight: normal;
        }
        .credits h2 {
          margin: -1px 0;
          font-size: 14.1px;
          font-weight: normal;
        }
    </style>


</head>

<body>
    <!--
Instagram: https://www.instagram.com/supahfunk/
Twitter: https://twitter.com/supahfunk
-->
    <canvas id="canvas" />
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gsap.3.9.1.js"></script>
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/dat.gui-min.js"></script>
    <script>
        /*--------------------
        Vars
        --------------------*/
        const canvas = document.querySelector('#canvas');
        const ctx = canvas.getContext('2d');
        const win = {
          w: window.innerWidth,
          h: window.innerHeight };
   .........完整代码请登录后点击上方下载按钮下载查看

网友评论0