Update 1.js

This commit is contained in:
FURK4NGG
2024-11-27 00:57:31 +03:00
committed by GitHub
parent f04ef7f32d
commit 42b95176d1
+2 -5
View File
@@ -1,14 +1,13 @@
// Kutucukları seç
/*SERVICES VISIBILITY*/
const boxes = document.querySelectorAll('.services_id');
// Görünürlük kontrol fonksiyonu
function checkVisibility() {
const triggerBottom = window.innerHeight * 0.8; // Ekranın %80'i tetik noktası
const triggerBottom = window.innerHeight * 0.8;
boxes.forEach((box) => {
const boxTop = box.getBoundingClientRect().top;
// Eğer kutunun üst kenarı tetikleme noktasını geçerse görünür yap
if (boxTop < triggerBottom) {
box.classList.add('visible');
box.classList.remove('hidden');
@@ -20,12 +19,10 @@ function checkVisibility() {
});
}
// Scroll ve yükleme olaylarını dinle
window.addEventListener('scroll', checkVisibility);
window.addEventListener('load', checkVisibility);
/*IMAGE CHANGER*/
let currentIndex = 0;
const images = document.querySelectorAll('#photo img');