diff --git a/extension/popup/index.css b/extension/popup/index.css index 92d1061..9a08fb3 100644 --- a/extension/popup/index.css +++ b/extension/popup/index.css @@ -1,5 +1,5 @@ .main { - padding: 2rem; + padding: 2.2rem; } .toast { @@ -103,7 +103,7 @@ input:checked + .slider:before { .stats-link { color:#121212; - font-size: 15px; + font-size: 14px; border-radius: 5px; padding: 0; text-decoration: none; diff --git a/extension/popup/index.html b/extension/popup/index.html index 537b242..bfe4686 100644 --- a/extension/popup/index.html +++ b/extension/popup/index.html @@ -12,7 +12,7 @@ body { scroll-behavior: smooth; overflow-x: hidden; - width: 280px; + width: 300px; padding: 0; margin: 0; } @@ -61,7 +61,7 @@
- 0 searchings this week > + 0 searchings in the last week >
diff --git a/extension/popup/index.js b/extension/popup/index.js index 86cd265..281a3de 100644 --- a/extension/popup/index.js +++ b/extension/popup/index.js @@ -77,10 +77,16 @@ document.addEventListener('DOMContentLoaded', function() { crateRegistry.onchange = function() { settings.crateRegistry = crateRegistry.value; }; - + let history = JSON.parse(localStorage.getItem("history")); let statsPage = document.querySelector(".statistics-page"); let statsWeekCount = statsPage.querySelector("#stats-week-count"); + let now = new Date(); + let weekAgo = now.setDate(now.getDate() - 7); + history = history.filter(({time}) => { + return weekAgo <= time; + }); + if(history) { statsWeekCount.textContent = `${history.length}` } else {