From a79a296682708ee8ba4c17423a24a276325aee1c Mon Sep 17 00:00:00 2001 From: suman panda Date: Thu, 5 Mar 2026 00:02:12 +0530 Subject: [PATCH] Fix Missing Service Worker Registration --- index.html | 1157 ++++++--------------------------- js/service-worker-register.js | 140 ++++ 2 files changed, 334 insertions(+), 963 deletions(-) create mode 100644 js/service-worker-register.js diff --git a/index.html b/index.html index 783b168..a2aaad9 100644 --- a/index.html +++ b/index.html @@ -24,25 +24,20 @@ - - + - - - - + @@ -79,9 +74,7 @@

- - @@ -95,7 +88,6 @@

E EcoPulse - - EcoPulse - - - - - - -
-

Visualize Our
@@ -208,12 +170,11 @@

View Demo

- - - - -
- + + + + +
@@ -245,989 +205,258 @@

- - - - -
-
- 91%
+
91%

People breathe polluted air

-
- 2B
+
2B

lack access to safe drinking water

-
80%
-

world’s population can’t see the Milky Way due to light pollution

- +
80%
+

world's population can't see the Milky Way due to light pollution

-
45%
+
45%

Exposed to harmful noise

-
-
-

Explore Pollution Topics

- Explore air, water, light, and noise pollution using location-based data, 3D simulations, and interactive insights. - - + Explore air, water, light, and noise pollution using location-based data, 3D simulations, and interactive insights.

+
- + + +
+
- -
- - -
-
- -
-

Why EcoPulse?

-

- Turn complex environmental data into clear, actionable insight β€” with immersive visuals, trusted sources, - and tools built for decision-makers and curious learners alike. -

-
- - -
- -
- +
- -
- -

Trusted, Transparent Data

-

- Curated datasets from WHO, EPA and peer-reviewed research β€” with regional breakdowns, confidence - indicators, and CSV export for further analysis. -

-
+ + + - -
- -
- - - - - - - - -
-
-
-

What People Are Saying

-

Real experiences from our community members

- -
- -
-
- -
-
- "EcoPulse has transformed how I understand environmental issues. The 3D visualizations are incredible!" -
-
-
-
Arjun Sharma
-
Environmental Scientist
-
-
-
- -
-
- "The interactive features make learning about pollution so engaging. A must-see for students!" -
-
-
-
Priya Patel
-
Teacher
-
-
-
- -
-
- "I never realized the extent of pollution in my city until I used EcoPulse. Eye-opening experience!" -
-
-
-
Rahul Verma
-
Urban Planner
-
-
-
- -
-
- "The AI prediction models are fascinating. They help me understand future environmental challenges." - -
-
-
-
Ananya Gupta
-
Data Analyst
-
-
-
- -
-
- "As a policy maker, EcoPulse provides valuable insights for developing environmental regulations." -
-
-
-
Vikram Singh
-
Policy Advisor
-
-
-
- -
-
- "The water pollution visualization helped our NGO target cleanup efforts more effectively." -
-
-
-
Sunita Reddy
-
NGO Coordinator
-
-
-
- -
-
- "Incredible platform that makes complex environmental data accessible to everyone." - -
-
-
-
Kiran Joshi
-
Researcher
-
-
-
- -
-
- "The light pollution module helped me find the best spots for stargazing with my astronomy club." -
-
-
-
Amitabh Nair
-
Astronomy Enthusiast
-
-
-
- -
-
- "EcoPulse has become an essential tool for our environmental awareness campaigns." -
-
-
-
Meera Krishnan
-
Community Leader
-
-
-
- -
-
- "The noise pollution visualization helped me understand the acoustic challenges in our city." -
-
-
-
Rajesh Malhotra
-
Acoustic Engineer
-
-
-
- -
-
- "A powerful tool for environmental education that combines technology with real-world impact." -
-
-
-
Neha Chatterjee
-
Educator
-
-
-
- -
-
- "EcoPulse opened my eyes to the interconnectedness of different types of pollution." -
-
-
-
Sandeep Agarwal
-
Environmental Advocate
-
-
-
- - -
-
- "EcoPulse has transformed how I understand environmental issues. The 3D visualizations are incredible!" -
-
-
-
Arjun Sharma
-
Environmental Scientist
-
-
-
- -
-
- "The interactive features make learning about pollution so engaging. A must-see for students!" -
-
-
-
Priya Patel
-
Teacher
-
-
-
- -
-
- "I never realized the extent of pollution in my city until I used EcoPulse. Eye-opening experience!" -
-
-
-
Rahul Verma
-
Urban Planner
-
-
-
- -
-
- "The AI prediction models are fascinating. They help me understand future environmental challenges." -
-
-
-
Ananya Gupta
-
Data Analyst
-
-
-
- -
-
- "As a policy maker, EcoPulse provides valuable insights for developing environmental regulations." -
-
-
-
Vikram Singh
-
Policy Advisor
-
-
-
- -
-
- "The water pollution visualization helped our NGO target cleanup efforts more effectively." -
-
-
-
Sunita Reddy
-
NGO Coordinator
-
-
-
- -
-
- "Incredible platform that makes complex environmental data accessible to everyone." -
-
-
-
Kiran Joshi
-
Researcher
-
-
-
- -
-
- "The light pollution module helped me find the best spots for stargazing with my astronomy club." -
-
-
-
Amitabh Nair
-
Astronomy Enthusiast
-
-
-
- -
-
- "EcoPulse has become an essential tool for our environmental awareness campaigns." -
-
-
-
Meera Krishnan
-
Community Leader
-
-
-
- -
-
- "The noise pollution visualization helped me understand the acoustic challenges in our city." -
-
-
-
Rajesh Malhotra
-
Acoustic Engineer
-
-
-
- -
-
- "A powerful tool for environmental education that combines technology with real-world impact." -
-
-
-
Neha Chatterjee
-
Educator
-
-
-
- -
-
- "EcoPulse opened my eyes to the interconnectedness of different types of pollution." -
-
-
-
Sandeep Agarwal
-
Environmental Advocate
-
-
-
-
+ + -
-
- -
-
-
-

Real-time Environmental Data

-

- Live pollution monitoring with interactive visualizations and predictive analytics -

-
- - -
- - - - -
- - -
- -
-
-

Air Quality Index

-
- Live -
-
-
-
- 42 - AQI -
-
-
-
-
-
-
- Good β€’ PM2.5: 12 ΞΌg/mΒ³ β€’ PM10: 18 ΞΌg/mΒ³ -
-
- - -
-
-

Water Quality

-
- Live -
-
-
-
- 78 - WQI -
-
-
-
-
-
-
- Moderate β€’ pH: 7.2 β€’ DO: 6.8 mg/L -
-
- - -
-
-

Noise Level

-
- Live -
-
-
-
- 65 - dB -
-
-
-
-
-
-
- Moderate β€’ Peak: 78 dB β€’ Avg: 62 dB -
-
-
- - -
-
-

Pollution Trends

-
- - - - -
-
-
- -
-
- - -
-

Global Pollution Map

-
-
-
-
-
-
- - - -
-

Interactive pollution map visualization

-

Real-time data from monitoring stations worldwide

-
-
- -
-
-
-
-
-
-
-

Pollution Hotspots

-
-
-
-
-
Delhi, India
-

Severe Air Pollution

-
- AQI: 420 -
-
Industrial emissions and vehicle exhaust
-
-
-
-
-
Los Angeles, USA
-

High Ozone Levels

-
- AQI: 185 -
-
Photochemical smog from traffic
-
-
-
-
-
Shanghai, China
-

Water Contamination

-
- WQI: 45 -
-
Industrial discharge and runoff
-
-
-
-
+ +
+

+ Technology +

+
    +
  • + Three.js for 3D Graphics +
  • +
  • + Chart.js for Data Viz +
  • +
  • + TensorFlow.js for AI +
  • +
  • + Tailwind CSS Styling +
  • +
  • + Vanilla JavaScript +
  • +
-
- -
-
-

Ready to Make a Difference?

-

- Explore the data, understand the impact, and discover actionable solutions -

- + +
+

© EcoPulse. Built with ❀️ for environmental awareness.

+

Hackathon β€’ Environmental Data Initiative

-
- - -
-
- - -
- - -
-

- About EcoPulse -

-

- Environmental awareness through interactive 3D data visualization. - Built for Hackathon 2024. - -

-
- -
- - -
-

About EcoPulse

-

- Environmental awareness through interactive 3D data visualization. Built for Hackathon 2024. -

-
- - - - - -
-

- Technology -

-
    -
  • - Three.js for 3D Graphics -
  • -
  • - Chart.js for Data Viz -
  • -
  • - TensorFlow.js for AI -
  • -
  • - Tailwind CSS Styling -
  • -
  • - Vanilla JavaScript -
  • -
-
- -
- - -
-

© EcoPulse. Built with ❀️ for environmental awareness.

-

Hackathon β€’ Environmental Data Initiative

-
- -
-
- +
+
+ `; + + document.body.appendChild(notification); + + // Add animation styles + const style = document.createElement('style'); + style.textContent = ` + @keyframes slideIn { + from { + transform: translateX(100%); + opacity: 0; + } + to { + transform: translateX(0); + opacity: 1; + } + } + `; + document.head.appendChild(style); + + // Auto-hide after 10 seconds + setTimeout(() => { + if (notification.parentNode) { + notification.style.animation = 'slideIn 0.3s reverse'; + setTimeout(() => { + if (notification.parentNode) { + notification.parentNode.removeChild(notification); + } + }, 300); + } + }, 10000); + } + } + + // Global function to update service worker + window.updateServiceWorker = function() { + if (navigator.serviceWorker && navigator.serviceWorker.controller) { + navigator.serviceWorker.controller.postMessage({ type: 'SKIP_WAITING' }); + + // Remove notification + const notification = document.getElementById('sw-update-notification'); + if (notification && notification.parentNode) { + notification.parentNode.removeChild(notification); + } + + // Reload to get new content + window.location.reload(); + } + }; +})(); \ No newline at end of file