helloworldapp / script.js
madstuntman11's picture
make simple heelo world
60d2d3a verified
raw
history blame contribute delete
924 Bytes
// Main application script
console.log('HelloWorldApp loaded successfully! πŸš€');
// Simple animation for the main container
document.addEventListener('DOMContentLoaded', () => {
const mainContainer = document.querySelector('main');
if (mainContainer) {
mainContainer.style.opacity = '0';
mainContainer.style.transform = 'translateY(20px)';
setTimeout(() => {
mainContainer.style.transition = 'opacity 0.5s ease, transform 0.5s ease';
mainContainer.style.opacity = '1';
mainContainer.style.transform = 'translateY(0)';
}, 100);
}
});
// Service worker registration for PWA support
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js')
.then(registration => console.log('ServiceWorker registered successfully'))
.catch(error => console.log('ServiceWorker registration failed:', error));
});
}