How to use canvas to create particle fountain animation effects

php中世界最好的语言
Release: 2017-11-24 14:10:06
Original
3066 people have browsed it

This time I will bring you the effect of using canvas to create particle fountain animation. How to use canvas to create particle fountain animation. What aspects need to be paid attention to in canvas particle fountain animation? Let’s do a small case first

<!DOCTYPE html>
<html >
<head>
  <meta charset="UTF-8">
  <title>canvas粒子喷泉动画</title>
         <meta name="keywords" content=" canvas粒子喷泉动画" />
         <meta name="description" content=" canvas粒子喷泉动画" />
         <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div>鼠标点击,增加粒子喷泉效果</div>
<canvas id="fireworks"></canvas>
<script src="js/index.js"></script>
</body>
</html>
Css部分:
body,
html,
canvas {
  margin: 0;
  padding: 0;
  background-color: #111;
  overflow: hidden;
}
 
canvas {
  background-color: transparent;
  position: relative;
  z-index: 2;
}
 
.text {
  position: absolute;
  left: 0;
  top: 20px;
  width: 100%;
  text-align: center;
  font-size: 3.7vw;
  color: #fff;
  z-index: 1;
  opacity: 0.2;
}
Copy after login

The above is the whole process of using canvas to create particle fountain animation. Friends who are interested can do it themselves. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Related reading:

For more exciting information, please pay attention to other related articles on the php Chinese website!

How to use the Css3 animation property

How to use the text-shadow font shadow of CSS3

The above is the detailed content of How to use canvas to create particle fountain animation effects. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template