function roboChat(authorName, authorPhoto) {
function robochatFirstStep() {
firstMessage.innerHTML = '<img class="roboChatLeaveComment__message__img" src="' + roboChatauthorImg + '" alt="' + roboChatauthorName + '">Добрый день! Понравилась ли Вам моя публикация?';
robochatRating.style.display = 'flex'
var likeBtnRating = document.querySelector('#likeArticle_BTN');
var dislikeBtnRating = document.querySelector('#dislikeArticle_BTN')
likeBtnRating.addEventListener('click', robochatSecondStep);
dislikeBtnRating.addEventListener('click', robochatSecondStep);
document.querySelector('#dislikeArticle_BTN').onclick = '';
}
if (document.querySelector('.roboChatLeaveComment__body__message')) {
setTimeout(function(){
// вот тут не отрабатывает
robochatFirstStep();
}, 5000);
}
function robochatSecondStep() {
$roboChatLeaveCommentBody.innerHTML += '<div class="roboChatLeaveComment__body__message">' + roboChatMessWriting + '</div>';
setTimeout(roboChatThirdStep, 5000)
};
function roboChatThirdStep() {
$roboChatLeaveCommentBody.removeChild($roboChatLeaveCommentBody.lastChild);
$roboChatLeaveCommentBody.innerHTML += '<div class="roboChatLeaveComment__body__message"><img class="roboChatLeaveComment__message__img" src="' + roboChatauthorImg + '" alt="' + roboChatauthorName + '">Спасибо! Давайте ее обсудим!</div>';
}
// keyRobochat = true;
}
function theme() {
let now = new Date();
let hours = now.getHours();
if (hours > 12 || hours < 8) {
console.log('dark')
} else {
console.log('light')
}
}
setInterval(theme, 1000)