Home JS special effects html5 special effects HTML5 tangram special effects

HTML5 tangram special effects

HTML5 tangram special effects

HTML5 tangram special effects

var c=document.getElementById("mycanvas");
var ctx= c.getContext("2d");
// The first triangle
// Start drawing
ctx.beginPath();
// Base point for drawing
ctx.moveTo(0,0);
// Draw a straight line from the previous point to this point
ctx.lineTo(300,300);
ctx.lineTo(0,600);
ctx.closePath();//Filling or closing. You need to close the path before you can draw it
// Hollow Triangle
// ctx.strokeStyle="#FF7900";
// ctx.stroke();
// Solid triangle
ctx.beginPath();
ctx.moveTo(0,0);
ctx.lineTo(300,300);
ctx.lineTo(0,600);
ctx.closePath();//Filling or closing. You need to close the path before you can draw it
// Carry out drawing processing
ctx.fillStyle = 'rgba(200,0,0,0.5)';
ctx.fill();

The html5 canvas drawing tangram special effect is a colorful web tangram code.

Disclaimer

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

HTML5 selected special effects code sharing (collection) HTML5 selected special effects code sharing (collection)

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.

Text animation special effects based on HTML5 Canvas Text animation special effects based on HTML5 Canvas

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.

HTML5 Canvas realizes the special effects of fireworks blooming HTML5 Canvas realizes the special effects of fireworks blooming

03 Jul 2018

This is a gorgeous HTML5 Canvas animation. It will simulate the animation special effects of fireworks blooming in our lives. The effect is very realistic. Let’s briefly analyze the process and code of implementing this HTML5 fireworks special effect. For those who are interested You can refer to it

Share a snake special effects code implemented in html5 Share a snake special effects code implemented in html5

04 May 2017

In this article, the editor will share with you a simple snake special effects code implemented in html5. Friends who like it can take a look.

Realistic fireworks special effects plug-in based on HTML5 canvas Realistic fireworks special effects plug-in based on HTML5 canvas

18 Jan 2017

jquery-fireworks is a jQuery plug-in for realistic fireworks special effects based on HTML5 Canvas. The plugin is simple to use and freely configurable. It can generate realistic fireworks effects in a div container.

Download 5 HTML5 special effects commonly used in web development Download 5 HTML5 special effects commonly used in web development

20 Jun 2017

HTML5 has now become a popular trend in WEB development. HTML5 has many long-awaited new features. Nowadays, many web developers are beginning to use HTML5 to create various rich web applications instead of Flash. PHP Chinese website recommends 5 HTML5 special effects commonly used in web development.

Detailed introduction to 7 amazing HTML5 particle animation special effects Detailed introduction to 7 amazing HTML5 particle animation special effects

06 Mar 2017

One of the great advantages of HTML5 is that it can more conveniently and efficiently create particle animation special effects on web pages, especially the Canvas feature, which can draw any graphics and animation on web pages. This article will share 7 amazing HTML5 particle animation effects. These particle effects provide source code download for everyone to learn. 1. HTML5 Canvas particle simulation effect This is a 30,000 particle animation simulated using HTML5 Canvas. When you move the mouse on the canvas, some particles around the mouse will move with you and form a certain pattern. Just like you are playing with sand art, the effect...

A graphic and text appreciation of 8 gorgeous HTML5 text animation special effects A graphic and text appreciation of 8 gorgeous HTML5 text animation special effects

06 Mar 2017

Text is the soul of web pages. A long time ago, someone invented many beautiful computer fonts, which gave web pages different styles. With the emergence of HTML5 and CSS3, we can make text more personalized. In some situations where necessary, we can even use HTML5 to animate text. This article shares 8 very gorgeous HTML5 text animation special effects, I hope it can be used as a reference for you. 1. CSS3 3D folding and flipping text animation Today we are going to share a CSS3 text special effects application. It is similar to the HTML5/CSS3 text effects shared before. It is also a CSS3 3D folding and flipping text animation, only...

HTML5 css3 progress bar countdown animation special effects code [recommended]_html5 tutorial skills HTML5 css3 progress bar countdown animation special effects code [recommended]_html5 tutorial skills

16 May 2016

The editor below will share with you an HTML5 css3 progress bar countdown animation special effects code [recommended]. Hope it helps everyone. Let’s follow the editor and take a look.

See all articles See all articles

Hot Tools

HTML5 Canvas heart fluttering animation special effects

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

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

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

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.