Есть
<script>
document.querySelector('.blocks__item[data-item="screen"]').addEventListener('mouseenter', function() {
document.querySelector('.blocks__phone-bg').classList.add('blocks__phone-bg--screen');
document.querySelector('.blocks__phone-bg').className = 'blocks__phone-bg blocks__phone-bg--screen';
document.querySelector('.blocks__item[data-item="screen"]').classList.add('blocks__item--active');
document.querySelector('.blocks__item[data-item="goods"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="gallery"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="reviews"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="contacts"]').className = 'blocks__item';
});
document.querySelector('.blocks__item[data-item="goods"]').addEventListener('mouseenter', function() {
document.querySelector('.blocks__phone-bg').classList.add('blocks__phone-bg--goods');
document.querySelector('.blocks__phone-bg').className = 'blocks__phone-bg blocks__phone-bg--goods';
document.querySelector('.blocks__item[data-item="goods"]').classList.add('blocks__item--active');
document.querySelector('.blocks__item[data-item="screen"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="gallery"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="reviews"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="contacts"]').className = 'blocks__item';
});
document.querySelector('.blocks__item[data-item="gallery"]').addEventListener('mouseenter', function() {
document.querySelector('.blocks__phone-bg').classList.add('blocks__phone-bg--gallery');
document.querySelector('.blocks__phone-bg').className = 'blocks__phone-bg blocks__phone-bg--gallery';
document.querySelector('.blocks__item[data-item="gallery"]').classList.add('blocks__item--active');
document.querySelector('.blocks__item[data-item="screen"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="goods"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="reviews"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="contacts"]').className = 'blocks__item';
});
document.querySelector('.blocks__item[data-item="reviews"]').addEventListener('mouseenter', function() {
document.querySelector('.blocks__phone-bg').classList.add('blocks__phone-bg--reviews');
document.querySelector('.blocks__phone-bg').className = 'blocks__phone-bg blocks__phone-bg--reviews';
document.querySelector('.blocks__item[data-item="reviews"]').classList.add('blocks__item--active');
document.querySelector('.blocks__item[data-item="goods"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="gallery"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="screen"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="contacts"]').className = 'blocks__item';
});
document.querySelector('.blocks__item[data-item="contacts"]').addEventListener('mouseenter', function() {
document.querySelector('.blocks__phone-bg').classList.add('blocks__phone-bg--contacts');
document.querySelector('.blocks__phone-bg').className = 'blocks__phone-bg blocks__phone-bg--contacts';
document.querySelector('.blocks__item[data-item="contacts"]').classList.add('blocks__item--active');
document.querySelector('.blocks__item[data-item="goods"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="gallery"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="reviews"]').className = 'blocks__item';
document.querySelector('.blocks__item[data-item="screen"]').className = 'blocks__item';
});
</script>
При наведении на одно добавляеся класс у другова блока и удаляется класс у преведущего.
Как можно упростить данный скрипт, а то при добавлении всего одного блока приходиться добовлять туеву кучу данных в этот скрипт