Skip to content

Commit 4bacc18

Browse files
committed
fix: Added dark mode toggle button to publications page
1 parent d786c32 commit 4bacc18

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

publications.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,25 @@ This section presents all the scientific publications that have resulted from th
7070
keywords = {Security, Vulnerability, PyPI, Package, RubyGems, Cargo, NPM}
7171
}
7272
```
73+
74+
<button class="btn js-toggle-dark-mode" style="
75+
position: fixed;
76+
top: 1rem;
77+
right: 1rem;
78+
z-index: 1000;
79+
">
80+
🌕
81+
</button>
82+
83+
<script>
84+
const toggleDarkMode = document.querySelector('.js-toggle-dark-mode');
85+
jtd.addEvent(toggleDarkMode, 'click', function () {
86+
if (jtd.getTheme() === 'dark') {
87+
jtd.setTheme('light');
88+
toggleDarkMode.textContent = '🌕';
89+
} else {
90+
jtd.setTheme('dark');
91+
toggleDarkMode.textContent = '☀️';
92+
}
93+
});
94+
</script>

0 commit comments

Comments
 (0)