svg+js实现水面波光粼粼动画效果代码

代码语言:html

所属分类:动画

代码描述:svg+js实现水面波光粼粼动画效果代码

代码标签: svg js 水面 波光 粼粼 动画

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

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

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

  
  
<style>
*{
	margin: 0;
	padding: 0;
}
html, body {
	min-height: 100vh;
}
body {
	display: grid;
	justify-items: center;
	align-items: center;
	background: #caf0f870;
}
svg {
	aspect-ratio: 1;
	width: 85vmin;
	box-shadow: 0 0 30px 1px #0077b6;
}
</style>

  
  
  
</head>

<body>
  <svg viewBox="0 0 1000 1000">
	<filter id="displacementFilter1">
    <feTurbulence
      type="turbulence"
      baseFrequency="0.006"
      numOctaves="1"
			stitchTiles="noStitch"
      result="turbulence" />
		
		<feColorMatrix in="turbulence" type="hueRotate" values="0" result="animate">
			<animate attributeName="values" from="0" to="360" dur="3s" repeatCount="indefinite"/>
		</feColorMatrix>
		
		<feColorMatrix
      in="animate"
      type="matrix"
      values="0 0 0 0 1
              0 0 0 0 1
              0 0 0 0 1
              .5 .5 .5 1 0"
			result="cloud"/>
		
		<feFlood flood-color="#0077b6" result="color-flood"/>
		
		<feComposite in="color-flood" in2="cloud" operator="in" result="OUTLINE"></feComposite>
  </filter>

	<filter id="displacemen.........完整代码请登录后点击上方下载按钮下载查看

网友评论0