summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--popup/popup.css56
-rw-r--r--popup/popup.html5
-rw-r--r--popup/popup.js11
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 @@
<div class="author">by <a href="https://www.sameerasw.com/" target="_blank">@sameerasw</a></div>
</div>
</div>
- <button id="whats-new" class="whats-new-button" title="What's New">✨</button>
+ <div class="header-buttons">
+ <button id="how-to-use" class="icon-button" title="How to use?">🤔</button>
+ <button id="whats-new" class="whats-new-button" title="What's New">✨</button>
+ </div>
</header>
<main class="app-content">
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");