This commit is contained in:
2026-02-12 14:08:42 +01:00
parent 17002ad833
commit a8caee15f9
3 changed files with 102 additions and 1 deletions

View File

@@ -1,13 +1,57 @@
/**
* Main Script - Profice Website
* All API calls go through server-side PHP
* Includes fallback for local file access (no server)
*
* @version 2.1.0
*/
document.addEventListener("DOMContentLoaded", function() {
// ==========================================
// SOUND VISUALIZATION ANIMATION
// ==========================================
function initSoundVisualization() {
const soundVisualization = document.getElementById('soundVisualization');
const demoPhoneBtn = document.getElementById('demoPhoneBtn');
if (soundVisualization && demoPhoneBtn) {
// Start animation on hover
demoPhoneBtn.addEventListener('mouseenter', () => {
soundVisualization.classList.add('active');
});
demoPhoneBtn.addEventListener('mouseleave', () => {
soundVisualization.classList.remove('active');
});
// Toggle animation on click/touch
demoPhoneBtn.addEventListener('click', (e) => {
e.preventDefault();
soundVisualization.classList.toggle('active');
// Simulate call action after a brief delay
setTimeout(() => {
window.location.href = demoPhoneBtn.href;
}, 500);
});
// Touch support for mobile
demoPhoneBtn.addEventListener('touchstart', (e) => {
e.preventDefault();
soundVisualization.classList.add('active');
});
demoPhoneBtn.addEventListener('touchend', () => {
setTimeout(() => {
soundVisualization.classList.remove('active');
}, 1000);
});
}
}
initSoundVisualization();
// Use absolute path from site root
const API_ENDPOINT = '/scripts/add/send.php';
const isLocalFile = window.location.protocol === 'file:';