var funcName = "sum";
window[funcName] = function () {
console.log(1 + 2);
};
window.sum();
var a = "sum";
globalThis[a] = function () {
console.log(1 + 3);
};
sum();
var a = "sum";
window[a] = function () {
console.log(1 + 4);
};
sum();
const nodes = document.querySelectorAll('.tab-content')
let sortedNodes = Array.from(nodes).sort((el1, el2) => el1.dataset.tab_content - el2.dataset.tab_content)
const container = document.querySelector('.container')
sortedNodes.forEach((el) => {
container.insertAdjacentElement('beforeend', el)
})
function scrollReveal() {
var revealPoint = 150;
var revealElement = document.querySelectorAll(".scrollReveal");
for (var i = 0; i < revealElement.length; i++) {
var windowHeight = window.innerHeight;
var revealTop = revealElement[i].getBoundingClientRect().top;
if (revealTop < windowHeight - revealPoint) {
revealElement[i].classList.add("animated");
}
}
}
window.addEventListener("scroll", scrollReveal);
scrollReveal();
function scrollReveal() {
var revealPoint = 150;
var revealElement = document.querySelectorAll(".scrollReveal");
for (var i = 0; i < revealElement.length; i++) {
var windowHeight = window.innerHeight;
var revealTop = revealElement[i].getBoundingClientRect().top;
if (revealTop < windowHeight - revealPoint) {
revealElement[i].classList.add("animated");
window.removeEventListener('scroll', scrollReveal)
}
}
}
window.addEventListener("scroll", scrollReveal);
scrollReveal();
let interval = null
class Slider {
constructor(elemID, onLoad) {
this.elem = document.querySelector(`#${elemID}`);
this.slidesMain = this.elem.querySelectorAll('.slide');
this.currentSlide = 0
this.onLoad = onLoad
this.changeSlideOnHover()
if (onLoad) {
this.changeSlideOnLoad()
}
}
nextSlide() {
this.slidesMain[this.currentSlide].classList.remove("showing");
this.currentSlide = (this.currentSlide + 1) % this.slidesMain.length;
this.slidesMain[this.currentSlide].classList.add("showing");
}
changeSlideOnHover() {
this.elem.addEventListener("mouseenter", () => {
clearTimeout(interval)
this.nextSlide()
interval = setInterval(() => {
this.nextSlide()
}, 6000);
});
this.elem.addEventListener("mouseleave", () => {
clearTimeout(interval)
});
}
changeSlideOnLoad() {
this.nextSlide()
interval = setInterval(() => {
this.nextSlide()
}, 6000);
}
}
const slider1 = new Slider('slidesLeft', true);
const slider2 = new Slider('slidesRight', false);
.presentation-title {
position: relative;
padding-bottom: 124px;
font-size: 75px;
color: #ffffff;
z-index: 2;
font-weight: 800;
pointer-events: none;
}