// Пусть, список будет в строке разделенной вертикальной чертой
"contacts|goods|gallery|reviews|screen".split`|`
// Находим каждый элемент
.map(data=>document.querySelector(`.blocks__item[data-item="${data}"]`))
// Вешаем на элементы событие mouseenter
.forEach(el=>el.addEventListener('mouseenter',e=>{
// Класс активного элемента надо удалить только у активного элемента
document.querySelector`.blocks__item.blocks__item--active`.classList.remove`blocks__item--active`;
// А элементу, вызвавшему это событие надо добавить класс активности
e.target.classList.add`blocks__item--active`;
// Еще где-то какому-то элементу присвоим класс, частично формирующийся из атрибута элемента события
document.querySelector`.blocks__phone-bg`.className = `blocks__phone-bg blocks__phone-bg--${e.target.getAttribute`data-item`}`;
});
// Вот и все! 'click', 'right-click' и 'double-click'.tray.setContextMenu(menu) - устанавливает переданное в параметре menu меню как контекстное меню иконки трея. tray.popUpContextMenu([menu, position]) открывает установленное либо переданное в параметре menu контекстное меню трея. Оба параметра menu и position не обязательны tray.closeContextMenu() закрывает открытое меню трея.icon. { const idgen=Object.assign(()=>idgen.gen.next().value,
{val:0,gen:(function*(){while(1)yield ++idgen.val})()});
Object.defineProperty(window,'uniqueId',{get:()=>idgen()}); }
// Проверочка
for( let i = 0; i < 3; i ++ ) console.log(uniqueId); // 1,2,3;str1 = "iii common lll part xxx";
str2 = "jjj common mmm part yyy";str1 = "iii common lll part xxx";
str2 = "jjj common part yyy";" common part "console.log('инфа по браузеру',navigator.userAgentData);
console.log('батарея',await navigator.getBattery());
console.log('местоположение',await navigator.geolocation.getCurrentPosition())
console.log('ip', await fetch('https://ipinfo.io',{credentials:'omit'}).then(res=>res.json())); document.body.addEventListener('touchstart',
event=>{
event.preventDefault();
event.stopPropagation();
Nunenune(event);
}
);pointerdown и проч.