JSFiddle - React, Tailwind, and code Playground
by evgkch
Babel + JSX
class Matrix {
static EMPTY = 'empty'
constructor(n, m) {
}
}
class Element {
static PLUS = 'plus'
static MINUS = 'minus'
constructor(dx, dy){
this.dx = dx;
this.dy = dy;
this.x = 0;
this.y = 0;
}
move(x, y){
this.x = x;
this.y = y;
}
resizeTop(dy){
const y = this.y + this.dy - dy;
if (y > 1)
this.y = y;
}
resizeRight(dx) {
const x = this.dx + dx;
if (x > 1)
this.dx = y;
}
resizeTopRight(dx, dy) {
this.dx = dx;
this.y += this.dx - dx;
}
}