From 828deff8ebbe6f8fa0149cac9862692291ff9913 Mon Sep 17 00:00:00 2001 From: FURK4NGG <105324908+FURK4NGG@users.noreply.github.com> Date: Thu, 20 Feb 2025 18:09:14 +0300 Subject: [PATCH] Update 1.js --- JAVASCRIPT/1.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/JAVASCRIPT/1.js b/JAVASCRIPT/1.js index 664e2aa..711116a 100644 --- a/JAVASCRIPT/1.js +++ b/JAVASCRIPT/1.js @@ -1,3 +1,28 @@ +/*SERVICES VISIBILITY*/ +const boxes = document.querySelectorAll('.services_id'); + +// Görünürlük kontrol fonksiyonu +function checkVisibility() { + const triggerBottom = window.innerHeight * 0.8; + + boxes.forEach((box) => { + const boxTop = box.getBoundingClientRect().top; + + if (boxTop < triggerBottom) { + box.classList.add('visible'); + box.classList.remove('hidden'); + } else { + // Aksi halde kutuyu gizle + box.classList.remove('visible'); + box.classList.add('hidden'); + } + }); +} + +window.addEventListener('scroll', checkVisibility); +window.addEventListener('load', checkVisibility); + + /*IMAGE CHANGER*/ let currentIndex = 0; const images = document.querySelectorAll('#photo img');