JSFiddle - React, Tailwind, and code Playground

by Vasilii Chugunov

HTML

<button>Кнопка</button>
<div class="bonus"></div>

CSS

.bonus {
  width: 400px;
  height: 300px;
  background-color: #494;
  margin-top: 10px;
  display: none;
}

JavaScript

var intervalId = setInterval(function(){
  $('.bonus').show(1500, function(){
    setTimeout(function(){
      $('.bonus').hide(1500);
    }, 1000);
  });
}, 4000);

$('button').on('click', function(){
	clearInterval(intervalId);
})