From f69c297fa38911f1df8b7e88fc2106266f6755a4 Mon Sep 17 00:00:00 2001 From: sameerasw Date: Tue, 29 Apr 2025 23:21:16 +0530 Subject: How to use button --- popup/popup.css | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- popup/popup.html | 5 ++++- popup/popup.js | 11 +++++++++++ 3 files changed, 67 insertions(+), 5 deletions(-) diff --git a/popup/popup.css b/popup/popup.css index bab1b67..bb47dba 100644 --- a/popup/popup.css +++ b/popup/popup.css @@ -85,11 +85,59 @@ body { text-decoration: underline; } -/* What's New Button */ +/* Header buttons container */ +.header-buttons { + display: flex; + align-items: center; + gap: 8px; +} + +/* Icon button styles */ +.icon-button { + 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; +} + +.icon-button:hover { + background-color: rgba(255, 255, 255, 0.2); + transform: scale(1.1); +} + +.icon-button::after { + content: attr(title); + 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; +} + +.icon-button:hover::after { + opacity: 1; + visibility: visible; +} + +/* What's New Button - make it use icon-button styles */ .whats-new-button { - /* position: absolute; - top: 16px; - right: 16px; */ background: none; border: none; color: white; diff --git a/popup/popup.html b/popup/popup.html index ae497bc..2b8c48d 100644 --- a/popup/popup.html +++ b/popup/popup.html @@ -22,7 +22,10 @@
by @sameerasw
- +
+ + +
diff --git a/popup/popup.js b/popup/popup.js index e9882c2..5f8071d 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -59,6 +59,7 @@ new (class ExtensionPopup { reloadButton = document.getElementById("reload"); modeIndicator = document.getElementById("mode-indicator"); whatsNewButton = document.getElementById("whats-new"); + howToUseButton = document.getElementById("how-to-use"); constructor() { if (logging) console.log("Initializing ExtensionPopup"); @@ -113,6 +114,9 @@ new (class ExtensionPopup { // Add event listener for the "What's New" button this.whatsNewButton.addEventListener("click", this.openWhatsNew.bind(this)); + // Add event listener for the "How to use?" button + this.howToUseButton.addEventListener("click", this.openHowToUse.bind(this)); + // Add event listener for the data viewer button document.getElementById("view-data")?.addEventListener("click", () => { browser.tabs.create({ @@ -1009,6 +1013,13 @@ new (class ExtensionPopup { }); } + // Open the How to Use guide + openHowToUse() { + browser.tabs.create({ + url: "https://www.sameerasw.com/zen", + }); + } + // Toggle features section visibility toggleFeatures() { const featuresList = document.getElementById("current-site-toggles"); -- cgit v1.2.3