0.0.3 • Published 12 months ago

modern-canvas v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

📦 Install

npm i modern-canvas

🦄 Usage

import { createApp, plugins } from 'modern-canvas'

const app = createApp({
  view: document.querySelector('canvas'),
  children: [
    {
      type: 'image',
      style: {
        left: 0,
        top: 0,
        width: 130,
        height: 130,
        rotation: 30,
      },
      src: '/example.jpg',
    },
    {
      type: 'text',
      style: {
        left: 60,
        top: 60,
        width: 240,
        height: 240,
        rotation: 0,
        fontSize: 40,
        color: 'red',
      },
      content: 'TEXT',
    },
    {
      type: 'video',
      style: {
        left: 60,
        top: 60,
        width: 30,
        height: 30,
        rotation: 30,
      },
      src: 'example.mp4',
    },
  ],
  plugins,
})

await app.load()

app.start()
0.0.3

12 months ago

0.0.2

1 year ago

0.0.1

1 year ago

1.0.0

3 years ago