[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: saprosoft-script.js
document.addEventListener('DOMContentLoaded', function() { // Preloader const preloader = document.querySelector('.preloader'); if (preloader) { window.addEventListener('load', function() { setTimeout(function() { preloader.classList.add('hidden'); }, 500); }); } // Mobile Menu Toggle const menuToggle = document.querySelector('.menu-toggle'); const mobileMenu = document.querySelector('.mobile-menu'); const navLinks = document.querySelectorAll('.mobile-nav-link'); if (menuToggle && mobileMenu) { menuToggle.addEventListener('click', function() { menuToggle.classList.toggle('active'); mobileMenu.classList.toggle('active'); document.body.classList.toggle('menu-open'); }); // Close mobile menu when a nav link is clicked navLinks.forEach(function(link) { link.addEventListener('click', function() { menuToggle.classList.remove('active'); mobileMenu.classList.remove('active'); document.body.classList.remove('menu-open'); }); }); } // Sticky Header const header = document.querySelector('.header'); if (header) { window.addEventListener('scroll', function() { if (window.scrollY > 50) { header.classList.add('scrolled'); } else { header.classList.remove('scrolled'); } }); } // Testimonials Slider const testimonialCards = document.querySelectorAll('.testimonial-card'); const testimonialsDots = document.querySelector('.testimonials-dots'); if (testimonialCards.length > 0 && testimonialsDots) { // Create dots based on number of testimonials testimonialCards.forEach(function(_, index) { const dot = document.createElement('span'); dot.classList.add('testimonials-dot'); if (index === 0) dot.classList.add('active'); dot.setAttribute('data-index', index); testimonialsDots.appendChild(dot); }); // Add click event to dots const dots = document.querySelectorAll('.testimonials-dot'); dots.forEach(function(dot) { dot.addEventListener('click', function() { const index = parseInt(this.getAttribute('data-index')); // Remove active class from all dots and cards dots.forEach(d => d.classList.remove('active')); testimonialCards.forEach(card => card.style.display = 'none'); // Add active class to current dot and show current card this.classList.add('active'); testimonialCards[index].style.display = 'block'; }); }); // Show only the first testimonial initially testimonialCards.forEach(function(card, index) { if (index !== 0) { card.style.display = 'none'; } }); } // Smooth Scrolling for Anchor Links const anchorLinks = document.querySelectorAll('a[href^="#"]:not([href="#"])'); anchorLinks.forEach(function(link) { link.addEventListener('click', function(e) { e.preventDefault(); const targetId = this.getAttribute('href'); const targetElement = document.querySelector(targetId); if (targetElement) { const headerHeight = document.querySelector('.header').offsetHeight; const targetPosition = targetElement.getBoundingClientRect().top + window.pageYOffset - headerHeight; window.scrollTo({ top: targetPosition, behavior: 'smooth' }); } }); }); // Active Navigation Link on Scroll const sections = document.querySelectorAll('section[id]'); const navItems = document.querySelectorAll('.nav-link'); function setActiveNavLink() { const scrollPosition = window.scrollY; sections.forEach(function(section) { const sectionTop = section.offsetTop - 100; const sectionHeight = section.offsetHeight; const sectionId = section.getAttribute('id'); if (scrollPosition >= sectionTop && scrollPosition < sectionTop + sectionHeight) { navItems.forEach(function(item) { item.classList.remove('active'); if (item.getAttribute('href') === '#' + sectionId) { item.classList.add('active'); } }); } }); } window.addEventListener('scroll', throttle(setActiveNavLink, 100)); // Contact Form Submission const contactForm = document.getElementById('contactForm'); const formMessage = document.querySelector('.form-message'); if (contactForm) { contactForm.addEventListener('submit', function(e) { e.preventDefault(); const formData = new FormData(this); fetch('process_contact.php', { method: 'POST', body: formData }) .then(response => response.json()) .then(data => { if (data.success) { formMessage.innerHTML = `<div class="alert alert-success">${data.message}</div>`; contactForm.reset(); } else { formMessage.innerHTML = `<div class="alert alert-danger">${data.message}</div>`; } }) .catch(error => { formMessage.innerHTML = `<div class="alert alert-danger">An error occurred. Please try again later.</div>`; console.error('Error:', error); }); }); } // Newsletter Form Submission const newsletterForm = document.querySelector('.footer-newsletter-form'); if (newsletterForm) { newsletterForm.addEventListener('submit', function(e) { e.preventDefault(); const email = this.querySelector('input[type="email"]').value; fetch('process_newsletter.php', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ email: email }) }) .then(response => response.json()) .then(data => { if (data.success) { alert('Thank you for subscribing to our newsletter!'); this.reset(); } else { alert(data.message); } }) .catch(error => { alert('An error occurred. Please try again later.'); console.error('Error:', error); }); }); } // Utility function for throttling function throttle(func, delay) { let lastCall = 0; return function() { const now = new Date().getTime(); if (now - lastCall < delay) { return; } lastCall = now; return func.apply(this, arguments); }; } });
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.7 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002