document.addEventListener('DOMContentLoaded', () => {
const buttonOpen = document.querySelector('.ob-widget-btn');
const buttonClose = document.querySelector('.ob-widget-container__header__close__cross');
buttonOpen.addEventListener('click', () => {
document.body.classList.add('darken');
});
buttonClose.addEventListener('click', () => {
document.body.classList.remove('darken');
});
});
.offcanvas-menu
вложен в элемент #wrapper
, а на странице контактов не вложен? И поэтому не работает стиль .uc-offcanvas-left.slide-in-on-top .uc-offcanvas-container {
-webkit-transform: translate3d(-100%, 0, 0);
-moz-transform: translate3d(-100%, 0, 0);
-ms-transform: translate(-100%, 0);
-o-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
, а? let clock = document.querySelector('.clock');
let arrColors = ['rgba(255, 0, 0, .1)','rgba(255, 0, 0, .2)','rgba(255, 0, 0, .3)','rgba(255, 0, 0, .4)','rgba(255, 0, 0, .5)','rgba(255, 0, 0, .6)', 'rgba(255, 0, 0, .7)', 'rgba(255, 0, 0, .8)','rgba(255, 0, 0, .9)', 'rgba(255, 0, 0, 1)'];
const changeColor = (color, delay) => {
clock.style.filter = `drop-shadow(0 0 14px ${color})`;
return new Promise((resolve) => setTimeout(resolve, delay));
}
setInterval(async function(func){
for(let i = 0; i < arrColors.length; i++){
await func(arrColors[i], 2000);
}
}, arrColors.length * 2000, changeColor);