diff --git a/badges.svg b/badges.svg index a1bbd78..6c750c5 100644 --- a/badges.svg +++ b/badges.svg @@ -1,14 +1,14 @@ coverage: 100% - + - - + + - + - - - - - - + + + + + + - - - + + + top
@@ -573,13 +573,13 @@

- + diff --git a/js/giscus.js b/js/giscus.js new file mode 100644 index 0000000..729dd0b --- /dev/null +++ b/js/giscus.js @@ -0,0 +1,34 @@ +;(() => { + const targetElement = document.documentElement; + const defaultTheme = targetElement.getAttribute("data-color-mode"); + changeGiscusTheme(defaultTheme) + const observer = new MutationObserver((mutationsList, observer) => { + for(const mutation of mutationsList) { + if (mutation.type === 'attributes') { + const value = targetElement.getAttribute("data-color-mode"); + changeGiscusTheme(value) + } + } + }); + + observer.observe(targetElement, { + attributes: true, + attributeOldValue: true + }); + + function changeGiscusTheme(theme = "light") { + const iframe = document.querySelector('.giscus-frame'); + if (iframe) { + const config = { + giscus: { + setConfig: { + theme: theme.toLocaleLowerCase(), + }, + } + }; + iframe.contentWindow.postMessage(config, 'https://giscus.app'); + const script = document.querySelector("script[data-script-id=\"giscus\"]") + script.setAttribute("data-theme", theme) + } + } +})(); diff --git a/lcov-report/index.html b/lcov-report/index.html index 14391a7..06fbda7 100644 --- a/lcov-report/index.html +++ b/lcov-report/index.html @@ -116,7 +116,7 @@

All files