From 02950d3ba50e3db6ac4c4a3f61cec1117f933cde Mon Sep 17 00:00:00 2001 From: sameerasw Date: Thu, 10 Apr 2025 15:23:31 +0530 Subject: What's new button --- popup/popup.css | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ popup/popup.html | 1 + popup/popup.js | 11 +++++++++++ 3 files changed, 60 insertions(+) diff --git a/popup/popup.css b/popup/popup.css index 1a47b2a..73f2b74 100644 --- a/popup/popup.css +++ b/popup/popup.css @@ -42,6 +42,7 @@ body { padding: 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); box-shadow: var(--shadow); + position: relative; /* Add this for positioning the whats-new button */ } .logo-container { @@ -79,6 +80,53 @@ body { text-decoration: underline; } +/* What's New Button */ +.whats-new-button { + position: absolute; + top: 16px; + right: 16px; + background: none; + border: none; + color: white; + font-size: 18px; + cursor: pointer; + padding: 5px; + border-radius: 50%; + transition: all 0.2s ease; + width: 32px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; +} + +.whats-new-button:hover { + background-color: rgba(255, 255, 255, 0.2); + transform: scale(1.1); +} + +.whats-new-button::after { + content: "What's New"; + position: absolute; + bottom: -25px; + right: 0; + background-color: rgba(0, 0, 0, 0.7); + color: white; + padding: 3px 8px; + border-radius: 4px; + font-size: 10px; + opacity: 0; + visibility: hidden; + transition: opacity 0.2s ease, visibility 0.2s ease; + pointer-events: none; + white-space: nowrap; +} + +.whats-new-button:hover::after { + opacity: 1; + visibility: visible; +} + /* Main Content Styles */ .app-content { padding: 20px; diff --git a/popup/popup.html b/popup/popup.html index 1c5c84c..78515ea 100644 --- a/popup/popup.html +++ b/popup/popup.html @@ -17,6 +17,7 @@
by @sameerasw
+
diff --git a/popup/popup.js b/popup/popup.js index 82fc942..8feac4d 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -20,6 +20,7 @@ new (class ExtensionPopup { skipForceThemingList = []; reloadButton = document.getElementById("reload"); modeIndicator = document.getElementById("mode-indicator"); + whatsNewButton = document.getElementById("whats-new"); constructor() { if (logging) console.log("Initializing ExtensionPopup"); @@ -54,6 +55,9 @@ new (class ExtensionPopup { this.handleWhitelistModeChange.bind(this) ); + // Add event listener for the "What's New" button + this.whatsNewButton.addEventListener("click", this.openWhatsNew.bind(this)); + // Add event listener for the data viewer button document.getElementById("view-data")?.addEventListener("click", () => { browser.tabs.create({ @@ -546,4 +550,11 @@ new (class ExtensionPopup { this.siteToggleLabel.textContent = "Skip Forcing for this Site"; } } + + // Open the What's New page + openWhatsNew() { + browser.tabs.create({ + url: "https://addons.mozilla.org/en-US/firefox/addon/zen-internet/versions/", + }); + } })(); -- cgit v1.2.3