chore: update intro, email, and switch to Hyvor comments
This commit is contained in:
parent
b70dba44c2
commit
f168cfec0e
5 changed files with 23 additions and 18 deletions
|
|
@ -77,7 +77,7 @@ const { title, description, image = "/astro-micro.jpg" } = Astro.props;
|
|||
animate();
|
||||
updateThemeButtons();
|
||||
addCopyCodeButtons();
|
||||
setGiscusTheme();
|
||||
setHyvorTheme();
|
||||
|
||||
const backToTop = document.getElementById("back-to-top");
|
||||
backToTop?.addEventListener("click", (event) => scrollToTop(event));
|
||||
|
|
@ -199,7 +199,7 @@ const { title, description, image = "/astro-micro.jpg" } = Astro.props;
|
|||
window.getComputedStyle(css).opacity;
|
||||
document.head.removeChild(css);
|
||||
|
||||
setGiscusTheme();
|
||||
setHyvorTheme();
|
||||
}
|
||||
|
||||
function preloadTheme() {
|
||||
|
|
@ -249,15 +249,10 @@ const { title, description, image = "/astro-micro.jpg" } = Astro.props;
|
|||
}
|
||||
}
|
||||
|
||||
const setGiscusTheme = () => {
|
||||
const giscus = document.querySelector(".giscus-frame");
|
||||
|
||||
const setHyvorTheme = () => {
|
||||
const isDark = document.documentElement.classList.contains("dark");
|
||||
|
||||
if (giscus) {
|
||||
const url = new URL(giscus.src);
|
||||
url.searchParams.set("theme", isDark ? "dark" : "light");
|
||||
giscus.src = url.toString();
|
||||
if (window.hyvorTalk) {
|
||||
window.hyvorTalk.changeTheme(isDark ? "dark" : "light");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue