webgl照片粒子化动画效果代码

代码语言:html

所属分类:动画

代码描述:webgl照片粒子化动画效果代码

代码标签: 动画 效果

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


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

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
body {
  margin: 0;
  background-color: black;
}

.loading {
  color: white;
}

.canvas-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;

  font-family: sans-serif;

  background-color: black;
}

canvas {
  max-height: 100vh;
  max-width: 100vw;
}

.toggle-help-link {
  position: absolute;
  bottom: 10px;
  right: 10px;

  font-size: 12px;
  text-decoration: none;

  color: lightgrey;
}

.status {
  position: absolute;
  bottom: 10px;
  left: 10px;

  font-size: 12px;

  color: lightgrey;
}

.help-container {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  backdrop-filter: blur(3px);
}

.help-container .help {
  width: 90%;
  max-width: 500px;
}

.help li {
  margin-bottom: 1em;
}

.help a {
  color: inherit;
}
</style>


</head>

<body  >
  <!-- this pen was built and maintained in https://github.com/callumacrae/sketchbook/blob/master/src/views/ParticlePhotoWebgl.vue -->

<p class="loading">loading…</p>

<div class="canvas-container" style="display: none">
  <canvas
          ref="canvas"
          @click="status = status === 'playing' ? 'paused' : 'playing'"
          @dragenter.prevent
          @dragleave.prevent
          @dragover.prevent
          @drop.prevent="handleDrop"
          ></canvas>
  <GlobalEvents target="window" @resize="setSize" />

  <div class="help-container" v-show="showHelp || showIosWarning">
    <div class="help" v-sho.........完整代码请登录后点击上方下载按钮下载查看

网友评论0