vue实现彩色斑点下落融合动画效果代码

代码语言:html

所属分类:动画

代码描述:vue实现彩色斑点下落融合动画效果代码

代码标签: 斑点 下落 融合 动画 效果

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

<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
    html,body {
  margin: 0;
  padding: 0;
}

#svg-container {
  position: fixed;
  width: 100%;
  height: 100%;
}

svg {
  display: block;
  width: 100%;
  height: 100%;
}

.blob {
  filter: url('#blobFilter');
}

.elt {
  visibility: hidden;
  animation-name: animation;
  animation-duration: 2s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

@keyframes animation {
  0% {
    visibility: visible;
    transform: translateX(0) translateY(-70%);
  }

  25% {
    transform: translateX(-1%) translateY(-35%);
  }

  50% {
    transform: translateX(+1%) translateY(0);
  }

  75% {
    transform: translateX(-1%) translateY(35%);
  }

  100% {
    transform: translateX(0) translateY(70%);
  }
}

</style>

</head>
<body>

<div id="app">
  <div id="svg-container">
    <svg id="svg" ref="svg" xmlns="http://www.w3.org/2000/svg" class="blob">
      <defs>
        <filter id="blobFilter">
          <feGaussianBlur in="SourceGraphic" :key="blur" :std-deviation.camel="blur" result="blur" />
          <feColorMatrix in="blur" mode="matrix" :key="alphaMult+'-'+alphaAdd" :values="'1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 '+alphaMult+' '+alphaAdd" result="goo" />
          <!-- <feBlend in="SourceGraphic" in2="goo" /> -->
        </filter>
      </defs>
      <g :transform="transform">
        <circle v-for="e in elements" :cx="e.x" :cy="e.y" :r="e.r" :style="estyle(e)" class="elt" />
      </g>
    </svg>
  </div>
</div>

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/vue.2.2.min.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/dat.gui-min.js"></script>
<script type="text/javascript" src="//repo.bf.........完整代码请登录后点击上方下载按钮下载查看

网友评论0