Use canvas for ultra-brilliant rotating squares

Source: Internet
Author: User

I accidentally a small "bug", but let the animation become super Brilliant = =

So, do not be afraid of the bug, who knows the bug will not open a fancy flower?

<!DOCTYPE HTML><HTMLLang= "en">    <Head>        <MetaCharSet= "Utf-8">        <title></title>        <style>Body{text-align:Center;            }Canvas{Border:1px dashed Green;            }        </style>    </Head>    <Body>         <CanvasID= "CVS"width= "$"Height= "All"></Canvas>    <Script>        varCVS=document.getElementById ("CVS"); varContext=Cvs.getcontext ("2d"); /*Ultra-Brilliant rotation*/        varAgle=0; Context.translate (Cvs.width/2-50,cvs.height/2- -) SetInterval (function () {            //Erase the canvas (because the axis rotates for the reason, without wiping it completely)Context.clearrect (- -,- -, -, -);            Context.rotate (Agle); Context.strokerect (0,0, -, -); Agle+=0.01; }, -)    </Script>    </Body></HTML>

Use canvas for ultra-brilliant rotating squares

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.