From 2599fcc5bcd22579353b872e6c6b8aae3e37f694 Mon Sep 17 00:00:00 2001 From: Aryansjc <125482323+Aryansjc@users.noreply.github.com> Date: Mon, 17 Mar 2025 02:13:42 +0530 Subject: [PATCH 01/23] Create manifest.json --- manifest.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 manifest.json diff --git a/manifest.json b/manifest.json new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/manifest.json @@ -0,0 +1 @@ + From b8ccfe6b8294947da2ce7d1991cdbd6e4843594e Mon Sep 17 00:00:00 2001 From: Aryansjc <125482323+Aryansjc@users.noreply.github.com> Date: Mon, 17 Mar 2025 02:17:05 +0530 Subject: [PATCH 02/23] Files Uploaded --- background.js | 0 popup.css | 0 popup.html | 0 popup.js | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 background.js create mode 100644 popup.css create mode 100644 popup.html create mode 100644 popup.js diff --git a/background.js b/background.js new file mode 100644 index 00000000..e69de29b diff --git a/popup.css b/popup.css new file mode 100644 index 00000000..e69de29b diff --git a/popup.html b/popup.html new file mode 100644 index 00000000..e69de29b diff --git a/popup.js b/popup.js new file mode 100644 index 00000000..e69de29b From d7876405ce2a9b251060b126000c7fe0dffd92ab Mon Sep 17 00:00:00 2001 From: Aryansjc <125482323+Aryansjc@users.noreply.github.com> Date: Mon, 17 Mar 2025 08:48:49 +0530 Subject: [PATCH 03/23] Update popup.css --- popup.css | 1 + 1 file changed, 1 insertion(+) diff --git a/popup.css b/popup.css index e69de29b..60d565d4 100644 --- a/popup.css +++ b/popup.css @@ -0,0 +1 @@ +lol From 84661f1c9ff85bde02b652ae921f275f9d1ce2ea Mon Sep 17 00:00:00 2001 From: Aryansjc <125482323+Aryansjc@users.noreply.github.com> Date: Mon, 17 Mar 2025 08:49:13 +0530 Subject: [PATCH 04/23] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 8b137891..039727ec 100644 --- a/manifest.json +++ b/manifest.json @@ -1 +1 @@ - +lol From 43927dbfbf1beb2413dedb22c76bb99de459cf4c Mon Sep 17 00:00:00 2001 From: Aryansjc <125482323+Aryansjc@users.noreply.github.com> Date: Mon, 17 Mar 2025 08:49:34 +0530 Subject: [PATCH 05/23] Update popup.html --- popup.html | 1 + 1 file changed, 1 insertion(+) diff --git a/popup.html b/popup.html index e69de29b..60d565d4 100644 --- a/popup.html +++ b/popup.html @@ -0,0 +1 @@ +lol From d38385842abb6948460828899d5e50677b5a178b Mon Sep 17 00:00:00 2001 From: Aryansjc <125482323+Aryansjc@users.noreply.github.com> Date: Mon, 17 Mar 2025 08:55:24 +0530 Subject: [PATCH 06/23] Update popup.html --- popup.html | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/popup.html b/popup.html index 60d565d4..c59521c8 100644 --- a/popup.html +++ b/popup.html @@ -1 +1,35 @@ -lol + + +
+No data recorded today.
'; + totalTimeEl.textContent = '0m'; + return; + } + + let totalTime = 0; + let maxTime = 0; + + Object.values(data).forEach(time => { + totalTime += time; + if (time > maxTime) maxTime = time; + }); + + totalTimeEl.textContent = formatTime(totalTime); + + const sortedSites = Object.entries(data) + .sort((a, b) => b[1] - a[1]); + + sortedSites.forEach(([site, time], index) => { + const percentage = (time / maxTime) * 100; + + const siteEl = document.createElement('div'); + siteEl.className = 'site-stat'; + siteEl.style.opacity = '0'; + siteEl.style.transform = 'translateY(10px)'; + siteEl.innerHTML = ` +No historical data available.
'; + return; + } + + const dates = []; + const dailyTotals = []; + + const allSites = new Set(); + Object.values(historyData).forEach(dayData => { + Object.keys(dayData).forEach(site => allSites.add(site)); + }); + + const orderedDates = Object.keys(historyData).sort((a, b) => { + return new Date(b) - new Date(a); + }); + + const siteTotals = {}; + allSites.forEach(site => { + siteTotals[site] = 0; + orderedDates.forEach(date => { + if (historyData[date] && historyData[date][site]) { + siteTotals[site] += historyData[date][site]; + } + }); + }); + + const top5Sites = Object.entries(siteTotals) + .sort((a, b) => b[1] - a[1]) + .slice(0, 5); + + historyStatsEl.innerHTML = '