File size: 1,376 Bytes
42c1b67 89d7080 a70b2c9 42c1b67 a70b2c9 42c1b67 a70b2c9 b75c6e6 42c1b67 b75c6e6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
document.addEventListener('DOMContentLoaded', function() {
// Request notification permission
if ('Notification' in window) {
Notification.requestPermission().then(permission => {
if (permission === 'granted') {
console.log('Notification permission granted');
}
});
}
// Simulate cleaner arrival notification (demo purposes)
setTimeout(() => {
if (Notification.permission === 'granted') {
new Notification('Cleaner Arrived', {
body: 'Maria Rodriguez has arrived at 123 Clean Street',
icon: '/static/notification-icon.png'
});
}
}, 5000);
// Close modal when clicking outside
const modal = document.getElementById('subscription-modal');
if (modal) {
modal.addEventListener('click', function(e) {
if (e.target === modal) {
closeSubscriptionModal();
}
});
}
});
function openSubscriptionModal() {
const modal = document.getElementById('subscription-modal');
if (modal) modal.classList.remove('hidden');
document.body.style.overflow = 'hidden';
}
function closeSubscriptionModal() {
const modal = document.getElementById('subscription-modal');
if (modal) modal.classList.add('hidden');
document.body.style.overflow = 'auto';
}
|