Corkboard/source/js/objects/page.js

19 lines
617 B
JavaScript
Raw Permalink Normal View History

2023-04-23 19:51:14 +00:00
import { BoardObject } from "../boardObject.js";
export class Page extends BoardObject {
constructor(x, y, width, height, rotation = 0, url) {
const margins = { left: 86, right: 10, top: 83, bottom: 0 };
super(x, y, width, height, "note", margins);
this.el.style.width = `${width}px`;
this.el.style.height = `${height}px`;
this.el.style.backgroundImage = `url(${url})`;
this.el.style.backgroundSize = `contain`;
this.rotate(rotation);
}
rotate(rotation) {
this.rotation = rotation;
this.el.style.rotate = `${rotation}deg`;
}
}