基于canvas的粒子文字动画特效,先来看看效果:
部分核心的代码如下(全部代码在文章末尾):
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>基于canvas的粒子组成文字动画特效</title>
<link rel="stylesheet" type="text/css" href="assets/css/base.css" />
<link rel="stylesheet" type="text/css" href="assets/css/demo.css" />
</head>
<body>
<!-- COIDEA:header START -->
<header class="coidea-header">
<div class="coidea-links">
<a class="coidea-icon-back" href="" title="返回下载页">C</a>
<a class="coidea-icon-github" href="" target="_blank" title="">G</a>
</div>
</header>
<!-- COIDEA:header END -->
<!-- COIDEA:demo START -->
<section id="ci-particles">
<canvas id="canvas"></canvas>
<h1 id="headline">PHP中文网</h1>
</section>
<!-- COIDEA:demo END -->
<script src="assets/js/demo.js"></script>
</body>
</html>
全部代码:基于canvas的粒子文字动画特效