
export class Sticker {
    constructor () {

        this.delay = 6500;

        this.max = 5;

        this.sticker = document.querySelector('#sticker');

        this.update = this.update.bind(this);

        if (!this.sticker) {
            return;
        }

        this.update();
    }

    getNo () {
        return Math.floor(Math.random() * Math.floor(this.max));
    }

    update () {
        this.sticker.dataset.sticker = this.getNo();

        setTimeout(this.update, this.delay);
    }
}

new Sticker();
