canvas实现三维水波波纹文字动态效果代码

代码语言:html

所属分类:三维

代码描述:canvas实现三维水波波纹文字动态效果代码,可以输入指定文字实现出水波纹动画效果。

代码标签: canvas 三维 水纹 波纹 文字

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

<!doctype html> 
<html lang="en">
	<head>
		<meta charset="utf-8"> 
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">

		<style type="text/css"> 
			body { background-color: #000000; margin: 0px; overflow: hidden; }
			#info { position: absolute; top: 0px; width: 100%; color: #00a0c0; padding: 5px; font-family:Monospace; font-size:13px; text-align:center; }
		</style>
	</head>
	<body>
	
 
		<div id="container"></div> 
		<div id="info">Type some text and hit enter. Click to draw waves.</div> 

		<script type="text/javascript">

			var QUALITY_X = 6, QUALITY_Y = 3,
			WIDTH = Math.floor(window.innerWidth / QUALITY_X), HEIGHT = Math.floor(window.innerHeight / QUALITY_Y), SIZE = WIDTH * HEIGHT,
			HEIGHT_HALF = Math.floor(HEIGHT / 2),
			TEXT_OFFSETY = Math.floor((HEIGHT - 64) / 2),

			context, image, data,
			buffer1, buffer2, tempbuffer,

			canvasHeightMap, contextHeightMap, imageHeightMap, dataHeightMap,
			canvasText, contextText, imageText, dataText,

			input, text,
 
	.........完整代码请登录后点击上方下载按钮下载查看

网友评论0