🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:main.js
(function($) { 'use strict'; const UNFIA = { init() { this.preloader(); this.stickyHeader(); this.smoothScroll(); this.backToTop(); this.initAOS(); this.initSwiper(); this.initCounters(); this.initParticles(); this.initCountdown(); this.initDonationButtons(); this.scrollAnimations(); }, preloader() { const preloader = document.getElementById('preloader'); if (preloader) { window.addEventListener('load', () => { preloader.style.opacity = '0'; preloader.style.visibility = 'hidden'; setTimeout(() => { preloader.style.display = 'none'; }, 500); }); setTimeout(() => { preloader.style.opacity = '0'; preloader.style.visibility = 'hidden'; setTimeout(() => { preloader.style.display = 'none'; }, 500); }, 2000); } }, stickyHeader() { const header = document.querySelector('.header-sticky'); if (!header) return; let lastScroll = 0; window.addEventListener('scroll', () => { const scroll = window.scrollY; if (scroll > 100) { header.classList.add('scrolled'); } else { header.classList.remove('scrolled'); } if (scroll > 200) { header.style.transform = `translateY(${Math.min(0, lastScroll - scroll)}px)`; } lastScroll = scroll; }, { passive: true }); }, smoothScroll() { document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function(e) { const target = document.querySelector(this.getAttribute('href')); if (target) { e.preventDefault(); const offset = 100; const top = target.getBoundingClientRect().top + window.scrollY - offset; window.scrollTo({ top, behavior: 'smooth' }); } }); }); }, backToTop() { const btn = document.getElementById('backToTop'); if (!btn) return; window.addEventListener('scroll', () => { if (window.scrollY > 300) { btn.classList.add('show'); } else { btn.classList.remove('show'); } }, { passive: true }); }, initAOS() { if (typeof AOS !== 'undefined') { AOS.init({ duration: 800, easing: 'ease-out-cubic', once: true, offset: 50, }); } }, initSwiper() { if (typeof Swiper === 'undefined') return; const testimonialSlider = document.querySelector('.testimonial-slider'); if (testimonialSlider) { new Swiper(testimonialSlider, { slidesPerView: 1, spaceBetween: 24, loop: true, autoplay: { delay: 5000, disableOnInteraction: false }, pagination: { el: '.swiper-pagination', clickable: true }, breakpoints: { 768: { slidesPerView: 2 }, 1024: { slidesPerView: 3 }, } }); } const partnerSlider = document.querySelector('.partner-slider'); if (partnerSlider) { new Swiper(partnerSlider, { slidesPerView: 2, spaceBetween: 24, loop: true, autoplay: { delay: 3000, disableOnInteraction: false }, breakpoints: { 576: { slidesPerView: 3 }, 768: { slidesPerView: 4 }, 1024: { slidesPerView: 5 }, } }); } }, initCounters() { if (typeof $.fn.counterUp !== 'undefined') { $('.counter').counterUp({ delay: 10, time: 1500, }); } }, initParticles() { if (typeof particlesJS === 'undefined') return; const particlesDiv = document.getElementById('particles-js'); if (!particlesDiv) return; particlesJS('particles-js', { particles: { number: { value: 120, density: { enable: true, value_area: 800 } }, color: { value: ['#1AA9E8', '#38BDF8', '#ffffff', '#1F45D8'] }, shape: { type: 'circle' }, opacity: { value: 0.5, random: true, anim: { enable: true, speed: 1, opacity_min: 0.1 } }, size: { value: 3, random: true, anim: { enable: true, speed: 2, size_min: 0.1 } }, line_linked: { enable: true, distance: 150, color: '#ffffff', opacity: 0.15, width: 1, }, move: { enable: true, speed: 1.5, direction: 'none', random: true, straight: false, out_mode: 'out', bounce: false, }, }, interactivity: { detect_on: 'canvas', events: { onhover: { enable: true, mode: 'grab' }, onclick: { enable: true, mode: 'push' }, resize: true, }, modes: { grab: { distance: 140, line_linked: { opacity: 0.3 } }, push: { particles_nb: 4 }, }, }, retina_detect: true, }); }, initCountdown() { const timer = document.getElementById('conferenceCountdown'); if (!timer) return; const targetDate = new Date(timer.dataset.date).getTime(); const updateTimer = () => { const now = new Date().getTime(); const diff = targetDate - now; if (diff <= 0) return; const days = Math.floor(diff / (1000 * 60 * 60 * 24)); const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60)); const seconds = Math.floor((diff % (1000 * 60)) / 1000); timer.querySelector('.days').textContent = String(days).padStart(2, '0'); timer.querySelector('.hours').textContent = String(hours).padStart(2, '0'); timer.querySelector('.minutes').textContent = String(minutes).padStart(2, '0'); timer.querySelector('.seconds').textContent = String(seconds).padStart(2, '0'); }; updateTimer(); setInterval(updateTimer, 1000); }, initDonationButtons() { const amountBtns = document.querySelectorAll('.amount-btn'); const customAmount = document.querySelector('.custom-amount'); if (!amountBtns.length) return; amountBtns.forEach(btn => { btn.addEventListener('click', () => { amountBtns.forEach(b => b.classList.remove('active')); btn.classList.add('active'); if (btn.dataset.amount === 'custom') { customAmount.style.display = 'block'; customAmount.focus(); } else { customAmount.style.display = 'none'; customAmount.value = btn.dataset.amount; } }); }); }, scrollAnimations() { const observerOptions = { threshold: 0.1, rootMargin: '0px 0px -50px 0px', }; const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('animate-visible'); observer.unobserve(entry.target); } }); }, observerOptions); document.querySelectorAll('[data-aos]').forEach(el => { observer.observe(el); }); }, }; $(document).ready(() => { UNFIA.init(); // Removed custom dropdown handler to let Bootstrap 5 native data-bs-toggle handle mobile dropdowns natively without double-toggling. $('.donate-now-btn').on('click', function() { const fund = $(this).data('fund'); $('select[name="fund"]').val(fund.toLowerCase().replace(/\s+/g, '-')); $('html, body').animate({ scrollTop: $('.donate-form-wrapper').offset().top - 100 }, 500); }); }); })(jQuery);
Save Changes
Cancel
Create New File
Create New Folder