splinecode实现炫酷三维立体泡泡搜索按钮效果代码

代码语言:html

所属分类:动画

代码描述:splinecode实现炫酷三维立体泡泡搜索按钮效果代码

代码标签: splinecode 炫酷 三维 立体 泡泡 搜索 按钮

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

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

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

  
  
<style>
body {
background-color: #000;
  margin: 0;
overflow: hidden;
}

#container{
    display: flex;
    justify-content: center;
    align-items: flex-start;
  height: 100vh;

}
#canvas3d{
  width: 100%;
  height: 100%;
}
</style>


  
</head>

<body translate="no">
  <div id='container'>
  <canvas id="canvas3d"></canvas>
</div>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gsap.3.10.4.js"></script>
      <script type="module">
const fileName = "KKwwEiksQMIvw6GO";

function objectArray(all, name) {
  return all.filter(item => item.name == name);
}

let allLensT = [];
let allLensB = [];
let particleArray = [];
let offset = 30;
let sizeObj = { width: window.innerWidth,
  height: window.innerHeight };


function getDuplicateNameObjects(app, obj, name) {
  if (new RegExp(name).test(obj.name)) {
    return true;
  }

}

import { Application } from "https://esm.sh/@splinetool/runtime";
const canvas = document.getElementById('canvas3d');
const app = new Application(canvas);
//const myVariables = { displayText: 'Chris!', mySize: 350 };
app.load(`https://prod.spline.design/${fileName}/scene.splinecode`).
then(() => {

  let allObjects = app.getAllObjects();

  allObjects.forEach((i, c) => {
    if (getDuplicateNameObjects(app, i, 'lensT')) {
      allLensT.push(i);
    }
    if (getDuplicateNameObjects(app, i, 'lensB')) {
      allLensB.push(i);
    }

  });
  //console.log(allLensT)

  let mainTl = gsap.timeline();
  let scale = gsap.utils.random(1, 1.26);

  allLensT.forEach((i, c) => {.........完整代码请登录后点击上方下载按钮下载查看

网友评论0