html5 canvas underwater waterweed animation
代码片段:
Stem.prototype.draw = function(ctx) {
var len, ctrlPoint, point;
len = this.points.length - 1;
ctrlPoint = {x: 0, y: 0};
ctx.save();
ctx.strokeStyle = this.color;
ctx.beginPath();
ctx.moveTo(this.points[this.points.length - 1].x, this.points[this.points.length - 1].y);
for (var i = len; i >= 1; i--) {
point = this.points[i];
ctrlPoint.x = (point.x + this.points[i - 1].x) / 2;
ctrlPoint.y = (point.y + this.points[i - 1].y) / 2;
ctx.quadraticCurveTo(point.x, point.y, ctrlPoint.x, ctrlPoint.y);
ctx.lineWidth = i * 1.1;
ctx.stroke();
ctx.fillStyle = 'red';
}
ctx.restore();
}
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
02 Apr 2018
This article shares with you the text animation special effects based on HTML5 Canvas. It is very useful. Friends in need can use it for reference.
08 Mar 2017
HTML5 is really an excellent web technology. It not only allows you to manipulate page elements more conveniently, but also allows you to achieve more animation effects through canvas. After the introduction of the HTML5 standard, CSS3 can play a greater role. This article mainly introduces some animation special effects based on HTML5 Canvas and shares them with you. I hope you like them. 1. HTML5 Canvas waterfall animation, super realistic. This is a very realistic HTML5 waterfall animation, based on Canvas, the effect is quite cool. Online demo source code download 2. HTML5 Canvas color..
16 May 2016
This article mainly introduces JavaScript+html5 canvas to achieve video special effects of fragmentation and reorganization. Interested friends can refer to it.
16 May 2016
This is a cool HTML5 Canvas animation. It will simulate the animation special effects of fireworks blooming in our real life. The effect is very realistic. Let's briefly analyze the process and code of implementing this HTML5 fireworks special effect. It is mainly composed of HTML code. , CSS code and Javascript code, of course the javascript code is the most important
22 Mar 2017
Demonstrate animation drawing skills based on HTML5 Canvas to achieve frame playback effects. It also demonstrates the basic skills of moving objects.
07 Mar 2017
HTML5 is indeed a new technology that revolutionizes browsers and even the entire software industry. It can help us web developers easily implement animation effects on web pages without the need for bloated Flash as support. This article shares 7 top HTML5 Canvas animations, all of which have very good effects. 1. 3D HTML5 Logo animation HTML5 multi-view 3D rotation animation HTML5 3D animation is very convenient to implement. The 3D rotation plug-in based on jQuery introduced before is implemented by playing multiple multi-view pictures, and the HTML5 3D rotation shared today Animation is made using...
19 Jan 2017
This is a Loading animation special effect based on HTML5 Canvas and Rebound animation. The loading animation uses a canvas to cover the entire page and displays a polygonal loading loader to represent the loading progress.
01 Mar 2019
In the process of web design, we often use some HTML5 special effects codes. Here are some cool and practical HTML5 special effects codes compiled and shared by php Chinese website. You can feel free to use them in your applications.
15 Jun 2017
Applications based on HTML5 are now very widespread. Today we will share with you 20 very gorgeous HTML5/CSS3 application plug-ins. Hope you all like it and share it with your friends. 1. HTML5 video breaking and reorganization special effects. Powerful visual impact. There are many HTML5 video players, but HTML5 video special effects are still rare. This HTML5 video breaking and reorganization special effect is very exciting and gives people a strong visual impact. Click anywhere in the video, and HTML5 will break these areas into pieces. After a while, these broken video fragments will automatically reassemble...
Hot Tools
HTML5 Canvas heart fluttering animation special effects
HTML5 Canvas heart fluttering animation special effect is a generated animation that can be directly opened with a browser to see a heart.
H5 panda bouncing game source code
HTML5 Mobile Panda is also a crazy game source code. Game description: Press and hold the screen to adjust the strength of the panda spring and jump to the stone pillar. The game ends if you fall into the river.
HTML5 Valentine's Day box animation special effects
Based on svg, draw animations of opening love box gifts on Valentine's Day, and special effects of love box animation.
H5 3D rolling ball game source code
HTML5 cool 3D ball rolling mobile game code download. Game introduction: A colored ball rolls, and the current track of the colored ball is controlled by dragging it with the mouse or the touch screen of the mobile phone. This is a simple and easy-to-operate mobile game source code.