<script>
document.addEventListener("DOMContentLoaded", function() {
(function () {
const glZero = document.querySelector('.uc-gl-zero');
const listGL = {
'uc-gl-1':'glZero1',
'uc-gl-2':'glZero2',
'uc-gl-3':'glZero3',
'uc-gl-4':'glZero4',
'uc-gl-5':'glZero5',
'uc-gl-6':'glZero6',
};
if(glZero!=null){
let correctListNum = 0;
for (key in listGL) {
const gl09 = document.querySelector('.'+key);
const zeroHtml = glZero.querySelector('.'+listGL[key]);
if(gl09!=null && zeroHtml!=null){
const zeroHtmlTnAtom = zeroHtml.querySelector('.tn-atom');
zeroHtmlTnAtom.innerHTML = '';
zeroHtmlTnAtom.append(gl09);
correctListNum++;
}else{
console.log('listGL not correct or there are no matches');
return;
};
};
const zeroHtmls = glZero.querySelectorAll('div[class*="glZero"]');
function hideGlElements(){
for (let key of zeroHtmls) {
key.classList.remove('show-gl');
};
};
const lengthList = Object.keys(listGL).length;
if(correctListNum==lengthList){
glZero.querySelector('.glZero1').classList.add('show-gl');
let index=1;
glZero.querySelector(".gl-button-right").addEventListener('click', function(event) {
index++;
if(index>lengthList) index=1;
hideGlElements();
glZero.querySelector(".glZero"+index).classList.add('show-gl');
});
glZero.querySelector(".gl-button-left").addEventListener('click', function(event) {
index--;
if(index<1) index=lengthList;
hideGlElements();
glZero.querySelector(".glZero"+index).classList.add('show-gl');
});
window.addEventListener('resize', function(event) {
clearTimeout(window.resizedFinished);
window.resizedFinished = setTimeout(function(){
window.dispatchEvent(new Event('resize'));
}, 1000);
});
};
};
})();
});
</script>
<style>
div[class*="uc-gl-"] .t410__col {
margin: 0;
max-width: none;
}
div[class*="glZero"] {
opacity: 0;
pointer-events: none;
}
div[class*="glZero"].show-gl {
opacity: 1;
pointer-events: all;
}
div[class*="gl-button-"] {
cursor: pointer;
}
</style>