webgl实现彩色波浪液态液体流动动画效果代码

代码语言:html

所属分类:动画

代码描述:webgl实现彩色波浪液态液体流动动画效果代码

代码标签: webgl 彩色 波浪 液态 液体 流动 动画

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

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

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

  
  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap");

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #001;
}
canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#controls {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  display: flex;
  align-items: center;
  z-index: 1;
}
button {
  background-color: #4caf50;
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  border-radius: 10px;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  transition: background-color 0.3s;
  &:hover {
    background-color: #25902950;
  }
  &:active {
    background-color: #00ffffcc;
  }
}
.btn {
  background-color: rgba(0, 0, 0, 0.4);
  border: none;
  color: rgba(255, 255, 255, 0.4);
  padding: 10px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 2px 2px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}
.btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 0, 1);
}
#fullscreenBtn {
  font-size: 20px;
}

.container {
  margin: 0 auto;
  padding: 2rem;
  position: absolute;
  width: 100%;
  font-family: "Roboto", sans-serif;
  text-shadow: 0 0 5px #000, 0 0 10px #000;
  color: #fff;
  filter: drop-shadow(0 0 10px rgba(0, 0, 50, 0.7))
    drop-shadow(0 0 15px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 20px rgba(0, 0, 0, 0.3));
  z-index: 2;
}

/* Phone User */
@media (max-width: 768px) {
  h1 {
    font-size: 1.25rem;
  }
  .container {
    font-size: 0.8rem;
  }
  .btn {
    font-size: 0.8rem;
  }
  #fullscreenBtn {
    font-size: 0.8rem;
    padding: 8px 15px;
  }
}
</style>

  
  
</head>

<body translate="no">
  <canvas id="glCanvas"></canvas>

<div class="container">.........完整代码请登录后点击上方下载按钮下载查看

网友评论0