Remove modal JS, add z-index to private service cards to ensure clicks work

This commit is contained in:
Roberth Rajala 2026-02-02 13:35:16 +01:00
parent 442b8a2a79
commit 1df28ba1b7
2 changed files with 8 additions and 52 deletions

View File

@ -537,55 +537,4 @@ document.addEventListener('DOMContentLoaded', initServiceStatusChecker);
/** /**
* Service Info Modals * Service Info Modals
*/ */
function initServiceModals() { // Modal functionality removed - links work normally
// 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);

View File

@ -1766,6 +1766,13 @@ body {
.service-card.private-service { .service-card.private-service {
border-color: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.2);
cursor: pointer; cursor: pointer;
display: block;
z-index: 1;
}
.service-card.private-service a {
position: relative;
z-index: 10;
} }
.service-card.private-service:hover { .service-card.private-service:hover {