diff options
author | sameerasw <[email protected]> | 2025-04-10 15:23:31 +0530 |
---|---|---|
committer | sameerasw <[email protected]> | 2025-04-10 15:23:31 +0530 |
commit | 02950d3ba50e3db6ac4c4a3f61cec1117f933cde (patch) | |
tree | 828cdbb003bd94b0f2e850fc7297262281007b43 | |
parent | 3be3f2d5b07b3af1957fabad58be4863bc5b9ac1 (diff) |
What's new button
-rw-r--r-- | popup/popup.css | 48 | ||||
-rw-r--r-- | popup/popup.html | 1 | ||||
-rw-r--r-- | popup/popup.js | 11 |
3 files changed, 60 insertions, 0 deletions
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 @@ </div> <div class="author">by <a href="https://www.sameerasw.com/" target="_blank">@sameerasw</a></div> <div id="addon-version" class="addon-version"></div> + <button id="whats-new" class="whats-new-button" title="What's New">✨</button> </header> <main class="app-content"> 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/", + }); + } })(); |