Remove modal JS, add z-index to private service cards to ensure clicks work
This commit is contained in:
parent
442b8a2a79
commit
1df28ba1b7
53
script.js
53
script.js
|
|
@ -537,55 +537,4 @@ document.addEventListener('DOMContentLoaded', initServiceStatusChecker);
|
|||
/**
|
||||
* Service Info Modals
|
||||
*/
|
||||
function initServiceModals() {
|
||||
// Only handle services that have data-service attribute (not links to dummy pages)
|
||||
const privateServices = document.querySelectorAll('.private-service[data-service]');
|
||||
const modals = document.querySelectorAll('.service-modal');
|
||||
const closeButtons = document.querySelectorAll('.modal-close');
|
||||
|
||||
// Open modal when clicking private service that has a modal
|
||||
privateServices.forEach(service => {
|
||||
service.addEventListener('click', (e) => {
|
||||
const serviceName = service.getAttribute('data-service');
|
||||
const modal = document.getElementById(`modal-${serviceName}`);
|
||||
if (modal) {
|
||||
e.preventDefault();
|
||||
modal.classList.add('active');
|
||||
document.body.style.overflow = 'hidden';
|
||||
}
|
||||
// If no modal exists, let the link work normally
|
||||
});
|
||||
});
|
||||
|
||||
// Close modal when clicking close button
|
||||
closeButtons.forEach(button => {
|
||||
button.addEventListener('click', () => {
|
||||
const modal = button.closest('.service-modal');
|
||||
modal.classList.remove('active');
|
||||
document.body.style.overflow = '';
|
||||
});
|
||||
});
|
||||
|
||||
// Close modal when clicking outside
|
||||
modals.forEach(modal => {
|
||||
modal.addEventListener('click', (e) => {
|
||||
if (e.target === modal) {
|
||||
modal.classList.remove('active');
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Close on Escape key
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape') {
|
||||
modals.forEach(modal => {
|
||||
modal.classList.remove('active');
|
||||
});
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize modals
|
||||
document.addEventListener('DOMContentLoaded', initServiceModals);
|
||||
// Modal functionality removed - links work normally
|
||||
|
|
|
|||
|
|
@ -1766,6 +1766,13 @@ body {
|
|||
.service-card.private-service {
|
||||
border-color: rgba(239, 68, 68, 0.2);
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.service-card.private-service a {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.service-card.private-service:hover {
|
||||
|
|
|
|||
Loading…
Reference in New Issue