three实现三维粒子组成的圣诞树带音乐旋转拉伸动画效果代码

代码语言:html

所属分类:三维

代码描述:three实现三维粒子组成的圣诞树带音乐旋转拉伸动画效果代码,音乐祥和温暖。

代码标签: three 圣诞树 粒子 旋转 音乐

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

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

<head>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  
  
<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  overflow: hidden;
  background: #00101a;
}
body {
  font-family: fino-sans, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-weight: 700;
  font-style: normal;
}
.webgl {
  position: fixed;
  width: 100vw;
  height: 100vh;
}

button {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  -webkit-appearance: none;
  background: crimson;
  color: white;
  font: inherit;
  font-size: 1.5rem;
  padding: 0.75rem 2.5rem;
  border: none;
  border-radius: 1.75rem;
  cursor: pointer;
}

h1 {
  position: absolute;
  color: white;
  top: 3rem;
  left: 3rem;
  right: 3rem;
  text-align: center;
  font-size: 3rem;
}

footer {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  color: white;
  font-family: monospace;
  font-size: 14px;
  font-weight: 400;
}

a {
  color: inherit;
}
</style>


</head>

<body >
  <canvas class="webgl"></canvas>
<h1></h1>
<button id="play-music" type="button">Play music</button>

<script type="x-shader/x-vertex" id="vertexShader">
  uniform float uTime;
uniform float uSize;
attribute float aScale;
attribute vec3 aColor;
attribute float phi;
attribute float random;
//attribute float random1;
varying vec2 vUv;
varying vec3 vColor;

void main() {
  float .........完整代码请登录后点击上方下载按钮下载查看

网友评论0