Skip to content

Commit aded570

Browse files
committed
Import super.so docs theme
1 parent e6483c1 commit aded570

File tree

2 files changed

+1338
-0
lines changed

2 files changed

+1338
-0
lines changed

super.so-theme-docs/script.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
function onPageLoad() {
2+
const header = document.querySelector('.notion-header');
3+
const setActivePage = () => {
4+
const currentPage = document.querySelectorAll('a[href="' + window.location.pathname + '"]');
5+
currentPage.forEach(function(page) {
6+
if (!page.classList.contains('super-navbar__logo') && !page.parentNode.classList.contains('notion-image')) {
7+
page.classList.add('page-active')
8+
}
9+
const pageIcon = page.querySelector('.notion-page__icon')
10+
if (pageIcon) {
11+
pageIcon.setAttribute("style", "opacity:1!important; filter:grayscale(0%)!important;")
12+
}
13+
});
14+
}
15+
setActivePage()
16+
17+
const config = { subtree: true, characterData: true };
18+
19+
const callback = function(mutationsList, observer) {
20+
for (const mutation of mutationsList) {
21+
if (mutation.type === 'characterData') {
22+
setActivePage()
23+
}
24+
}
25+
};
26+
27+
const observer = new MutationObserver(callback);
28+
observer.observe(header, config);
29+
}
30+
31+
document.addEventListener("DOMContentLoaded", onPageLoad);

0 commit comments

Comments
 (0)