Spheres1Background实现三维小球重力交互效果代码

代码语言:html

所属分类:三维

代码描述:Spheres1Background实现三维小球重力交互效果代码,可变色,还有光线感应,可设置重力开关,鼠标跟随小球躲避。

代码标签: Spheres1Background 三维 小球 重力 交互

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

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

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

  <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Montserrat:wght@500;700&amp;display=swap'>
  
<style>
body, html, #app {
  margin: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(0,0,0,0.5) 200%);
}

#app {
  position: relative;
  height: 100%;
  font-family: "Montserrat", serif;
}

.hero {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

h1, h2 {
  margin: 0;
  padding: 0;
  color: black;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(255, 255, 255, 1);
  line-height: 100%;
  user-select: none;
}

h1 {
  position: relative;
  z-index: 2;
  font-size: 100px;
  font-weight: 700;
}

h2 {
  font-size: 80px;
  font-weight: 500;
}

#webgl-canvas {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  z-index: 1;
}

.buttons {
  position: fixed;
  width: 100%;
  bottom: 15px;
  z-index: 2;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

button {
  font-family: "Montserrat", serif;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 5px;
  border: 1px solid grey;
  padding: 4px 8px;
}
</style>


  
  
</head>

<body translate="no">
  <div id="app">
  <div class="hero&.........完整代码请登录后点击上方下载按钮下载查看

网友评论0