Skip to content

Commit 02950d3

Browse files
committed
What's new button
1 parent 3be3f2d commit 02950d3

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

popup/popup.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ body {
4242
padding: 16px 20px;
4343
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
4444
box-shadow: var(--shadow);
45+
position: relative; /* Add this for positioning the whats-new button */
4546
}
4647

4748
.logo-container {
@@ -79,6 +80,53 @@ body {
7980
text-decoration: underline;
8081
}
8182

83+
/* What's New Button */
84+
.whats-new-button {
85+
position: absolute;
86+
top: 16px;
87+
right: 16px;
88+
background: none;
89+
border: none;
90+
color: white;
91+
font-size: 18px;
92+
cursor: pointer;
93+
padding: 5px;
94+
border-radius: 50%;
95+
transition: all 0.2s ease;
96+
width: 32px;
97+
height: 32px;
98+
display: flex;
99+
align-items: center;
100+
justify-content: center;
101+
}
102+
103+
.whats-new-button:hover {
104+
background-color: rgba(255, 255, 255, 0.2);
105+
transform: scale(1.1);
106+
}
107+
108+
.whats-new-button::after {
109+
content: "What's New";
110+
position: absolute;
111+
bottom: -25px;
112+
right: 0;
113+
background-color: rgba(0, 0, 0, 0.7);
114+
color: white;
115+
padding: 3px 8px;
116+
border-radius: 4px;
117+
font-size: 10px;
118+
opacity: 0;
119+
visibility: hidden;
120+
transition: opacity 0.2s ease, visibility 0.2s ease;
121+
pointer-events: none;
122+
white-space: nowrap;
123+
}
124+
125+
.whats-new-button:hover::after {
126+
opacity: 1;
127+
visibility: visible;
128+
}
129+
82130
/* Main Content Styles */
83131
.app-content {
84132
padding: 20px;

popup/popup.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ <h1 class="app-title">ZenInternet</h1>
1717
</div>
1818
<div class="author">by <a href="https://www.sameerasw.com/" target="_blank">@sameerasw</a></div>
1919
<div id="addon-version" class="addon-version"></div>
20+
<button id="whats-new" class="whats-new-button" title="What's New"></button>
2021
</header>
2122

2223
<main class="app-content">

popup/popup.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ new (class ExtensionPopup {
2020
skipForceThemingList = [];
2121
reloadButton = document.getElementById("reload");
2222
modeIndicator = document.getElementById("mode-indicator");
23+
whatsNewButton = document.getElementById("whats-new");
2324

2425
constructor() {
2526
if (logging) console.log("Initializing ExtensionPopup");
@@ -54,6 +55,9 @@ new (class ExtensionPopup {
5455
this.handleWhitelistModeChange.bind(this)
5556
);
5657

58+
// Add event listener for the "What's New" button
59+
this.whatsNewButton.addEventListener("click", this.openWhatsNew.bind(this));
60+
5761
// Add event listener for the data viewer button
5862
document.getElementById("view-data")?.addEventListener("click", () => {
5963
browser.tabs.create({
@@ -546,4 +550,11 @@ new (class ExtensionPopup {
546550
this.siteToggleLabel.textContent = "Skip Forcing for this Site";
547551
}
548552
}
553+
554+
// Open the What's New page
555+
openWhatsNew() {
556+
browser.tabs.create({
557+
url: "https://addons.mozilla.org/en-US/firefox/addon/zen-internet/versions/",
558+
});
559+
}
549560
})();

0 commit comments

Comments
 (0)