class Rect {
constructor(x, y, w, h) {
this.x = x
this.y = y
this.w = w
this.h = h
this.c = palette[randInt(1, palette.length)]
this.offset = map(x + y, 0, 1080, 0, .2)
}
display(s, t) {
const tt = (t - this.offset) % 1
s.stroke(0)
s.fill(this.c)
const sw = ease(linearstepUpDown(tt, .1, .4, .5, .65), 2) * 1.5
s.strokeWeight(sw)
const h = easing.easeBounceOut(linearstep(tt, .1, .4)) * this.h
const x = ease(linearstep(tt, .5, .65), 2) * this.w
s.rect(this.x + x, this.y, this.w - x, h)
}
}