async theme

This commit is contained in:
tangly1024
2023-06-04 18:08:14 +08:00
parent 063dc63111
commit 351878dc13
16 changed files with 33 additions and 24 deletions

View File

@@ -14,7 +14,11 @@ export default function Live2D() {
]).then((e) => {
if (typeof window?.loadlive2d !== 'undefined') {
// https://github.com/xiazeyu/live2d-widget-models
loadlive2d('live2d', BLOG.WIDGET_PET_LINK)
try {
loadlive2d('live2d', BLOG.WIDGET_PET_LINK)
} catch (error) {
}
}
})
}

View File

@@ -1,10 +1,15 @@
/**
* 主题文件被加载出之前的占位符
* @returns
*/
const Loading = () => {
return <div className="w-screen h-screen flex justify-center items-center">
<h1>Loading... <i className='ml-2 fas fa-spinner animate-spin' /></h1>
</div>
const Loading = (props) => {
const { current } = props
return <>
{current || <div className="w-screen h-screen flex justify-center items-center">
<h1>Loading... <i className='ml-2 fas fa-spinner animate-spin' /></h1>
</div>}
</>
}
export default Loading

View File

@@ -25,7 +25,7 @@ const PrismMac = () => {
}
loadExternalResource(BLOG.PRISM_THEME_PATH, 'css')
loadExternalResource(BLOG.PRISM_JS_AUTO_LOADER, 'js').then((url) => {
console.log('渲染公式图表')
// console.log('渲染公式图表')
if (window?.Prism?.plugins?.autoloader) {
window.Prism.plugins.autoloader.languages_path = BLOG.PRISM_JS_PATH
}