modern-canvas
v0.0.3
Published
A data driven modern canvas library
Downloads
4
Maintainers
Readme
📦 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()