Skip to content

Commit 5a08d3c

Browse files
committed
feat: app version set to dynamically update on the option page's about section
1 parent ed45c64 commit 5a08d3c

File tree

3 files changed

+62
-11
lines changed

3 files changed

+62
-11
lines changed

options/options.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,42 @@ a:hover {
138138
.section a:hover {
139139
text-decoration: underline;
140140
}
141+
142+
.about-content {
143+
background: #fafbfc;
144+
border-radius: 8px;
145+
padding: 24px 28px;
146+
margin-top: 12px;
147+
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
148+
font-size: 1.05em;
149+
color: #222;
150+
}
151+
152+
.about-content p {
153+
margin-bottom: 12px;
154+
}
155+
156+
.about-content a {
157+
color: #0074d9;
158+
text-decoration: none;
159+
transition: color 0.2s;
160+
}
161+
.about-content a:hover {
162+
color: #005fa3;
163+
text-decoration: underline;
164+
}
165+
166+
.about-version {
167+
margin: 10px 0 18px 0;
168+
font-size: 0.98em;
169+
color: #555;
170+
font-style: italic;
171+
}
172+
173+
.faq {
174+
margin-top: 10px;
175+
background: #f3f6fa;
176+
border-left: 3px solid #0074d9;
177+
padding: 12px 16px;
178+
border-radius: 5px;
179+
}

options/options.html

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,22 @@ <h2>Settings</h2>
4242
</section>
4343
<section id="section-about" class="section">
4444
<h2>FAQ / About</h2>
45-
<p>
46-
Made by <a href="https://linktr.ee/267dngi" target="_blank">@dngi</a>.<br>
47-
Star the project on <a href="https://github.com/kiing-dom/leetcode-tracker" target="_blank">GitHub</a>!<br>
48-
If you find this useful, consider <a href="https://www.ko-fi.com/267dngi" target="_blank"> buying me a kebab 😏</a>.<br><br>
49-
<strong>FAQ:</strong><br>
50-
<b>Q:</b> How do I use this extension?<br>
51-
<b>A:</b> Just solve problems on LeetCode as usual! Your progress is tracked automatically.<br>
52-
</p>
45+
<div class="about-version" style="margin-bottom: 18px;">
46+
<span id="extVersion"></span>
47+
</div>
48+
<hr style="margin-bottom: 18px;">
49+
<div class="about-content">
50+
<p>
51+
Made by <a href="https://linktr.ee/267dngi" target="_blank">@dngi</a>.<br>
52+
Star the project on <a href="https://github.com/kiing-dom/leetcode-tracker" target="_blank">GitHub</a>!<br>
53+
If you find this useful, consider <a href="https://www.ko-fi.com/267dngi" target="_blank"> buying me a kebab 😏</a>.
54+
</p>
55+
<div class="faq">
56+
<strong>FAQ:</strong><br>
57+
<b>Q:</b> How do I use this extension?<br>
58+
<b>A:</b> Just solve problems on LeetCode as usual! Your progress is tracked automatically.<br>
59+
</div>
60+
</div>
5361
</section>
5462
</main>
5563
</div>

options/options.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// options.js
2-
// Handles navigation and basic filtering for the options page
3-
41
document.addEventListener('DOMContentLoaded', () => {
52
// Sidebar navigation
63
const navItems = document.querySelectorAll('.nav-item');
@@ -96,5 +93,12 @@ document.addEventListener('DOMContentLoaded', () => {
9693
searchInput.addEventListener('input', () => {
9794
renderProblems(problems, tagFilter.value, searchInput.value);
9895
});
96+
97+
// set extension version in About section
98+
const extVersionElem = document.getElementById('extVersion');
99+
if (extVersionElem && browser.runtime.getManifest) {
100+
const manifest = browser.runtime.getManifest();
101+
extVersionElem.textContent = manifest.version;
102+
}
99103
});
100104
});

0 commit comments

Comments
 (0)