تغییر منو
Toggle preferences menu
تغییر منوی شخصی
به سامانه وارد نشده‌اید
Your IP address will be publicly visible if you make any edits.

مدیاویکی:Common.js: تفاوت میان نسخه‌ها

از ویکی معرفت
صفحه را خالی کرد
برچسب: خالی کردن
بدون خلاصۀ ویرایش
برچسب: برگردانده‌شده
خط ۱: خط ۱:
/* main page fade in */
const observer = new IntersectionObserver(
  (entries) => {
    entries.forEach((entry) => {
      if (entry.isIntersecting) {
        entry.target.classList.add('fadedin')
        entry.target.classList.remove('fadein')
      } else {
        entry.target.classList.remove('fadedin')
        entry.target.classList.add('fadein')
      }
    })
  },
  {
    rootMargin: '0px',
    threshold: [0, 0.1, 1],
  },
)


const tags = document.querySelectorAll('div')
tags.forEach((tag) => {
  observer.observe(tag)
})

نسخهٔ ‏۲۸ نوامبر ۲۰۲۵، ساعت ۱۱:۰۶

/* main page fade in */
const observer = new IntersectionObserver(
  (entries) => {
    entries.forEach((entry) => {
      if (entry.isIntersecting) {
        entry.target.classList.add('fadedin')
        entry.target.classList.remove('fadein')
      } else {
        entry.target.classList.remove('fadedin')
        entry.target.classList.add('fadein')
      }
    })
  },
  {
    rootMargin: '0px',
    threshold: [0, 0.1, 1],
  },
)

const tags = document.querySelectorAll('div')

tags.forEach((tag) => {
  observer.observe(tag)
})