asd
This commit is contained in:
@@ -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:';
|
||||
|
||||
Reference in New Issue
Block a user