Skip to content

Draw animated canvases by just specifying some parameters in a HTML data attribute

Notifications You must be signed in to change notification settings

normai/canvasgear

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CanvasGear v0.2.8

Slogan : Draw animated canvases by specifying parameters in a data attribute

Features :

  • Paint canvases after parameters in a data attribute
  • Provide a framework for writing canvas graphics
  • Provide mechanism for cyclically animated canvases
  • Interaction with mouse and keyboard
  • Sound from files or inline
  • Browser compatibility from IE 9 up
  • Small footprint
  • No dependencies

Status : Works, but has only few boring algorithms on board

Demos : https://www.trekta.biz/../canvasgear/docs/index.html.

Installation :

      <head>
         ...
         <script src="./canvasgear.combi.js"></script>     <!-- 1. load script -->
         ...
      </head>
      <body>
         ...
         <canvas                                              <!-- 2. Put a canvas tag -->
            data-cvgr="algo=pulse color=hotpink hertz=0.197"  <!-- 3. Put the data-cvgr attribute -->
            width="123" height="123"                          <!-- 4. Put width and height attribute -->
            id="myCanvas44">                                  <!-- 5. Put an ID attribute -->
         </canvas>
         ...
      </body>
  • Now the given canvas should appear on the page

Programming :

  • To experiment with your own algorithm, copy file riders/canvasgear.Template.js or any other rider file to one with your new algorithm name, e.g. canvasgear.MyAlgo2.js and edit this. It will be recognized automatically.
  • To debug or edit CanvasGear itself, just use the plain canvasgear.js with the libs and riders folders behind, instead the standalone script canvasgear.combi.js

License : GNU LGPL v3 or later opensource.org/licenses/LGPL-3.0

 

Have fun

Norbert, 2024-April-29   2021-April-26

[project 20140815°0111 folder 20140815°0122 file 20140815°0123]

About

Draw animated canvases by just specifying some parameters in a HTML data attribute

Resources

Stars

Watchers

Forks

Packages

No packages published