declarativas

0.0.1-beta.15 • Public • Published

Declarativas

Declarative canvas for the browser.

Npm

Quick Demo

<canvas width="640" height="480">
  Canvas not supported
</canvas>

<script type="module">
import { render, c } from 'declarativas';

render(
  canvas.getContext('2d'),
  [
    c('save'),
    c('clearRect', {
      x: 0,
      y: 0,
      width: canvas.width,
      height: canvas.height,
    }),
    c('rotate', state.angle * Math.PI / 180),
    c('strokeStyle', '#000'),
    c('rect', {
      x: 100,
      y: 100,
      width: 20,
      height: 20,
    })
    c('restore'),
  ]),
);
</script>

More holistic demo

Demo source is probably the more interactive demo currently.

Other Resources

Readme

Keywords

none

Package Sidebar

Install

npm i declarativas

Weekly Downloads

0

Version

0.0.1-beta.15

License

MIT

Unpacked Size

42.1 kB

Total Files

39

Last publish

Collaborators

  • mrozbarry