chore: remove junk

This commit is contained in:
enscribe 2024-09-10 11:10:15 -07:00
parent 8f6872f739
commit 5d9940eddf
No known key found for this signature in database
GPG key ID: 9BBD5C4114E25322
16 changed files with 15 additions and 118 deletions

View file

@ -57,7 +57,6 @@ const { title, description, image = '/blog-placeholder-1.jpg' } = Astro.props
animate()
updateThemeButtons()
addCopyCodeButtons()
setGiscusTheme()
const backToTop = document.getElementById('back-to-top')
backToTop?.addEventListener('click', (event) => scrollToTop(event))
@ -178,8 +177,6 @@ const { title, description, image = '/blog-placeholder-1.jpg' } = Astro.props
window.getComputedStyle(css).opacity
document.head.removeChild(css)
setGiscusTheme()
}
function preloadTheme() {
@ -229,18 +226,6 @@ const { title, description, image = '/blog-placeholder-1.jpg' } = Astro.props
}
}
const setGiscusTheme = () => {
const giscus = document.querySelector('.giscus-frame')
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()
}
}
document.addEventListener('DOMContentLoaded', () => init())
document.addEventListener('astro:after-swap', () => init())
preloadTheme()